Exemplo n.º 1
0
        public Series getSeriesOfLastPredictions(int dataLength)
        {
            //Create the prediction data series
            Series predictionSeries = new Series(lastPredictions, dataLength - lastPredictions.Length);
            predictionSeries.style.showLines = false;
            predictionSeries.style.showPoints = true;
            predictionSeries.style.pointColor = Color.LightBlue;

            return predictionSeries;
        }
Exemplo n.º 2
0
        public void addSeries(Series series)
        {
            seriesList.Add(series);

            //
            //Make sure scales are correct
            //

            //Adjust horizontal size if needed
            if (series.Length() > maxLength)
            {
                maxLength = series.Length();
            }

            //Get vertical scale
            if (series.maxHeight() > maxHeight)
            {
                maxHeight = series.maxHeight();
            }

            //Rescale
            rescale();
        }
Exemplo n.º 3
0
        private void ind_btn_mouseClick(object sender, EventArgs e)
        {
            SuspendLayout();

            plot.removeAllSeries();
            ButtonInd btn = (ButtonInd)sender;
            Individual ind = btn.ind;
            double[] data = btn.data;

            //Clear Display and print individuals equation, fitness, and prediction values
            Display.cout.Clear();
            ind.printInfix();
            Display.cout.writeLine();
            Display.cout.writeLine("Fitness: " + ind.getLastFitness().ToString());
            Display.cout.write("Predictions: ");
            foreach(double p in ind.getLastPredictions()) { Display.cout.write(p.ToString() + ", "); }
            Display.cout.writeLine();

            //Graph the individual and its predictions
            Series dataSeries = new Series(data);
            plot.addSeries(dataSeries);
            plot.addSeries(ind.getSeriesOfLastPredictions(data.Length));
            refreshGraph();

            ResumeLayout();
            PerformLayout();
        }