private StepItemViewModel NextStep(int stepsCount)
        {
            var result   = _population.StepForward(stepsCount);
            var nextStep = new StepItemViewModel {
                Name                = string.Format("Step {0} Population count: {1}", (Steps.Items.Count + 1), _population.Count()),
                BestSolution        = string.Format("{0}\n val: {1}", result.Function.ToString(), result.FitnesFunctionVal),
                MeasuresByDimention = result.MeasuresByDimention
            };

            BestSolution     = nextStep.BestSolution;
            BestSolutionTree = result.Function.ExprRoot.CollectTree(n => n.GetChildren(), n => n.ToString());

            return(nextStep);
        }
        private void RedrawStep(StepItemViewModel step)
        {
            foreach (var plot in Plots)
            {
                var scatterSeries = plot.Series.FirstOrDefault(s => (s is ScatterSeries) && s.Title != "target");

                var points   = step.MeasuresByDimention[plot.Title].Select(m => new ScatterPoint(m.TermValues[plot.Title], m.HypothesisFuncResult)).ToList();
                var plotData = new List <ScatterPoint>(points);

                if (scatterSeries != null)
                {
                    (scatterSeries as ScatterSeries).ItemsSource = plotData;
                }
            }

            var P = Plots;

            Plots = null;
            this.OnPropertyChanged("Plots");
            Plots = P;
            this.OnPropertyChanged("Plots");
        }