private void graphTimer_Tick(object sender, EventArgs e) { rtbInfo.AppendText(nog_count + ") Xavg: " + Math.Round(myGA.chromoValue.Average(), 2) + "\tFxavg " + Math.Round(Equation.F3x(myGA.chromoValue.Average()), 2) + "\tFitness " + Math.Round(myGA.chromoFitness.Average(), 2) + "\n"); GAPointsRPPL.Clear(); for (int i = 0; i < myGA.populationSize; i++) { GAPointsRPPL.Add(myGA.chromoValue[i], Equation.set(myGA.functionType, myGA.chromoValue[i])); } PCavgPointsRPPL.Add(nog_count, myGA.chromoValue.Average()); PCmaxPointsRPPL.Add(nog_count, myGA.chromoValue.Max()); //PCavgPointsRPPL.Add(nog_count, myGA.chromoFitness.Average()); //PCmaxPointsRPPL.Add(nog_count, myGA.chromoFitness.Max()); zgcFunction.Invalidate(); zgcPerformance.Invalidate(); }
/*Creates the curve for the equation type 1*/ public void setGraphFunction() { setGraphSettings(); EqPointsRPPL.Clear(); double i = myGA.rangeMin; double j; while (i < myGA.rangeMax) { j = Equation.set(myGA.functionType, i); EqPointsRPPL.Add(i, j); i = i + 0.05; } zgcFunction.Invalidate(); //for (double i = myGA.rangeMin; i < myGA.rangeMax; i=i+0.05) //{ // EqPointsRPPL.Add(i, Equation.set(myGA.functionType, i)); //} }