Пример #1
0
        private void newGraphToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form newgraph = new GeneticFunction();

            newgraph.Height = this.Height;
            newgraph.Width  = this.Width;
            newgraph.Show();
        }
Пример #2
0
        private void textBoxEquation_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            GeneticFunction newgraph = new GeneticFunction();

            newgraph.Height             = this.Height;
            newgraph.Width              = this.Width;
            newgraph.Settings.FunctionA = this.textBoxEquation.Text;
            newgraph.Show();
        }
Пример #3
0
        public GeneticSettingsDialog(GeneticPolyApproximation _GeneticPoly, GeneticFunction _MainForm)
        {
            mGeneticPoly = _GeneticPoly;
            mMainForm    = _MainForm;

            InitializeComponent();

            this.comboBoxExponentType.Items.Add(ExponentTypes.PositiveInteger);
            this.comboBoxExponentType.Items.Add(ExponentTypes.Integer);
            this.comboBoxExponentType.Items.Add(ExponentTypes.PositiveReal);
            this.comboBoxExponentType.Items.Add(ExponentTypes.Real);
            this.comboBoxExponentType.SelectedIndex = 0;

            this.textBoxTerms.Text              = "5";
            this.textBoxPopulationSize.Text     = "50";
            this.textBoxPercentReproducing.Text = "0.50";
            this.textBoxChanceOfMutatiion.Text  = "0.50";
            this.textBoxGenerations.Text        = "100";
            this.textBoxCrossoverPoint.Text     = "5";
            this.comboBoxExponentType.Text      = ExponentTypes.PositiveInteger;
            this.textBoxError.Text              = "0.05";
        }
Пример #4
0
        public GeneticSettingsDialog(GeneticPolyApproximation _GeneticPoly, GeneticFunction _MainForm)
        {
            mGeneticPoly = _GeneticPoly;
            mMainForm = _MainForm;

            InitializeComponent();

            this.comboBoxExponentType.Items.Add(ExponentTypes.PositiveInteger);
            this.comboBoxExponentType.Items.Add(ExponentTypes.Integer);
            this.comboBoxExponentType.Items.Add(ExponentTypes.PositiveReal);
            this.comboBoxExponentType.Items.Add(ExponentTypes.Real);
            this.comboBoxExponentType.SelectedIndex = 0;

            this.textBoxTerms.Text = "5";
            this.textBoxPopulationSize.Text = "50";
            this.textBoxPercentReproducing.Text = "0.50";
            this.textBoxChanceOfMutatiion.Text = "0.50";
            this.textBoxGenerations.Text = "100";
            this.textBoxCrossoverPoint.Text = "5";
            this.comboBoxExponentType.Text = ExponentTypes.PositiveInteger;
            this.textBoxError.Text = "0.05";
        }
Пример #5
0
        public GraphSettingsDialog(GraphSettings _settings, GeneticFunction _mainForm)
        {
            InitializeComponent();

            this.checkBoxGrid.Checked = _settings.Grid;
            this.textBoxGridWidth.Text = _settings.GridWidth.ToString();

            this.checkBoxSmoothGraph.Checked = _settings.SmoothGraph;

            this.comboBoxGraphType.Items.Add(GraphTypes.Function);
            this.comboBoxGraphType.Items.Add(GraphTypes.Derivative);
            this.comboBoxGraphType.Items.Add(GraphTypes.Slope);
            this.comboBoxGraphType.Items.Add(GraphTypes.VectorField);
            this.comboBoxGraphType.Items.Add(GraphTypes.LevelCurves);
            this.comboBoxGraphType.Items.Add(GraphTypes.LevelCurves2);
            this.comboBoxGraphType.Items.Add(GraphTypes.ParametricFamily);
            this.comboBoxGraphType.Items.Add(GraphTypes.ParametricFunction);
            this.comboBoxGraphType.Items.Add(GraphTypes.Iteration);
            this.comboBoxGraphType.Items.Add(GraphTypes.Cobweb);
            this.comboBoxGraphType.Items.Add(GraphTypes.TwoDIteration);
            this.comboBoxGraphType.SelectedIndex = 0;

            settings = new GraphSettings();
            settings = _settings;

            mainForm = _mainForm;

            this.textBoxSlopeColorLimit.Text = settings.SlopeColorLimit.ToString();
            this.textBoxBaseB.Text = settings.BaseB.ToString();
            this.textBoxBaseG.Text = settings.BaseG.ToString();
            this.textBoxBaseR.Text = settings.BaseR.ToString();

            this.textBoxFunctionA.Text = settings.FunctionA.ToString();
            this.textBoxFunctionB.Text = settings.FunctionB.ToString();

            //Family constants
            this.textBoxC1Incr.Text = settings.C1Incr.ToString();
            this.textBoxC1Max.Text = settings.C1Max.ToString();
            this.textBoxC1Min.Text = settings.C1Min.ToString();

            this.textBoxC2Incr.Text = settings.C2Incr.ToString();
            this.textBoxC2Max.Text = settings.C2Max.ToString();
            this.textBoxC2Min.Text = settings.C2Min.ToString();

            //Funxction constants
            this.textBoxTraceLen.Text = settings.TraceLen.ToString();
            this.textBoxxIncr.Text = settings.XIncr.ToString();
            this.textBoxxMax.Text = settings.XMax.ToString();
            this.textBoxxMin.Text = settings.XMin.ToString();

            this.textBoxyIncr.Text = settings.YIncr.ToString();
            this.textBoxyMax.Text = settings.YMax.ToString();
            this.textBoxyMin.Text = settings.YMin.ToString();

            this.textBoxStartingX.Text = settings.StartingX.ToString();
            this.textBoxN.Text = settings.N.ToString();

            this.pictureBoxBackground.BackColor = settings.Background;
            this.colorDialog1.Color = settings.Background;

            if (settings.GraphType.Equals(GraphTypes.Derivative))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Derivative;
            }
            else if (settings.GraphType.Equals(GraphTypes.Function))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Function;
            }
            else if (settings.GraphType.Equals(GraphTypes.VectorField))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.VectorField;
            }
            else if (settings.GraphType.Equals(GraphTypes.Slope))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Slope;
            }
            else if (settings.GraphType.Equals(GraphTypes.ParametricFamily))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.ParametricFamily;
            }
            else if (settings.GraphType.Equals(GraphTypes.ParametricFunction))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.ParametricFunction;
            }
            else if (settings.GraphType.Equals(GraphTypes.Iteration))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Iteration;
            }
            else if (settings.GraphType.Equals(GraphTypes.Cobweb))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Cobweb;
            }
            else if (settings.GraphType.Equals(GraphTypes.TwoDIteration))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.TwoDIteration;
            }
        }
Пример #6
0
 public Calulations(GeneticFunction _mainForm, PointPairList _points)
 {
     InitializeComponent();
     mainForm = _mainForm;
     pointlist = _points;
 }
Пример #7
0
 public Calulations(GeneticFunction _mainForm, PointPairList _points)
 {
     InitializeComponent();
     mainForm  = _mainForm;
     pointlist = _points;
 }
Пример #8
0
 private void newGraphToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form newgraph = new GeneticFunction();
     newgraph.Height = this.Height;
     newgraph.Width = this.Width;
     newgraph.Show();
 }
Пример #9
0
 private void textBoxEquation_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     GeneticFunction newgraph = new GeneticFunction();
     newgraph.Height = this.Height;
     newgraph.Width = this.Width;
     newgraph.Settings.FunctionA = this.textBoxEquation.Text;
     newgraph.Show();
 }
Пример #10
0
        public GraphSettingsDialog(GraphSettings _settings, GeneticFunction _mainForm)
        {
            InitializeComponent();

            this.checkBoxGrid.Checked  = _settings.Grid;
            this.textBoxGridWidth.Text = _settings.GridWidth.ToString();

            this.checkBoxSmoothGraph.Checked = _settings.SmoothGraph;

            this.comboBoxGraphType.Items.Add(GraphTypes.Function);
            this.comboBoxGraphType.Items.Add(GraphTypes.Derivative);
            this.comboBoxGraphType.Items.Add(GraphTypes.Slope);
            this.comboBoxGraphType.Items.Add(GraphTypes.VectorField);
            this.comboBoxGraphType.Items.Add(GraphTypes.LevelCurves);
            this.comboBoxGraphType.Items.Add(GraphTypes.LevelCurves2);
            this.comboBoxGraphType.Items.Add(GraphTypes.ParametricFamily);
            this.comboBoxGraphType.Items.Add(GraphTypes.ParametricFunction);
            this.comboBoxGraphType.Items.Add(GraphTypes.Iteration);
            this.comboBoxGraphType.Items.Add(GraphTypes.Cobweb);
            this.comboBoxGraphType.Items.Add(GraphTypes.TwoDIteration);
            this.comboBoxGraphType.SelectedIndex = 0;

            settings = new GraphSettings();
            settings = _settings;

            mainForm = _mainForm;

            this.textBoxSlopeColorLimit.Text = settings.SlopeColorLimit.ToString();
            this.textBoxBaseB.Text           = settings.BaseB.ToString();
            this.textBoxBaseG.Text           = settings.BaseG.ToString();
            this.textBoxBaseR.Text           = settings.BaseR.ToString();

            this.textBoxFunctionA.Text = settings.FunctionA.ToString();
            this.textBoxFunctionB.Text = settings.FunctionB.ToString();

            //Family constants
            this.textBoxC1Incr.Text = settings.C1Incr.ToString();
            this.textBoxC1Max.Text  = settings.C1Max.ToString();
            this.textBoxC1Min.Text  = settings.C1Min.ToString();

            this.textBoxC2Incr.Text = settings.C2Incr.ToString();
            this.textBoxC2Max.Text  = settings.C2Max.ToString();
            this.textBoxC2Min.Text  = settings.C2Min.ToString();

            //Funxction constants
            this.textBoxTraceLen.Text = settings.TraceLen.ToString();
            this.textBoxxIncr.Text    = settings.XIncr.ToString();
            this.textBoxxMax.Text     = settings.XMax.ToString();
            this.textBoxxMin.Text     = settings.XMin.ToString();

            this.textBoxyIncr.Text = settings.YIncr.ToString();
            this.textBoxyMax.Text  = settings.YMax.ToString();
            this.textBoxyMin.Text  = settings.YMin.ToString();

            this.textBoxStartingX.Text = settings.StartingX.ToString();
            this.textBoxN.Text         = settings.N.ToString();

            this.pictureBoxBackground.BackColor = settings.Background;
            this.colorDialog1.Color             = settings.Background;

            if (settings.GraphType.Equals(GraphTypes.Derivative))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Derivative;
            }
            else if (settings.GraphType.Equals(GraphTypes.Function))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Function;
            }
            else if (settings.GraphType.Equals(GraphTypes.VectorField))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.VectorField;
            }
            else if (settings.GraphType.Equals(GraphTypes.Slope))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Slope;
            }
            else if (settings.GraphType.Equals(GraphTypes.ParametricFamily))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.ParametricFamily;
            }
            else if (settings.GraphType.Equals(GraphTypes.ParametricFunction))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.ParametricFunction;
            }
            else if (settings.GraphType.Equals(GraphTypes.Iteration))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Iteration;
            }
            else if (settings.GraphType.Equals(GraphTypes.Cobweb))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.Cobweb;
            }
            else if (settings.GraphType.Equals(GraphTypes.TwoDIteration))
            {
                this.comboBoxGraphType.SelectedItem = GraphTypes.TwoDIteration;
            }
        }