for (int k = 0; k
{
int ai = Convert.ToInt32 (dgA [k, j]. Value.ToString ());
int ki = Convert.ToInt32 (dgK [k, j]. Value.ToString ());
int xi = Convert.ToInt32 (dgX [k, i]. Value.ToString ());
sum + = ai * Convert.ToInt32 (Math.Pow ((double) xi, (double) k));
}
list.Add (sum);
}
y.Add (list);
}
}
}
private void button2_Click (object sender, EventArgs e)
{
textBox1.Text = "";
paretoSet = new List ();
if (y.Count == 0)
GetValuesFromGrid ();
pareto = new Pareto ();
paretoSet = pareto.GetPareto (y);
paretoSet2 = pareto.GetPareto2 (y);
WriteList ("метод1:", paretoSet);
WriteList ("метод2:", paretoSet2);
SolutionsView solView = new SolutionsView (pareto.GetParetoList (y));
solView.Show ();
if (krit == 2 | | n == 2)
DrawGraph ();
}
private void WriteList (string text, List set)
{
textBox1.Text + = text;
foreach (int val in set)
textBox1.Text + = (val +1). ToString () + ";";
}
private void InitGrid ()
{
krit = Convert.ToInt32 (comboBox3.Text);
var = Convert.ToInt32 (comboBox4.Text);
comp = Convert.ToInt32 (comboBox5.Text);
dgA.ColumnCount = comp;
dgK.ColumnCount = comp;
dgX.ColumnCount = comp;
dgA.RowCount = krit;
dgK.RowCount = krit;
dgX.RowCount = var;
}
private void button3_Click (object sender, EventArgs e)
{
InitGrid ();
for (int q = 0; q
{
dgK.Columns [q]. Name = (q + 1). ToString ();
dgA.Columns [q]. Name = (q + 1). ToString ();
dgX.Columns [q]. Name = (q + 1). ToString ();
}
}
private void dataGridView1_CellFormatting (object sender, DataGridViewCellFor...