Exemplo n.º 1
0
 public DefaultBasisInput(LinearProgrammingProblem canonicalProblem, FormInitialConditions previousForm)
 {
     this.canonicalProblem = canonicalProblem;
     this.previousForm     = previousForm;
     defaultBasisIndexes   = new int[canonicalProblem.LimitationNumber];
     InitializeComponent();
 }
Exemplo n.º 2
0
 public DefaultSolutionInput(LinearProgrammingProblem canonicalProblem, FormInitialConditions previousForm)
 {
     this.canonicalProblem = canonicalProblem;
     this.previousForm     = previousForm;
     defaultSolution       = new Vector(canonicalProblem.VariableNumber);
     InitializeComponent();
 }
Exemplo n.º 3
0
 public ResultForm(LinearProgrammingProblem problem, FormInitialConditions formWithProblem)
 {
     this.problem         = problem;
     this.formWithProblem = formWithProblem;
     givenProblem         = formWithProblem.Problem;
     InitializeComponent();
 }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                VariableNumber = Convert.ToInt32(textBox1.Text);
            }
            catch (FormatException)
            {
                MessageBox.Show("Введенное значение для количества переменных не является натуральным числом!");
                textBox1.Text = "";
                return;
            }
            catch (OverflowException)
            {
                MessageBox.Show("Введенное значение, к сожалению, слишком велико!");
                textBox1.Text = "";
                return;
            }
            catch (Exception)
            {
                MessageBox.Show("Неизвестная ошибка!");
                textBox1.Text = "";
                return;
            }
            if (VariableNumber <= 0)
            {
                MessageBox.Show("Введенное значение для количества переменных не является натуральным числом!");
                textBox1.Text = "";
                return;
            }
            try
            {
                LimitationNumber = Convert.ToInt32(textBox2.Text);
            }
            catch (FormatException)
            {
                MessageBox.Show("Введенное значение для количества ограничений не является натуральным числом!");
                textBox2.Text = "";
                return;
            }
            catch (OverflowException)
            {
                MessageBox.Show("Введенное значение, к сожалению, слишком велико!");
                textBox2.Text = "";
                return;
            }
            catch (Exception)
            {
                MessageBox.Show("Неизвестная ошибка!");
                textBox2.Text = "";
                return;
            }
            if (!radioButton1.Checked && !radioButton2.Checked && !radioButton3.Checked)
            {
                MessageBox.Show("Выберите один из методов!");
                return;
            }
            if (LimitationNumber <= 0)
            {
                MessageBox.Show("Введенное значение для количества ограничений не является натуральным числом!");
                textBox2.Text = "";
                return;
            }
            else if (radioButton1.Checked)
            {
                MethodNumber = 0;
            }
            else if (radioButton2.Checked)
            {
                MethodNumber = 1;
            }
            else
            {
                MethodNumber = 2;
            }
            PrintAlgorithms = checkBox1.Checked;
            Hide();
            FormInitialConditions initForm = new FormInitialConditions(VariableNumber, LimitationNumber, MethodNumber, PrintAlgorithms, this);

            initForm.Show();
        }