Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Evaluation.csproj
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Evaluation.csproj	(revision 12503)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Evaluation.csproj	(revision 12762)
@@ -54,5 +54,6 @@
       <SubType>Designer</SubType>
     </ApplicationDefinition>
-    <Compile Include="ViewModel\EvaluationStat.cs" />
+    <Compile Include="EvaluationStat.cs" />
+    <Compile Include="Run.cs" />
     <Compile Include="ViewModel\EvaluationViewModel.cs" />
     <Page Include="MainWindow.xaml">
@@ -137,4 +138,8 @@
       <Name>HeuristicLab.Problems.GrammaticalOptimization</Name>
     </ProjectReference>
+    <ProjectReference Include="..\WpfTestSvgSample\WpfTestSvgSample.csproj">
+      <Project>{514a1e9d-0900-46a5-8073-f3c9cb2aaee3}</Project>
+      <Name>WpfTestSvgSample</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/EvaluationStat.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/EvaluationStat.cs	(revision 12762)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/EvaluationStat.cs	(revision 12762)
@@ -0,0 +1,28 @@
+﻿using System;
+
+namespace Evaluation
+{
+    public class EvaluationStat
+    {
+        public DateTime Time { get; set; }
+
+        public long Iteration { get; set; }
+
+        public double Quality { get; set; }
+
+        public double CurrentBestQuality { get; set; }
+
+        public EvaluationStat()
+        {
+            
+        }
+
+        public EvaluationStat(DateTime time, long iteration, double quality, double currentBestQuality)
+        {
+            Time = time;
+            Iteration = iteration;
+            Quality = quality;
+            CurrentBestQuality = currentBestQuality;
+        }
+    }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml	(revision 12503)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml	(revision 12762)
@@ -5,5 +5,5 @@
         xmlns:charts="http://research.microsoft.com/DynamicDataDisplay/1.0"
 
-        Title="MainWindow" Height="576" Width="768">
+        Title="MainWindow" Height="900" Width="1600" Loaded="Window_Loaded">
     <Grid Margin="10">
         <Grid.RowDefinitions>
@@ -22,4 +22,5 @@
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="Auto" />
+                <ColumnDefinition Width="Auto" />
                 <ColumnDefinition Width="*" />
             </Grid.ColumnDefinitions>
@@ -30,5 +31,5 @@
                       SelectedValue="{Binding SelectedProblem}"
                       HorizontalAlignment="Left" Grid.Column="1" Grid.Row="0" Width="200" Margin="2">
-                
+
             </ComboBox>
             <TextBlock VerticalAlignment="Center" Grid.Column="0" Grid.Row="1">Algorithm:</TextBlock>
@@ -47,29 +48,160 @@
                           Width="200" Margin="5,0,0,0"></ComboBox>
                 <Button Name="ButtonRun" Margin="5,0,0,0" Click="ButtonRun_OnClick" Height="22" VerticalAlignment="Top">Run</Button>
-                <Button Name="ButtonPause" Margin="5,0,0,0" Click="ButtonPause_OnClick">Pause</Button>
-                <Button Name="ButtonStop" Margin="5,0,0,0" Click="ButtonStop_OnClick">Stop</Button>
+                <Button Name="ButtonPause" Margin="5,0,0,0" Click="ButtonPause_OnClick" IsEnabled="False">Pause</Button>
+                <Button Name="ButtonStop" Margin="5,0,0,0" Click="ButtonStop_OnClick" IsEnabled="False">Stop</Button>
+            </StackPanel>
+            <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
+                <Button Name="LoadButton" Click="LoadButton_OnClick">Load</Button>
+                <Button Name="SaveButton" Click="SaveButton_OnClick" Margin="5,0,0,0">Save</Button>
             </StackPanel>
         </Grid>
-        <GroupBox Grid.Row="1" Header="Settings" Name="GroupBoxSettings">coming soon...</GroupBox>
+        <GroupBox Grid.Row="1" Header="Settings" Name="GroupBoxSettings">
+            <Grid>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="Auto" />
+                    <RowDefinition Height="Auto" />
+                </Grid.RowDefinitions>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="Auto" />
+                    <ColumnDefinition Width="Auto" />
+                    <ColumnDefinition Width="Auto" />
+                    <ColumnDefinition Width="Auto" />
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
+                <TextBlock Margin="2" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">Runs:</TextBlock>
+                <TextBox Name="TextBoxRuns" Margin="2" Grid.Column="1" Grid.Row="0" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding NrRuns}"></TextBox>
+                <TextBlock Margin="2" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center">MaxEvaluations:</TextBlock>
+                <TextBox Name="TextBoxMaxEvaluations" Margin="2" Grid.Column="1" Grid.Row="1" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxEvaluations}"></TextBox>
+                <TextBlock Margin="2" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center">MaxLen:</TextBlock>
+                <TextBox Name="TextBoxMaxLen" Margin="2" Grid.Column="3" Grid.Row="0" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxLen}"></TextBox>
+                <TextBlock Margin="2" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center">Threads:</TextBlock>
+                <TextBox Name="TextBoxThreads" Margin="2" Grid.Column="3" Grid.Row="1" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding Threads}"></TextBox>
+            </Grid>
+        </GroupBox>
         <Grid Grid.Row="2">
             <Grid.RowDefinitions>
                 <RowDefinition Height="*" />
-                <RowDefinition Height="Auto" />
             </Grid.RowDefinitions>
             <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="Auto" />
                 <ColumnDefinition Width="*" />
                 <ColumnDefinition Width="Auto" />
             </Grid.ColumnDefinitions>
-            <ComboBox Name="ComboBoxVerticalAxis" Grid.Row="0" Grid.Column="0" Width="100" HorizontalAlignment="Center" VerticalAlignment="Center"></ComboBox>
-
-            <d3:ChartPlotter x:Name="ChartPlotter" Grid.Row="0" Grid.Column="1" Margin="10,20,10,10" LegendVisible="False" EnableSmoothPanningForNumericAxes="True">
-                <d3:Header Content="{Binding HeaderString}"/>
-                <d3:VerticalAxisTitle Content="{Binding VerticalAxisString}" />
-                <d3:HorizontalAxisTitle Content="{Binding HorizontalAxisString}"/>
-            </d3:ChartPlotter>
-            
-            <Grid Grid.Column="2" Grid.Row="0" Margin="0,25,0,0">
+
+            <TabControl Grid.Row="0" Grid.Column="0" Margin="10,20,10,10" >
+                <TabItem Header="Run-Detail">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto"></ColumnDefinition>
+                            <ColumnDefinition Width="*"></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition Height="*"></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <ListBox Name="ListBoxRuns" Grid.Column="0" Width="100" ItemsSource="{Binding Runs}" SelectionChanged="ListBoxRuns_OnSelectionChanged"/>
+                        <TabControl Grid.Column="1">
+                            <TabItem Header="Chart">
+                                <Grid>
+                                    <Grid.RowDefinitions>
+                                        <RowDefinition Height="*"></RowDefinition>
+                                    </Grid.RowDefinitions>
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                        <ColumnDefinition Width="*"></ColumnDefinition>
+                                    </Grid.ColumnDefinitions>
+                                    <d3:ChartPlotter Grid.Column="1" x:Name="ChartPlotter" LegendVisible="False" EnableSmoothPanningForNumericAxes="True">
+                                        <d3:Header Content="{Binding HeaderString}"/>
+                                        <d3:VerticalAxisTitle Content="{Binding VerticalAxisString}" />
+                                        <d3:HorizontalAxisTitle Content="{Binding HorizontalAxisString}"/>
+                                    </d3:ChartPlotter>
+                                </Grid>
+                            </TabItem>
+                            <TabItem Header="Tree" Name="TabItemTree">
+                                <Grid>
+                                    <Grid.RowDefinitions>
+                                        <RowDefinition Height="*"></RowDefinition>
+                                    </Grid.RowDefinitions>
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                        <ColumnDefinition Width="*"></ColumnDefinition>
+                                    </Grid.ColumnDefinitions>
+                                    <Grid Name="MyGrid" Grid.Column="0" DataContext="{Binding CurrentRun.TreeInfos}">
+                                        <Grid.RowDefinitions>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                            <RowDefinition Height="Auto"></RowDefinition>
+                                        </Grid.RowDefinitions>
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                            <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                        </Grid.ColumnDefinitions>
+                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="TotalNodes:"></TextBlock>
+                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding TotalNodes}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="UnexpandedNodes:"></TextBlock>
+                                        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding UnexpandedNodes}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="ExpandedNodes:"></TextBlock>
+                                        <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding ExpandedNodes}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="LeaveNodes:"></TextBlock>
+                                        <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding LeaveNodes}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="4" Grid.Column="0" Text="DeepestLevel:"></TextBlock>
+                                        <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding DeepestLevel}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="5" Grid.Column="0" Text="AverageLevel:"></TextBlock>
+                                        <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding AverageLevel}" TextAlignment="Right"></TextBlock>
+                                        <TextBlock Grid.Row="6" Grid.Column="0" Text="AverageChildren:"></TextBlock>
+                                        <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding AverageChildren}" TextAlignment="Right"></TextBlock>
+                                    </Grid>
+                                    <Frame Grid.Column="1" Name="treeDrawing" Source="pack://application:,,,/WpfTestSvgSample;component/DrawingPage.xaml"/>
+                                </Grid>
+                            </TabItem>
+                        </TabControl>
+                    </Grid>
+                </TabItem>
+
+                <TabItem Header="Run-Comparison">
+                    <TabControl Name="TabControlRunComparison" SelectionChanged="TabControlRunComparison_OnSelectionChanged">
+                        <TabItem Name="TabItemChartRunComparison" Header="Chart">
+                            <d3:ChartPlotter x:Name="ComparisonChartPlotter" LegendVisible="False" EnableSmoothPanningForNumericAxes="True">
+                                <d3:Header Content="{Binding HeaderString}"/>
+                                <d3:VerticalAxisTitle Content="{Binding VerticalAxisString}" />
+                                <d3:HorizontalAxisTitle Content="{Binding HorizontalAxisString}"/>
+                            </d3:ChartPlotter>
+                        </TabItem>
+                        <TabItem Header="Table">
+                            <ListView ItemsSource="{Binding Path=Runs}">
+                                <ListView.View>
+                                    <GridView>
+                                        <GridView.Columns>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=RunNumber}"
+                                                            Header="Run #"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=Evaluations}"
+                                                            Header="Evaluations"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=BestKnownQuality}"
+                                                            Header="BestKnownQuality"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=BestSolutionQuality}"
+                                                            Header="BestFoundQuality"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=EvaluationsPerSecond}"
+                                                            Header="EvaluationsPerSecond"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=TotalTime}"
+                                                            Header="TotalTime"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=BestSolutionTime}"
+                                                            Header="BestSolutionTime"/>
+                                            <GridViewColumn DisplayMemberBinding="{Binding Path=BestSolution}"
+                                                            Header="BestSolution"/>
+                                        </GridView.Columns>
+                                    </GridView>
+                                </ListView.View>
+                            </ListView>
+                        </TabItem>
+                    </TabControl>
+                </TabItem>
+            </TabControl>
+
+            <Grid Grid.Column="1" Grid.Row="0" Margin="0,25,0,0">
                 <Grid.RowDefinitions>
+                    <RowDefinition Height="Auto" />
+                    <RowDefinition Height="Auto" />
                     <RowDefinition Height="Auto" />
                     <RowDefinition Height="Auto" />
@@ -84,25 +216,23 @@
                     <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
-                <TextBlock Grid.Row="0" Grid.Column="0">Evaluations:</TextBlock>
-                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Evaluations}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="1" Grid.Column="0">MaxEvaluations:</TextBlock>
-                <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding MaxEvaluations}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="2" Grid.Column="0">CurrentBestQuality:</TextBlock>
-                <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding CurrentBestQuality}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="3" Grid.Column="0">BestKnownQuality:</TextBlock>
-                <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding BestKnownQuality}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="4" Grid.Column="0">MaxLen:</TextBlock>
-                <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding MaxLen}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="5" Grid.Column="0">Evaluations/sec:</TextBlock>
-                <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding EvaluationsPerSec}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
-                <TextBlock Grid.Row="6" Grid.Column="0">BestSolutionFoundAt:</TextBlock>
-                <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding BestSolutionFoundAt}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="0" Grid.Column="0">Run:</TextBlock>
+                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding CurrentRunString}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="1" Grid.Column="0">Evaluations:</TextBlock>
+                <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Evaluations}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="2" Grid.Column="0">MaxEvaluations:</TextBlock>
+                <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding MaxEvaluations}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="3" Grid.Column="0">CurrentBestQuality:</TextBlock>
+                <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding CurrentBestQuality}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="4" Grid.Column="0">BestKnownQuality:</TextBlock>
+                <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding BestKnownQuality}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="5" Grid.Column="0">MaxLen:</TextBlock>
+                <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding MaxLen}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="6" Grid.Column="0">Evaluations/sec:</TextBlock>
+                <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding EvaluationsPerSec}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="7" Grid.Column="0">BestSolutionFoundAt:</TextBlock>
+                <TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding BestSolutionFoundAt}" Margin="5,0,0,0" HorizontalAlignment="Right"/>
+                <TextBlock Grid.Row="8" Grid.Column="0">BestSolution:</TextBlock>
+                <TextBlock Grid.Row="8" Grid.Column="1" Text="{Binding BestSolution}" Margin="5,0,0,0" HorizontalAlignment="Right" MaxWidth="100"/>
             </Grid>
-
-            <ComboBox Name="ComboBoxHorizontalAxis" Grid.Row="1" Grid.Column="1" Width="100" HorizontalAlignment="Center" VerticalAlignment="Center"></ComboBox>
-            <StackPanel Grid.Column="2" Grid.Row="1" Orientation="Horizontal">
-                <Button Margin="2">Load</Button>
-                <Button Margin="2">Save</Button>
-            </StackPanel>
         </Grid>
     </Grid>
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs	(revision 12503)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs	(revision 12762)
@@ -1,19 +1,5 @@
-﻿using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows.Threading;
+﻿using System.Collections.ObjectModel;
+using System.Threading;
+using System.Xml.Serialization;
 using Evaluation.ViewModel;
 using HeuristicLab.Algorithms.Bandits;
@@ -26,4 +12,14 @@
 using Microsoft.Research.DynamicDataDisplay;
 using Microsoft.Research.DynamicDataDisplay.DataSources;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.IO;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Threading;
+using Microsoft.Win32;
+using WpfTestSvgSample;
 
 namespace Evaluation
@@ -36,13 +32,21 @@
         private BackgroundWorker worker = new BackgroundWorker();
         private EvaluationViewModel vm;
-        private List<EvaluationStat> stats = new List<EvaluationStat>();
-
-        private Stack<EvaluationStat> newStats = new Stack<EvaluationStat>();
+
         private DispatcherTimer updateCollectionTimer;
 
+        private DrawingPage treeDrawingPage;
+
         public MainWindow()
         {
             InitializeComponent();
+            CenterWindowOnScreen();
             this.DataContext = vm = new EvaluationViewModel();
+            vm.MaxLen = 50;
+            vm.MaxEvaluations = 250000;
+            vm.NrRuns = 1;
+            vm.CurrentRunString = "0/1";
+            vm.Threads = 6;
+            vm.VerticalAxisString = "SolutionQuality";
+            vm.HorizontalAxisString = "Iteration";
             this.worker.WorkerSupportsCancellation = true;
             this.worker.DoWork += worker_DoWork;
@@ -54,8 +58,14 @@
             ////updateCollectionTimer.Tick += updateCollectionTimer_Tick;
             ////updateCollectionTimer.Start();
-
-            vm.HorizontalAxisString = "Evaluations";
-            vm.VerticalAxisString = "BestKnownQuality";
-
+        }
+
+        private void CenterWindowOnScreen()
+        {
+            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
+            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
+            double windowWidth = this.Width;
+            double windowHeight = this.Height;
+            this.Left = (screenWidth / 2) - (windowWidth / 2);
+            this.Top = (screenHeight / 2) - (windowHeight / 2);
         }
 
@@ -71,10 +81,16 @@
         void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
         {
-            if (stats.Count > 0)
-            {
-                TimeSpan timeNeeded = stats[stats.Count - 1].Time - stats[0].Time;
-                vm.EvaluationsPerSec = Math.Round(vm.Evaluations / timeNeeded.TotalSeconds, 2);
-            }
-            var ds = new EnumerableDataSource<EvaluationStat>(stats);
+            ButtonRun.IsEnabled = true;
+            TextBoxMaxEvaluations.IsEnabled = true;
+            TextBoxMaxLen.IsEnabled = true;
+            TextBoxRuns.IsEnabled = true;
+            TextBoxThreads.IsEnabled = true;
+        }
+
+        private void DrawCharts(Run run)
+        {
+            ClearChart();
+
+            var ds = new EnumerableDataSource<EvaluationStat>(run.EvaluationStats);
             ds.SetXMapping(x => x.Iteration);
             ds.SetYMapping(y => y.CurrentBestQuality);
@@ -85,7 +101,16 @@
             graph.AddToPlotter(ChartPlotter);
 
-            Debug.WriteLine("DONE");
-            ButtonRun.IsEnabled = true;
-        }
+            DrawTreeChart(run);
+        }
+
+        private void DrawTreeChart(Run run)
+        {
+            if (!string.IsNullOrEmpty(run.SvgFile))
+            {
+                treeDrawingPage.LoadDocument(run.SvgFile);
+            }
+        }
+
+
         void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
         {
@@ -95,4 +120,5 @@
         void worker_DoWork(object sender, DoWorkEventArgs e)
         {
+
             Type algorithmType = vm.SelectedAlgorithm;
 
@@ -108,5 +134,5 @@
                 policyInstance = new UCTPolicy();
             }
-            else if (policy == typeof (ThresholdAscentPolicy))
+            else if (policy == typeof(ThresholdAscentPolicy))
             {
                 policyInstance = new ThresholdAscentPolicy();
@@ -117,56 +143,103 @@
             }
 
-            vm.MaxLen = 1000;
-            vm.MaxEvaluations = 250000;
-
             vm.BestKnownQuality = problem.BestKnownQuality(vm.MaxLen);
 
-            vm.Evaluations = 0;
-            vm.CurrentBestQuality = 0;
-
-            stats.Clear();
-
-            SolverBase solver = null;
-
-            if (algorithmType == typeof(MonteCarloTreeSearch))
-            {
-                solver = new MonteCarloTreeSearch(problem, vm.MaxLen, random, policyInstance, new RandomSimulation(problem, random, vm.MaxLen));
-            }
-            else if (algorithmType == typeof(SequentialSearch))
-            {
-                solver = new SequentialSearch(problem, vm.MaxLen, random, 0,
-                    new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, policyInstance));
-            }
-            else if (algorithmType == typeof(RandomSearch))
-            {
-                solver = new RandomSearch(problem, random, vm.MaxLen);
-            }
-            else if (algorithmType == typeof(StandardGP))
-            {
-                solver = new StandardGP(problem, random);
-            }
-            else if (algorithmType == typeof(OffspringSelectionGP))
-            {
-                solver = new OffspringSelectionGP(problem, random);
-            }
-
-            solver.FoundNewBestSolution += (sentence, quality) => vm.BestSolutionFoundAt = vm.Evaluations;
-            solver.SolutionEvaluated += (sentence, quality) =>
-            {
-                vm.Evaluations++;
-                if (vm.CurrentBestQuality < quality)
-                {
-                    vm.CurrentBestQuality = quality;
-                }
-                stats.Add(new EvaluationStat(DateTime.Now, vm.Evaluations, quality, vm.CurrentBestQuality));
-            };
-
-            solver.Run(vm.MaxEvaluations);
+            for (int i = 0; i < vm.NrRuns; i++)
+            {
+                vm.CurrentRunString = string.Format("{0}/{1}", i + 1, vm.NrRuns);
+                vm.Evaluations = 0;
+                vm.CurrentBestQuality = 0;
+
+                List<EvaluationStat> stats = new List<EvaluationStat>();
+
+                ISolver solver = null;
+
+                if (algorithmType == typeof(MonteCarloTreeSearch))
+                {
+                    solver = new MonteCarloTreeSearch(problem, vm.MaxLen, random, policyInstance, new RandomSimulation(problem, random, vm.MaxLen));
+                }
+                else if (algorithmType == typeof(SequentialSearch))
+                {
+                    solver = new SequentialSearch(problem, vm.MaxLen, random, 0,
+                        new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, policyInstance));
+                }
+                else if (algorithmType == typeof(RandomSearch))
+                {
+                    solver = new RandomSearch(problem, random, vm.MaxLen);
+                }
+                else if (algorithmType == typeof(StandardGP))
+                {
+                    solver = new StandardGP(problem, random);
+                }
+                else if (algorithmType == typeof(OffspringSelectionGP))
+                {
+                    solver = new OffspringSelectionGP(problem, random);
+                }
+
+                solver.FoundNewBestSolution += (sentence, quality) =>
+                {
+                    vm.BestSolutionFoundAt = vm.Evaluations;
+                    vm.BestSolution = sentence;
+                };
+                solver.SolutionEvaluated += (sentence, quality) =>
+                {
+                    vm.Evaluations++;
+                    if (vm.CurrentBestQuality < quality)
+                    {
+                        vm.CurrentBestQuality = quality;
+                    }
+                    stats.Add(new EvaluationStat(DateTime.Now, vm.Evaluations, quality, vm.CurrentBestQuality));
+                };
+
+                solver.Run(vm.MaxEvaluations);
+
+
+                if (stats.Count > 0)
+                {
+                    TimeSpan totalTimeNeeded = stats[stats.Count - 1].Time - stats[0].Time;
+                    vm.EvaluationsPerSec = Math.Round(vm.Evaluations / totalTimeNeeded.TotalSeconds, 2);
+
+                    TimeSpan timeForBestSolution = stats[vm.BestSolutionFoundAt - 1].Time - stats[0].Time;
+
+                    Run run = new Run(i, vm.Evaluations, vm.CurrentBestQuality, vm.BestKnownQuality,
+                        vm.BestSolutionFoundAt, vm.BestSolution, vm.EvaluationsPerSec,
+                        totalTimeNeeded, timeForBestSolution, stats);
+
+
+                    MonteCarloTreeSearch mctsSolver = null;
+                    if (algorithmType == typeof(MonteCarloTreeSearch))
+                    {
+                        mctsSolver = (MonteCarloTreeSearch)solver;
+
+                        run.TreeInfos = mctsSolver.GetTreeInfos();
+
+                        byte[] output = mctsSolver.GenerateSvg();
+                        if (output.Length > 0)
+                        {
+                            run.SvgFile = string.Format("MCTS_SVG_#{0}_{1}.svg", i, DateTime.Now.Ticks);
+                            File.WriteAllBytes(run.SvgFile, mctsSolver.GenerateSvg());
+                        }
+                    }
+
+                    Dispatcher.BeginInvoke(new Action(() => vm.Runs.Add(run)));
+                }
+            }
+        }
+
+        private void ClearChart()
+        {
+            ChartPlotter.Children.RemoveAll<LineGraph>();
         }
 
         private void ButtonRun_OnClick(object sender, RoutedEventArgs e)
         {
-            ChartPlotter.Children.RemoveAll<LineGraph>();
+            ClearChart();
+            vm.Runs.Clear();
+            vm.CurrentRun = null;
             ButtonRun.IsEnabled = false;
+            TextBoxMaxEvaluations.IsEnabled = false;
+            TextBoxMaxLen.IsEnabled = false;
+            TextBoxRuns.IsEnabled = false;
+            TextBoxThreads.IsEnabled = false;
             worker.RunWorkerAsync();
         }
@@ -174,4 +247,17 @@
         private void ButtonPause_OnClick(object sender, RoutedEventArgs e)
         {
+            //if (vm.SelectedAlgorithm == typeof(MonteCarloTreeSearch))
+            //{
+            //    MonteCarloTreeSearch mcts = (MonteCarloTreeSearch)solver;
+            //    mcts.PauseContinue();
+            //    if (mcts.IsPaused)
+            //    {
+            //        ButtonPause.Content = "Continue";
+            //    }
+            //    else
+            //    {
+            //        ButtonPause.Content = "Pause";
+            //    }
+            //}
         }
 
@@ -183,13 +269,108 @@
         private void ComboBoxAlgorithms_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            if (vm.SelectedAlgorithm == typeof(MonteCarloTreeSearch)
-                || vm.SelectedAlgorithm == typeof(SequentialSearch))
+            if (vm.SelectedAlgorithm == typeof(MonteCarloTreeSearch))
             {
                 ComboBoxPolicies.IsEnabled = true;
+                TabItemTree.IsEnabled = true;
+            }
+            else if (vm.SelectedAlgorithm == typeof(SequentialSearch))
+            {
+                ComboBoxPolicies.IsEnabled = true;
+                TabItemTree.IsEnabled = false;
             }
             else
             {
                 ComboBoxPolicies.IsEnabled = false;
-            }
+                TabItemTree.IsEnabled = false;
+            }
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            treeDrawingPage = treeDrawing.Content as DrawingPage;
+        }
+
+        private void ListBoxRuns_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (ListBoxRuns.SelectedItem != null)
+            {
+                vm.CurrentRun = (Run)ListBoxRuns.SelectedItem;
+                DrawCharts(vm.CurrentRun);
+            }
+        }
+
+        public void SaveToFile()
+        {
+            SaveFileDialog dlg = new SaveFileDialog();
+            dlg.FileName = "runs"; // Default file name
+            dlg.DefaultExt = ".xml"; // Default file extension
+
+            // Show save file dialog box
+            Nullable<bool> result = dlg.ShowDialog();
+
+            // Process save file dialog box results
+            if (result == true)
+            {
+                // Save document
+                string filename = dlg.FileName;
+
+                XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<Run>));
+                using (TextWriter writer = new StreamWriter(filename))
+                {
+                    serializer.Serialize(writer, vm.Runs);
+                }
+            }
+
+        }
+
+        public void LoadFromFile()
+        {
+            OpenFileDialog dlg = new OpenFileDialog();
+
+            // Show save file dialog box
+            Nullable<bool> result = dlg.ShowDialog();
+
+            // Process save file dialog box results
+            if (result == true)
+            {
+                // Load document
+                string filename = dlg.FileName;
+
+                XmlSerializer deserializer = new XmlSerializer(typeof(ObservableCollection<Run>));
+                using (TextReader reader = new StreamReader(filename))
+                {
+                    object obj = deserializer.Deserialize(reader);
+                    vm.Runs = (ObservableCollection<Run>)obj;
+
+                }
+            }
+        }
+
+        private void LoadButton_OnClick(object sender, RoutedEventArgs e)
+        {
+           LoadFromFile();
+        }
+
+        private void SaveButton_OnClick(object sender, RoutedEventArgs e)
+        {
+            SaveToFile();
+        }
+
+        private void TabControlRunComparison_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            ////if (TabControlRunComparison.SelectedItem == TabItemChartRunComparison)
+            ////{
+            ////    ComparisonChartPlotter.Children.RemoveAll<LineGraph>();
+
+            ////    var ds = new EnumerableDataSource<EvaluationStat>(run.EvaluationStats);
+            ////    ds.SetXMapping(x => x.Iteration);
+            ////    ds.SetYMapping(y => y.CurrentBestQuality);
+
+            ////    LineGraph graph = new LineGraph(ds);
+
+            ////    graph.StrokeThickness = 2;
+            ////    graph.AddToPlotter(ChartPlotter);
+
+            ////}
         }
     }
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs	(revision 12762)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs	(revision 12762)
@@ -0,0 +1,54 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Algorithms.MonteCarloTreeSearch.Base;
+
+namespace Evaluation
+{
+    public class Run
+    {
+        public Run()
+        {
+
+        }
+
+        public Run(int runNumber, int evaluations, double bestSolutionQuality, double bestKnownQuality,
+            int bestSolutionFoundAt, string bestSolution,
+            double evaluationsPerSecond, TimeSpan totalTime, TimeSpan bestSolutionTime,
+            List<EvaluationStat> evaluationStats)
+        {
+            RunNumber = runNumber;
+            Evaluations = evaluations;
+            BestSolutionQuality = bestSolutionQuality;
+            BestKnownQuality = bestKnownQuality;
+            BestSolutionFoundAt = bestSolutionFoundAt;
+            BestSolution = bestSolution;
+            EvaluationsPerSecond = evaluationsPerSecond;
+            TotalTime = totalTime;
+            BestSolutionTime = bestSolutionTime;
+            EvaluationStats = evaluationStats;
+        }
+
+        public int RunNumber { get; set; }
+        public int Evaluations { get; set; }
+        public double BestSolutionQuality { get; set; }
+
+        public string BestSolution { get; set; }
+
+        public double BestKnownQuality { get; set; }
+        public int BestSolutionFoundAt { get; set; }
+
+        public double EvaluationsPerSecond { get; set; }
+        public TimeSpan TotalTime { get; set; }
+        public TimeSpan BestSolutionTime { get; set; }
+        public List<EvaluationStat> EvaluationStats { get; set; }
+
+        public string SvgFile { get; set; }
+
+        public TreeInfos TreeInfos { get; set; }
+
+        public override string ToString()
+        {
+            return string.Format("Run #{0}", this.RunNumber);
+        }
+    }
+}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationStat.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationStat.cs	(revision 12503)
+++ 	(revision )
@@ -1,23 +1,0 @@
-﻿using System;
-
-namespace Evaluation.ViewModel
-{
-    public class EvaluationStat
-    {
-        public DateTime Time { get; set; }
-
-        public long Iteration { get; set; }
-
-        public double Quality { get; set; }
-
-        public double CurrentBestQuality { get; set; }
-
-        public EvaluationStat(DateTime time, long iteration, double quality, double currentBestQuality)
-        {
-            Time = time;
-            Iteration = iteration;
-            Quality = quality;
-            CurrentBestQuality = currentBestQuality;
-        }
-    }
-}
Index: branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationViewModel.cs
===================================================================
--- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationViewModel.cs	(revision 12503)
+++ branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationViewModel.cs	(revision 12762)
@@ -1,3 +1,4 @@
-﻿using HeuristicLab.Algorithms.Bandits.BanditPolicies;
+﻿using System.Collections.ObjectModel;
+using HeuristicLab.Algorithms.Bandits.BanditPolicies;
 using HeuristicLab.Algorithms.GeneticProgramming;
 using HeuristicLab.Algorithms.GrammaticalOptimization;
@@ -108,7 +109,7 @@
         }
 
-        private long evaluations;
-
-        public long Evaluations
+        private int evaluations;
+
+        public int Evaluations
         {
             get { return this.evaluations; }
@@ -120,4 +121,20 @@
         }
 
+        private int nrRuns;
+
+        public int NrRuns
+        {
+            get { return this.nrRuns; }
+            set { this.nrRuns = value; this.OnPropertyChanged("NrRuns"); }
+        }
+
+        private int threads;
+
+        public int Threads
+        {
+            get { return this.threads; }
+            set { this.threads = value; this.OnPropertyChanged("Threads"); }
+        }
+
         private int maxLen;
 
@@ -176,4 +193,16 @@
         }
 
+        private string currentRunString;
+
+        public string CurrentRunString
+        {
+            get { return this.currentRunString; }
+            set
+            {
+                currentRunString = value;
+                this.OnPropertyChanged("CurrentRunString");
+            }
+        }
+
         private double evaluationsPerSec;
 
@@ -188,7 +217,7 @@
         }
 
-        private long bestSolutionFoundAt;
-
-        public long BestSolutionFoundAt
+        private int bestSolutionFoundAt;
+
+        public int BestSolutionFoundAt
         {
             get { return this.bestSolutionFoundAt; }
@@ -197,4 +226,47 @@
                 bestSolutionFoundAt = value;
                 this.OnPropertyChanged("BestSolutionFoundAt");
+            }
+        }
+
+        private string bestSolution;
+
+        public string BestSolution
+        {
+            get { return this.bestSolution; }
+            set
+            {
+                bestSolution = value;
+                this.OnPropertyChanged("BestSolution");
+            }
+        }
+
+        private ObservableCollection<Run> runs = new ObservableCollection<Run>();
+
+        public ObservableCollection<Run> Runs
+        {
+            get { return this.runs; }
+            set
+            {
+                runs = value;
+                this.OnPropertyChanged("Runs");
+            }
+        }
+
+        private Run currentRun;
+
+        public Run CurrentRun
+        {
+            get { return this.currentRun; }
+            set
+            {
+                currentRun = value;
+                if (currentRun != null)
+                {
+                    Evaluations = currentRun.Evaluations;
+                    BestKnownQuality = currentRun.BestKnownQuality;
+                    CurrentBestQuality = currentRun.BestSolutionQuality;
+                    EvaluationsPerSec = currentRun.EvaluationsPerSecond;
+                }
+                this.OnPropertyChanged("CurrentRun");
             }
         }
