コード例 #1
0
ファイル: Individual.cs プロジェクト: marler8997/Stocker
        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;
        }
コード例 #2
0
ファイル: Grapher.cs プロジェクト: marler8997/Stocker
        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();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: marler8997/Stocker
        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();
        }