private void buttonABunderRM_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
FormChart chart = new FormChart("Solution Space under RM");
try
{
DataTable dt = GetSelectedTaskSet();
double period_min = Get_Pmin(dt);
Series s2 = new Series("Solution space by AB under RM");
s2.ChartArea = "ChartArea1";
s2.ChartType = SeriesChartType.Line;
s2.Legend = "Legend1";
s2.Color = Color.Tomato;
for (double i = _incrementUnit; i <= period_min; i += _incrementUnit)
{
double maxTheta = i - 1;
int max_k = GetK_underRM(dt, i, maxTheta);
double AB = GetAB_RM(dt, max_k);
if (double.IsInfinity(AB))
continue;
s2.Points.Add(new DataPoint(i, AB + 2 * _overhead / i));
}
chart.AxisX.Title = "Resource period (Π)";
chart.AxisY.Title = "Resource capacity (Θ/Π)";// "Resource allocation (Θ)";
chart.AxisX.Minimum = _incrementUnit;
chart.AxisY.Maximum = 1;
chart.EnableLegend = false;
chart.AddSeries(s2);
}
finally
{
this.Cursor = Cursors.Default;
}
chart.Show();
}