Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml	(revision 12840)
@@ -102,6 +102,6 @@
                         </Grid.RowDefinitions>
                         <ListBox Name="ListBoxRuns" Grid.Column="0" Width="100" ItemsSource="{Binding Runs}" SelectionChanged="ListBoxRuns_OnSelectionChanged"/>
-                        <TabControl Grid.Column="1">
-                            <TabItem Header="Quality-Chart">
+                        <TabControl Name="ChartSelector" Grid.Column="1" SelectionChanged="Selector_OnSelectionChanged">
+                            <TabItem Name="TabQualityChart" Header="Quality-Chart">
                                 <Grid>
                                     <Grid.RowDefinitions>
@@ -114,10 +114,10 @@
                                     <d3:ChartPlotter Grid.Column="1" x:Name="QualityChartPlotter" LegendVisible="False" EnableSmoothPanningForNumericAxes="True">
                                         <d3:Header Content="Quality-Chart"/>
-                                        <d3:VerticalAxisTitle Content="Quality" />
-                                        <d3:HorizontalAxisTitle Content="Evaluation"/>
+                                        <d3:VerticalAxisTitle Content="Qualität" />
+                                        <d3:HorizontalAxisTitle Content="Evaluierungen"/>
                                     </d3:ChartPlotter>
                                 </Grid>
                             </TabItem>
-                            <TabItem Header="SelectionIndicator-Chart">
+                            <TabItem Name="TabSelectionIndicator" Header="SelectionIndicator-Chart">
                                 <Grid>
                                     <Grid.RowDefinitions>
@@ -128,8 +128,7 @@
                                         <ColumnDefinition Width="*"></ColumnDefinition>
                                     </Grid.ColumnDefinitions>
-                                    <d3:ChartPlotter Grid.Column="1" x:Name="SelectionChartPlotter" LegendVisible="False" EnableSmoothPanningForNumericAxes="True">
-                                        <d3:Header Content="SelectionIndicator-Chart"/>
-                                        <d3:VerticalAxisTitle Content="SelectionIndicator" />
-                                        <d3:HorizontalAxisTitle Content="SelectedNodes"/>
+                                    <d3:ChartPlotter Grid.Column="1" x:Name="SelectionChartPlotter" LegendVisible="False" EnableSmoothPanningForNumericAxes="True" >
+                                        <d3:VerticalAxisTitle Content="Qualität" />
+                                        <d3:HorizontalAxisTitle Content="Evaluierungen"/>
                                     </d3:ChartPlotter>
                                 </Grid>
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs	(revision 12840)
@@ -5,4 +5,5 @@
 using System.Threading.Tasks;
 using System.Windows.Documents;
+using System.Windows.Media;
 using System.Xml.Serialization;
 using Evaluation.ViewModel;
@@ -43,8 +44,8 @@
             CenterWindowOnScreen();
             this.DataContext = vm = new EvaluationViewModel();
-            vm.MaxLen = 23;
-            vm.MaxIterations = 500000;
+            vm.MaxLen = 17;
+            vm.MaxIterations = 300000;
             vm.NrRuns = 20;
-            vm.MaxThreads = 5;
+            vm.MaxThreads = 10;
         }
 
@@ -72,5 +73,5 @@
 
             ds.SetXMapping(x => x.Iteration);
-            ds.SetYMapping(y => y.Quality);
+            ds.SetYMapping(y => y.Quality / run.BestKnownQuality);
 
             LineGraph graph = new LineGraph(ds);
@@ -82,14 +83,33 @@
         private void DrawSelectionChart(Run run)
         {
+            // quality line
+            List<FoundSolution> solutions = new List<FoundSolution>(run.FoundSolutions);
+
+            if (run.BestSolutionFoundAt < run.Evaluations)
+            {
+                solutions.Add(new FoundSolution(run.EndTime, run.Evaluations, run.BestQuality, run.BestSolution));
+            }
+
+            var ds = new EnumerableDataSource<FoundSolution>(solutions);
+
+
+            ds.SetXMapping(x => x.Iteration);
+            ds.SetYMapping(y => y.Quality / run.BestKnownQuality);
+
+            LineGraph graph = new LineGraph(ds);
+            graph.StrokeThickness = 2;
+            graph.AddToPlotter(SelectionChartPlotter);
+
+            // selection indicator line
             List<SelectionIndicator> selectionIndicators = new List<SelectionIndicator>(run.SelectionIndicators);
 
-            var ds = new EnumerableDataSource<SelectionIndicator>(selectionIndicators);
-
-            ds.SetXMapping(x => x.TotalSelections);
-            ds.SetYMapping(y => y.Indicator);
-
-            LineGraph graph = new LineGraph(ds);
-
+            var dssi = new EnumerableDataSource<SelectionIndicator>(selectionIndicators);
+
+            dssi.SetXMapping(x => x.Evaluation);
+            dssi.SetYMapping(y => y.Indicator);
+
+            graph = new LineGraph(dssi);
             graph.StrokeThickness = 2;
+            graph.Stroke = Brushes.Red;
             graph.AddToPlotter(SelectionChartPlotter);
         }
@@ -182,5 +202,5 @@
                 policyInstance = new BoltzmannExplorationPolicy(2);
             }
-            else if (policy == typeof (EpsGreedyPolicy))
+            else if (policy == typeof(EpsGreedyPolicy))
             {
                 policyInstance = new EpsGreedyPolicy(vm.Epsylon);
@@ -228,5 +248,5 @@
             }
             Task.Run(() =>
-                Parallel.For(0, vm.NrRuns, new ParallelOptions {MaxDegreeOfParallelism = vm.MaxThreads},
+                Parallel.For(0, vm.NrRuns, new ParallelOptions { MaxDegreeOfParallelism = vm.MaxThreads },
                     i => DoRun(vm.Runs[i])));
         }
@@ -434,5 +454,5 @@
         private void ComboBoxPolicies_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            if (vm.SelectedPolicy == typeof (EpsGreedyPolicy))
+            if (vm.SelectedPolicy == typeof(EpsGreedyPolicy))
             {
                 TextBoxEpsylon.Visibility = Visibility.Visible;
@@ -445,4 +465,30 @@
             }
         }
+
+        private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (ChartSelector.SelectedItem == TabSelectionIndicator)
+            {
+                if (vm.SelectedRun != null)
+                {
+                    if (vm.SelectedRun.RunState == RunState.Finished)
+                    {
+                        ClearSelectionChart();
+                        DrawSelectionChart(vm.SelectedRun);
+                    }
+                }
+            }
+            else if (ChartSelector.SelectedItem == TabQualityChart)
+            {
+                if (vm.SelectedRun != null)
+                {
+                    if (vm.SelectedRun.RunState == RunState.Finished)
+                    {
+                        ClearQualityChart();
+                        DrawQualityChart(vm.SelectedRun);
+                    }
+                }
+            }
+        }
     }
 }
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs	(revision 12840)
@@ -1,3 +1,4 @@
-﻿using HeuristicLab.Algorithms.Bandits;
+﻿using System.Diagnostics;
+using HeuristicLab.Algorithms.Bandits;
 using HeuristicLab.Algorithms.GrammaticalOptimization;
 using HeuristicLab.Algorithms.MonteCarloTreeSearch;
@@ -41,5 +42,5 @@
             RunState = RunState.NotStarted;
             FoundSolutions = new List<FoundSolution>();
-            CurrentSelectionIndicator = new SelectionIndicator(0, 0);
+            CurrentSelectionIndicator = new SelectionIndicator(0, 0, 0);
 
             BestKnownQuality = problem.BestKnownQuality(maxLen);
@@ -60,15 +61,15 @@
             {
                 MonteCarloTreeSearch mcts = (MonteCarloTreeSearch)solver;
-                mcts.NodeSelected += mcts_NodeSelected;
-            }
-        }
-
-        private void mcts_NodeSelected(int goodSelections, int totalSelections)
-        {
-            CurrentSelectionIndicator.GoodSelections = goodSelections;
-            CurrentSelectionIndicator.TotalSelections = totalSelections;
-            this.OnPropertyChanged("CurrentSelectionIndicator");
-            //CurrentSelectionIndicator = new SelectionIndicator(goodSelections, totalSelections);
-            //selectionIndicators.Add(CurrentSelectionIndicator);
+                mcts.IterationFinished += mcts_IterationFinished;
+            }
+        }
+
+        private void mcts_IterationFinished(int goodSelections, int totalSelections)
+        {
+            //CurrentSelectionIndicator.GoodSelections = goodSelections;
+            //CurrentSelectionIndicator.TotalSelections = totalSelections;
+            //this.OnPropertyChanged("CurrentSelectionIndicator");
+            CurrentSelectionIndicator = new SelectionIndicator(goodSelections, totalSelections, selectionIndicators.Count);
+            selectionIndicators.Add(CurrentSelectionIndicator);
         }
 
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/SelectionIndicator.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/SelectionIndicator.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/SelectionIndicator.cs	(revision 12840)
@@ -13,8 +13,9 @@
             
         }
-        public SelectionIndicator(int goodSelections, int totalSelections)
+        public SelectionIndicator(int goodSelections, int totalSelections, int evaluation)
         {
             GoodSelections = goodSelections;
             TotalSelections = totalSelections;
+            Evaluation = evaluation;
         }
 
@@ -22,4 +23,6 @@
         public int TotalSelections { get; set; }
 
+        public int Evaluation { get; set; }
+
         public double Indicator { get { return Math.Round((double)GoodSelections / TotalSelections, 5); } }
     }
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GeneticProgramming/StandardGP.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GeneticProgramming/StandardGP.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GeneticProgramming/StandardGP.cs	(revision 12840)
@@ -31,5 +31,5 @@
       TournamentGroupSize = 4;
       MutationRate = 0.15;
-      MaxSolutionSize = 40;
+      MaxSolutionSize = 201;
       MaxSolutionDepth = 17;
       this.saveAlg = saveAlg;
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs	(revision 12840)
@@ -43,14 +43,14 @@
         }
 
-        public event Action<int, int> NodeSelected;
-
-        protected virtual void OnNodeSelectedChanged(int value, int selections)
-        {
-            RaiseNodeSelectedChanged(value, selections);
-        }
-
-        private void RaiseNodeSelectedChanged(int value, int selections)
-        {
-            var handler = NodeSelected;
+        public event Action<int, int> IterationFinished;
+
+        protected virtual void OnIterationFinishedChanged(int value, int selections)
+        {
+            RaiseIterationFinishedChanged(value, selections);
+        }
+
+        private void RaiseIterationFinishedChanged(int value, int selections)
+        {
+            var handler = IterationFinished;
             if (handler != null) handler(value, selections);
         }
@@ -66,6 +66,4 @@
                 goodSelections++;
             }
-
-            OnNodeSelectedChanged(goodSelections, selections);
         }
 
@@ -88,6 +86,6 @@
                         currentNode.GetChildActionInfos());
                     currentNode = currentNode.children[currentActionIndex];
-                    //selections++;
-                    //CheckSelection(currentNode, selections);
+                    selections++;
+                    CheckSelection(currentNode, selections);
                 }
 
@@ -100,6 +98,6 @@
                         currentNode.children[behaviourPolicy.SelectAction(random, currentNode.GetChildActionInfos())
                             ];
-                    //selections++;
-                    //CheckSelection(currentNode, selections);
+                    selections++;
+                    CheckSelection(currentNode, selections);
                 }
                 if (currentNode.phrase.Length <= maxLen)
@@ -108,4 +106,5 @@
                     OnSolutionEvaluated(simulatedPhrase, quality);
 
+                    OnIterationFinishedChanged(goodSelections, selections);
                     Propagate(currentNode, quality);
                 }
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch_PruneLeaves.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch_PruneLeaves.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch_PruneLeaves.cs	(revision 12840)
@@ -35,6 +35,6 @@
                         currentNode.GetChildActionInfos());
                     currentNode = currentNode.children[currentActionIndex];
-                    //selections++;
-                    //CheckSelection(currentNode, selections);
+                    selections++;
+                    CheckSelection(currentNode, selections);
                 }
 
@@ -56,6 +56,6 @@
                             currentNode.children[behaviourPolicy.SelectAction(random, currentNode.GetChildActionInfos())
                                 ];
-                        //selections++;
-                        //CheckSelection(currentNode, selections);
+                        selections++;
+                        CheckSelection(currentNode, selections);
                     }
                     else
@@ -71,4 +71,6 @@
                     OnSolutionEvaluated(simulatedPhrase, quality);
 
+                    OnIterationFinishedChanged(goodSelections, selections);
+
                     Propagate(currentNode, quality);
                 }
Index: /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Problems/SantaFeAntProblem.cs
===================================================================
--- /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Problems/SantaFeAntProblem.cs	(revision 12839)
+++ /branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Problems/SantaFeAntProblem.cs	(revision 12840)
@@ -217,8 +217,4 @@
         public void GenerateProblemSolutions(int maxLen)
         {
-            if (maxLen > 17)
-            {
-                throw new NotImplementedException();
-            }
             solutions = new string[12];
             solutions[0] = "?(m)(ll?(m)(r))mr";
