Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13722


Ignore:
Timestamp:
03/23/16 22:51:27 (9 years ago)
Author:
abeham
Message:

#2457:

  • Renamed remaining files from ExpertSystem to KnowledgeCenter
  • Added ability to scatter plot to display a regression line
  • Allowed to execute multiple instances at once and displaying either only final result or tracking result
  • Split runs in seeded runs and instance runs
Location:
branches/PerformanceComparison
Files:
5 added
11 edited
23 moved

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj

    r12764 r13722  
    105105  </PropertyGroup>
    106106  <ItemGroup>
     107    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     108      <SpecificVersion>False</SpecificVersion>
     109      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath>
     110      <Private>False</Private>
     111    </Reference>
    107112    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    108113      <SpecificVersion>False</SpecificVersion>
     
    309314    <EmbeddedResource Include="HeatMapView.resx">
    310315      <DependentUpon>HeatMapView.cs</DependentUpon>
     316    </EmbeddedResource>
     317    <EmbeddedResource Include="ScatterPlotDataRowVisualPropertiesControl.resx">
     318      <DependentUpon>ScatterPlotDataRowVisualPropertiesControl.cs</DependentUpon>
    311319    </EmbeddedResource>
    312320  </ItemGroup>
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame

    r13475 r13722  
    2828  [Plugin("HeuristicLab.Analysis.Views", "3.3.13.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
    3031  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3132  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.Designer.cs

    r12012 r13722  
    5656      this.label9 = new System.Windows.Forms.Label();
    5757      this.label7 = new System.Windows.Forms.Label();
     58      this.label4 = new System.Windows.Forms.Label();
     59      this.regressionLineCheckBox = new System.Windows.Forms.CheckBox();
    5860      ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit();
    5961      this.SuspendLayout();
     
    171173      this.label7.Text = "&Visible in Legend:";
    172174      //
     175      // label4
     176      //
     177      this.label4.AutoSize = true;
     178      this.label4.Location = new System.Drawing.Point(3, 136);
     179      this.label4.Name = "label4";
     180      this.label4.Size = new System.Drawing.Size(86, 13);
     181      this.label4.TabIndex = 2;
     182      this.label4.Text = "&Regression Line:";
     183      //
     184      // regressionLineCheckBox
     185      //
     186      this.regressionLineCheckBox.AutoSize = true;
     187      this.regressionLineCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
     188      this.regressionLineCheckBox.Location = new System.Drawing.Point(99, 136);
     189      this.regressionLineCheckBox.Name = "regressionLineCheckBox";
     190      this.regressionLineCheckBox.Size = new System.Drawing.Size(15, 14);
     191      this.regressionLineCheckBox.TabIndex = 3;
     192      this.regressionLineCheckBox.UseVisualStyleBackColor = true;
     193      this.regressionLineCheckBox.CheckedChanged += new System.EventHandler(this.regressionLineCheckBox_CheckedChanged);
     194      //
    173195      // ScatterPlotDataRowVisualPropertiesControl
    174196      //
    175197      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    176198      this.Controls.Add(this.pointSizeNumericUpDown);
     199      this.Controls.Add(this.regressionLineCheckBox);
    177200      this.Controls.Add(this.isVisibleInLegendCheckBox);
    178201      this.Controls.Add(this.label9);
    179202      this.Controls.Add(this.label3);
     203      this.Controls.Add(this.label4);
    180204      this.Controls.Add(this.pointStyleComboBox);
    181205      this.Controls.Add(this.label7);
     
    185209      this.Controls.Add(this.colorButton);
    186210      this.Name = "ScatterPlotDataRowVisualPropertiesControl";
    187       this.Size = new System.Drawing.Size(342, 135);
     211      this.Size = new System.Drawing.Size(342, 157);
    188212      ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).EndInit();
    189213      this.ResumeLayout(false);
     
    205229    private System.Windows.Forms.Label label9;
    206230    private System.Windows.Forms.Label label3;
     231    private System.Windows.Forms.Label label4;
     232    private System.Windows.Forms.CheckBox regressionLineCheckBox;
    207233  }
    208234}
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.cs

    r12012 r13722  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2020#endregion
    2121
     22using HeuristicLab.MainForm;
    2223using System;
    2324using System.Drawing;
    2425using System.Windows.Forms;
    25 using HeuristicLab.MainForm;
    26 using HeuristicLab.MainForm.WindowsForms;
    2726
    2827namespace HeuristicLab.Analysis.Views {
     
    5756          pointSizeNumericUpDown.Value = 1;
    5857          displayNameTextBox.Text = String.Empty;
     58          regressionLineCheckBox.Checked = false;
    5959        } else {
    6060          displayNameTextBox.Text = Content.DisplayName;
     
    6969          pointSizeNumericUpDown.Value = Content.PointSize;
    7070          isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend;
     71          regressionLineCheckBox.Checked = Content.ShowRegressionLine;
    7172        }
    7273      }
     
    8283      pointSizeNumericUpDown.Enabled = Content != null;
    8384      displayNameTextBox.Enabled = Content != null;
     85      regressionLineCheckBox.Enabled = Content != null;
    8486    }
    8587
     
    121123      }
    122124    }
     125
     126    private void regressionLineCheckBox_CheckedChanged(object sender, EventArgs e) {
     127      if (!SuppressEvents && Content != null) {
     128        Content.ShowRegressionLine = regressionLineCheckBox.Checked;
     129      }
     130    }
    123131    #endregion
    124132  }
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/ScatterPlotView.cs

    r12679 r13722  
    2020#endregion
    2121
     22using HeuristicLab.Collections;
     23using HeuristicLab.Common;
     24using HeuristicLab.Core.Views;
     25using HeuristicLab.MainForm;
    2226using System;
    2327using System.Collections.Generic;
     
    2630using System.Windows.Forms;
    2731using System.Windows.Forms.DataVisualization.Charting;
    28 using HeuristicLab.Collections;
    29 using HeuristicLab.Common;
    30 using HeuristicLab.Core.Views;
    31 using HeuristicLab.MainForm;
    3232
    3333namespace HeuristicLab.Analysis.Views {
     
    141141        DeregisterScatterPlotDataRowEvents(row);
    142142        Series series = chart.Series[row.Name];
     143        if (chart.Series.IsUniqueName(series.Name + ".lr"))
     144          chart.Series.Remove(chart.Series[series.Name + ".lr"]);
    143145        chart.Series.Remove(series);
    144146        if (invisibleSeries.Contains(series))
     
    460462
    461463    private void FillSeriesWithRowValues(Series series, ScatterPlotDataRow row) {
     464      if (row.VisualProperties.ShowRegressionLine) {
     465        var xs = row.Points.Select(p => p.X).ToArray();
     466        var xsMin = xs.Min();
     467        var xsMax = xs.Max();
     468        var ys = row.Points.Select(p => p.Y).ToArray();
     469        var corr = alglib.pearsoncorr2(xs, ys);
     470        var slope = corr * ys.StandardDeviation() / xs.StandardDeviation();
     471        if (!double.IsNaN(slope) && !double.IsInfinity(slope)) {
     472          var off = ys.Average() - slope * xs.Average();
     473
     474          Series lrSeries;
     475          if (chart.Series.IsUniqueName(series.Name + ".lr")) {
     476            lrSeries = new Series(series.Name + ".lr") {IsVisibleInLegend = false, ChartType = SeriesChartType.FastLine};
     477            chart.Series.Add(lrSeries);
     478          } else lrSeries = chart.Series[series.Name + ".lr"];
     479          lrSeries.Points.Clear();
     480          lrSeries.Points.AddXY(xsMin, slope * xsMin + off);
     481          lrSeries.Points.AddXY(xsMax, slope * xsMax + off);
     482        }
     483      } else if (!chart.Series.IsUniqueName(series.Name + ".lr"))
     484        chart.Series.Remove(chart.Series[series.Name + ".lr"]);
     485
    462486      for (int i = 0; i < row.Points.Count; i++) {
    463487        var value = row.Points[i];
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/DataVisualization/ScatterPlotDataRowVisualProperties.cs

    r12012 r13722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
     23using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2224using System;
    2325using System.ComponentModel;
    2426using System.Drawing;
    25 using HeuristicLab.Common;
    26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    2828namespace HeuristicLab.Analysis {
     
    101101      }
    102102    }
     103    private bool showRegressionLine;
     104    public bool ShowRegressionLine {
     105      get { return showRegressionLine; }
     106      set {
     107        if (showRegressionLine == value) return;
     108        showRegressionLine = value;
     109        OnPropertyChanged("ShowRegressionLine");
     110      }
     111    }
    103112
    104113    #region Persistence Properties
     
    128137      set { displayName = value; }
    129138    }
     139    [Storable(Name = "ShowRegressionLine")]
     140    private bool StorableShowRegressionLine {
     141      get { return showRegressionLine; }
     142      set { showRegressionLine = value; }
     143    }
    130144    #endregion
    131145
     
    139153      this.displayName = original.displayName;
    140154      this.isVisibleInLegend = original.isVisibleInLegend;
     155      this.showRegressionLine = original.showRegressionLine;
    141156    }
    142157    public ScatterPlotDataRowVisualProperties() {
     
    146161      displayName = String.Empty;
    147162      isVisibleInLegend = true;
     163      showRegressionLine = false;
    148164    }
    149165    public ScatterPlotDataRowVisualProperties(string displayName)
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj

    r13713 r13722  
    143143  </ItemGroup>
    144144  <ItemGroup>
    145     <Compile Include="ExpertSystem.cs" />
     145    <Compile Include="KnowledgeCenter.cs" />
    146146    <Compile Include="Plugin.cs" />
    147147    <Compile Include="SeedingStrategyTypes.cs" />
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs

    r13721 r13722  
    2828using HeuristicLab.MainForm;
    2929using HeuristicLab.Optimization;
    30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3130using HeuristicLab.Persistence.Default.Xml;
    3231using System;
    3332using System.Collections.Generic;
    34 using System.ComponentModel;
    3533using System.Drawing;
    3634using System.IO;
     
    4341
    4442namespace HeuristicLab.OptimizationExpertSystem.Common {
    45   [Item("Expert-System", "Currently in experimental phase, an expert system that makes algorithm suggestions based on fitness landscape analysis features and an optimization knowledge base.")]
     43  [Item("Knowledge Center", "Currently in experimental phase, an expert system that makes algorithm suggestions based on fitness landscape analysis features and an optimization knowledge base.")]
    4644  [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 119)]
    47   public sealed class ExpertSystem : NamedItem, IStorableContent, INotifyPropertyChanged {
     45  public sealed class KnowledgeCenter : IContent {
    4846
    4947    public string Filename { get; set; }
     
    5351    }
    5452
    55     [Storable]
    56     private int maximumEvaluations;
    57     public int MaximumEvaluations {
     53    private IntValue maximumEvaluations;
     54    public IntValue MaximumEvaluations {
    5855      get { return maximumEvaluations; }
    59       set {
    60         if (maximumEvaluations == value) return;
    61         maximumEvaluations = value;
    62         OnPropertyChanged("MaximumEvaluations");
    63         UpdateSuggestions();
    64       }
    65     }
    66 
    67     [Storable]
    68     private RunCollection runs;
    69     public RunCollection Runs {
    70       get { return runs; }
    71     }
    72 
    73     [Storable]
     56    }
     57
     58    private RunCollection instanceRuns;
     59    public RunCollection InstanceRuns {
     60      get { return instanceRuns; }
     61    }
     62
     63    private RunCollection seededRuns;
     64    public RunCollection SeededRuns {
     65      get { return seededRuns; }
     66    }
     67
    7468    private RunCollection knowledgeBase;
    7569    public RunCollection KnowledgeBase {
    7670      get { return knowledgeBase; }
    77       set {
    78         if (knowledgeBase == value) return;
    79         knowledgeBase = value;
    80         OnPropertyChanged("KnowledgeBase");
    81       }
    82     }
    83 
    84     [Storable]
     71    }
     72
    8573    private SingleObjectiveOKBProblem problem;
    8674    public SingleObjectiveOKBProblem Problem {
    8775      get { return problem; }
    88       set {
    89         if (problem == value) return;
    90         problem = value;
    91         OnPropertyChanged("Problem");
    92         UpdateSuggestions();
    93       }
    94     }
    95 
    96     [Storable]
     76    }
     77
    9778    private ItemList<IAlgorithm> suggestedInstances;
    9879    private ReadOnlyItemList<IAlgorithm> readOnlySuggestedInstances;
     
    10182    }
    10283
    103     [Storable]
    10484    private RunCollection problemInstances;
    10585    public RunCollection ProblemInstances {
    10686      get { return problemInstances; }
    107       set {
    108         if (problemInstances == value) return;
    109         problemInstances = value;
    110         OnPropertyChanged("ProblemInstances");
    111       }
    112     }
    113 
    114     [Storable]
    115     private ResultCollection currentResult;
    116     public ResultCollection CurrentResult {
    117       get { return currentResult; }
    118       set {
    119         if (currentResult == value) return;
    120         currentResult = value;
    121         OnPropertyChanged("CurrentResult");
    122       }
    123     }
    124 
    125     [Storable]
     87    }
     88
    12689    private CheckedItemList<IScope> solutionSeedingPool;
    12790    public CheckedItemList<IScope> SolutionSeedingPool {
    12891      get { return solutionSeedingPool; }
    129       set { solutionSeedingPool = value; }
    130     }
    131 
    132     [Storable]
     92    }
     93
    13394    private EnumValue<SeedingStrategyTypes> seedingStrategy;
    13495    public EnumValue<SeedingStrategyTypes> SeedingStrategy {
    13596      get { return seedingStrategy; }
    136       set { seedingStrategy = value; }
    13797    }
    13898   
    139     [Storable]
    14099    private BidirectionalLookup<long, IRun> algorithmId2RunMapping;
    141     [Storable]
    142100    private BidirectionalDictionary<long, IAlgorithm> algorithmId2AlgorithmInstanceMapping;
    143101
    144     [Storable]
    145102    private Run currentInstance;
    146103
    147104    private bool Maximization {
    148       get {
    149         return Problem != null && Problem.ProblemId >= 0 && ((IValueParameter<BoolValue>)Problem.MaximizationParameter).Value.Value;
    150       }
    151     }
    152 
    153     [StorableConstructor]
    154     private ExpertSystem(bool deserializing) : base(deserializing) { }
    155     private ExpertSystem(ExpertSystem original, Cloner cloner)
    156       : base(original, cloner) {
    157       runs = cloner.Clone(original.runs);
    158       knowledgeBase = cloner.Clone(original.knowledgeBase);
    159       suggestedInstances = cloner.Clone(original.suggestedInstances);
    160       readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
    161       problemInstances = cloner.Clone(original.problemInstances);
    162       problem = cloner.Clone(original.problem);
    163       algorithmId2RunMapping = new BidirectionalLookup<long, IRun>();
    164       foreach (var kvp in original.algorithmId2RunMapping.FirstEnumerable) {
    165         algorithmId2RunMapping.AddRangeFirst(kvp.Key, kvp.Select(cloner.Clone));
    166       }
    167       algorithmId2AlgorithmInstanceMapping = new BidirectionalDictionary<long, IAlgorithm>();
    168       foreach (var kvp in original.algorithmId2AlgorithmInstanceMapping) {
    169         algorithmId2AlgorithmInstanceMapping.Add(kvp.Key, cloner.Clone(kvp.Value));
    170       }
    171       currentResult = cloner.Clone(original.currentResult);
    172       solutionSeedingPool = cloner.Clone(original.solutionSeedingPool);
    173       seedingStrategy = cloner.Clone(original.seedingStrategy);
    174       currentInstance = cloner.Clone(original.currentInstance);
    175       RegisterEventHandlers();
    176     }
    177     public ExpertSystem() {
    178       Name = ItemName;
    179       Description = ItemDescription;
    180       runs = new RunCollection();
     105      get { return Problem != null && Problem.ProblemId >= 0 && ((IValueParameter<BoolValue>)Problem.MaximizationParameter).Value.Value; }
     106    }
     107
     108    public KnowledgeCenter() {
     109      maximumEvaluations = new IntValue(0);
     110      instanceRuns = new RunCollection();
    181111      knowledgeBase = new RunCollection();
    182112      suggestedInstances = new ItemList<IAlgorithm>();
     
    195125    }
    196126
    197     public override IDeepCloneable Clone(Cloner cloner) {
    198       return new ExpertSystem(this, cloner);
    199     }
    200 
    201     [StorableHook(HookType.AfterDeserialization)]
    202     private void AfterDeserialization() {
    203       readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
    204       RegisterEventHandlers();
    205     }
    206 
    207127    private void RegisterEventHandlers() {
     128      maximumEvaluations.ValueChanged += MaximumEvaluationsOnValueChanged;
    208129      problem.ProblemChanged += ProblemOnProblemChanged;
    209130      problem.Solutions.ItemsAdded += ProblemSolutionsChanged;
     
    211132      problem.Solutions.ItemsRemoved += ProblemSolutionsChanged;
    212133      problem.Solutions.CollectionReset += ProblemSolutionsChanged;
    213       runs.CollectionReset += InformationChanged;
    214       runs.ItemsAdded += InformationChanged;
    215       runs.ItemsRemoved += InformationChanged;
    216       runs.Reset += InformationChanged;
    217       runs.UpdateOfRunsInProgressChanged += InformationChanged;
     134      instanceRuns.CollectionReset += InformationChanged;
     135      instanceRuns.ItemsAdded += InformationChanged;
     136      instanceRuns.ItemsRemoved += InformationChanged;
     137      instanceRuns.Reset += InformationChanged;
     138      instanceRuns.UpdateOfRunsInProgressChanged += InformationChanged;
    218139      knowledgeBase.CollectionReset += InformationChanged;
    219140      knowledgeBase.ItemsAdded += InformationChanged;
    220141      knowledgeBase.ItemsRemoved += InformationChanged;
     142    }
     143
     144    private void MaximumEvaluationsOnValueChanged(object sender, EventArgs eventArgs) {
     145      UpdateSuggestions();
    221146    }
    222147
     
    372297    };
    373298
    374     public Task StartAlgorithmAsync(int index) {
     299    public Task<ResultCollection> StartAlgorithmAsync(int index) {
     300      return StartAlgorithmAsync(index, CancellationToken.None);
     301    }
     302
     303    public Task<ResultCollection> StartAlgorithmAsync(int index, CancellationToken cancellation) {
    375304      var selectedInstance = suggestedInstances[index];
    376305      var algorithmClone = (IAlgorithm)selectedInstance.Clone();
     
    378307      if (problemClone == null) throw new InvalidOperationException("Problem is not of type " + typeof(ISingleObjectiveHeuristicOptimizationProblem).FullName);
    379308      // TODO: It is assumed the problem instance by default is configured using no preexisting solution creator
    380       if (SeedingStrategy.Value != SeedingStrategyTypes.NoSeeding) {
     309      var seedingStrategyLocal = SeedingStrategy.Value;
     310      if (seedingStrategyLocal != SeedingStrategyTypes.NoSeeding) {
    381311        if (!SolutionSeedingPool.CheckedItems.Any()) throw new InvalidOperationException("There are no solutions selected for seeding.");
    382312        // TODO: It would be necessary to specify the solution creator somewhere (property and GUI)
     
    384314        if (seedingCreator == null) throw new InvalidOperationException("The problem does not contain a solution creator that allows seeding.");
    385315        seedingCreator.PreexistingSolutionsParameter.Value.Replace(SolutionSeedingPool.CheckedItems.Select(x => x.Value));
    386         seedingCreator.SampleFromPreexistingParameter.Value.Value = SeedingStrategy.Value == SeedingStrategyTypes.SeedBySampling;
     316        seedingCreator.SampleFromPreexistingParameter.Value.Value = seedingStrategyLocal == SeedingStrategyTypes.SeedBySampling;
    387317        // TODO: WHY!? WHY??!?
    388318        ((dynamic)problemClone.SolutionCreatorParameter).Value = (dynamic)seedingCreator;
     
    395325        var maxEvalParam = stopParam as IValueParameter<Data.IntValue>;
    396326        if (maxEvalParam != null) {
    397           maxEvalParam.Value.Value = MaximumEvaluations;
     327          maxEvalParam.Value.Value = MaximumEvaluations.Value;
    398328          monitorStop = false;
    399329        }
     
    406336      #region EventHandler closures
    407337      EventHandler exeStateChanged = (sender, e) => {
    408         if (algorithmClone.ExecutionState == ExecutionState.Started) {
    409           CurrentResult = algorithmClone.Results;
    410         } else if (algorithmClone.ExecutionState == ExecutionState.Stopped) {
     338        if (algorithmClone.ExecutionState == ExecutionState.Stopped) {
    411339          foreach (var solution in algorithmClone.Results.Where(x => x.Name.ToLower().Contains("solution")).Select(x => x.Value).OfType<IScope>()) {
    412340            Problem.Solutions.Add(new SingleObjectiveOKBSolution(Problem.ProblemId) {
     
    415343            });
    416344          }
    417           Runs.Add(algorithmClone.Runs.Last());
     345          if (seedingStrategyLocal == SeedingStrategyTypes.NoSeeding) {
     346            InstanceRuns.Add(algorithmClone.Runs.Last());
     347          } else SeededRuns.Add(algorithmClone.Runs.Last());
    418348          waitHandle.Set();
    419349        }
     
    428358        if (!algorithmClone.Results.TryGetValue("EvaluatedSolutions", out evalSolResult) || !(evalSolResult.Value is Data.IntValue)) return;
    429359        var evalSols = ((Data.IntValue)evalSolResult.Value).Value;
    430         if (evalSols >= MaximumEvaluations && algorithmClone.ExecutionState == ExecutionState.Started)
     360        if (evalSols >= MaximumEvaluations.Value && algorithmClone.ExecutionState == ExecutionState.Started)
    431361          algorithmClone.Stop();
    432362      };
     
    439369      return Task.Factory.StartNew(() => {
    440370        algorithmClone.Start();
    441         waitHandle.WaitOne();
     371        OnAlgorithmInstanceStarted(algorithmClone);
     372        var cancelRequested = false;
     373        while (!waitHandle.WaitOne(200)) {
     374          if (cancellation.IsCancellationRequested) {
     375            cancelRequested = true;
     376            break;
     377          }
     378        }
     379        if (cancelRequested) {
     380          try { algorithmClone.Stop(); } catch { } // ignore race condition if it is stopped in the meantime
     381          waitHandle.WaitOne();
     382        }
    442383        waitHandle.Dispose();
    443       });
    444     }
    445 
    446     public void StartAlgorithm(int index) {
    447       StartAlgorithmAsync(index).Wait();
     384        return algorithmClone.Results;
     385      }, TaskCreationOptions.LongRunning);
     386    }
     387
     388    public ResultCollection StartAlgorithm(int index, CancellationToken cancellation) {
     389      var task = StartAlgorithmAsync(index, cancellation);
     390      task.Wait(cancellation);
     391      return task.Result;
    448392    }
    449393
     
    597541          }
    598542        }
    599         KnowledgeBase = new RunCollection(runList);
     543        try {
     544          KnowledgeBase.UpdateOfRunsInProgress = true;
     545          KnowledgeBase.Clear();
     546          KnowledgeBase.AddRange(runList);
     547        } finally { KnowledgeBase.UpdateOfRunsInProgress = false; }
    600548      } finally { progress.Finish(); ProblemInstances.UpdateOfRunsInProgress = false; }
    601549      UpdateInstanceProjection();
     
    616564            var performanceGraph = ((IndexedDataTable<double>)run.Results["QualityPerEvaluations"]);
    617565            try {
    618               avgQuality += performanceGraph.Rows.First().Values.TakeWhile(x => x.Item1 < MaximumEvaluations).Last().Item2 / bkQuality;
     566              avgQuality += performanceGraph.Rows.First().Values.TakeWhile(x => x.Item1 < MaximumEvaluations.Value).Last().Item2 / bkQuality;
    619567              counter++;
    620568            } catch {
     
    632580    }
    633581
    634     public event PropertyChangedEventHandler PropertyChanged;
    635     private void OnPropertyChanged(string propertyName) {
    636       var handler = PropertyChanged;
    637       if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    638     }
    639 
    640582    public event EventHandler<EventArgs<IProgress>> DownloadStarted;
    641583    private void OnDownloadStarted(IProgress progress) {
     
    643585      if (handler != null) handler(this, new EventArgs<IProgress>(progress));
    644586    }
     587
     588    public event EventHandler<EventArgs<IAlgorithm>> AlgorithmInstanceStarted;
     589    private void OnAlgorithmInstanceStarted(IAlgorithm instance) {
     590      var handler = AlgorithmInstanceStarted;
     591      if (handler != null) handler(this, new EventArgs<IAlgorithm>(instance));
     592    }
    645593  }
    646594}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/HeuristicLab.OptimizationExpertSystem-3.3.csproj

    r13720 r13722  
    174174    <Reference Include="System.Data" />
    175175    <Reference Include="System.Xml" />
    176   </ItemGroup>
    177   <ItemGroup>
    178     <Compile Include="ExpertSystemView.cs">
    179       <SubType>UserControl</SubType>
    180     </Compile>
    181     <Compile Include="ExpertSystemView.Designer.cs">
    182       <DependentUpon>ExpertSystemView.cs</DependentUpon>
    183     </Compile>
    184     <Compile Include="Interfaces\IOptimizationExpertSystemUi.cs" />
    185     <Compile Include="KnowledgeBaseView.cs">
    186       <SubType>UserControl</SubType>
    187     </Compile>
    188     <Compile Include="KnowledgeBaseView.Designer.cs">
     176    <Reference Include="WeifenLuo.WinFormsUI.Docking-2.7.0, Version=2.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     177      <SpecificVersion>False</SpecificVersion>
     178      <HintPath>..\..\..\..\trunk\sources\bin\WeifenLuo.WinFormsUI.Docking-2.7.0.dll</HintPath>
     179    </Reference>
     180  </ItemGroup>
     181  <ItemGroup>
     182    <Compile Include="Docking\AlgorithmControlForm.cs">
     183      <SubType>Form</SubType>
     184    </Compile>
     185    <Compile Include="Docking\AlgorithmControlForm.Designer.cs">
     186      <DependentUpon>AlgorithmControlForm.cs</DependentUpon>
     187    </Compile>
     188    <Compile Include="Views\KnowledgeCenterAllinOneView.cs">
     189      <SubType>UserControl</SubType>
     190    </Compile>
     191    <Compile Include="Views\KnowledgeCenterAllinOneView.Designer.cs">
     192      <DependentUpon>KnowledgeCenterAllinOneView.cs</DependentUpon>
     193    </Compile>
     194    <Compile Include="Interfaces\IOptimizationKnowledgeCenterUi.cs" />
     195    <Compile Include="Views\KnowledgeBaseView.cs">
     196      <SubType>UserControl</SubType>
     197    </Compile>
     198    <Compile Include="Views\KnowledgeBaseView.Designer.cs">
    189199      <DependentUpon>KnowledgeBaseView.cs</DependentUpon>
    190200    </Compile>
     
    203213    <Compile Include="Menu\100_Understanding\120_SolutionsMenuItem.cs" />
    204214    <Compile Include="Menu\100_Understanding\110_ProblemInstanceMenuItem.cs" />
    205     <Compile Include="OptimizationExpertSystem.cs">
     215    <Compile Include="OptimizationKnowledgeCenter.cs">
    206216      <SubType>Form</SubType>
    207217    </Compile>
    208     <Compile Include="OptimizationExpertSystem.Designer.cs">
    209       <DependentUpon>OptimizationExpertSystem.cs</DependentUpon>
     218    <Compile Include="OptimizationKnowledgeCenter.Designer.cs">
     219      <DependentUpon>OptimizationKnowledgeCenter.cs</DependentUpon>
    210220    </Compile>
    211221    <Compile Include="Plugin.cs" />
    212     <Compile Include="SolverView.cs">
    213       <SubType>UserControl</SubType>
    214     </Compile>
    215     <Compile Include="SolverView.Designer.cs">
     222    <Compile Include="Views\SolverView.cs">
     223      <SubType>UserControl</SubType>
     224    </Compile>
     225    <Compile Include="Views\SolverView.Designer.cs">
    216226      <DependentUpon>SolverView.cs</DependentUpon>
    217227    </Compile>
    218     <Compile Include="UnderstandingProblemInstanceView.cs">
    219       <SubType>UserControl</SubType>
    220     </Compile>
    221     <Compile Include="UnderstandingProblemInstanceView.Designer.cs">
     228    <Compile Include="Views\UnderstandingProblemInstanceView.cs">
     229      <SubType>UserControl</SubType>
     230    </Compile>
     231    <Compile Include="Views\UnderstandingProblemInstanceView.Designer.cs">
    222232      <DependentUpon>UnderstandingProblemInstanceView.cs</DependentUpon>
    223233    </Compile>
    224     <Compile Include="UnderstandingSolutionsView.cs">
    225       <SubType>UserControl</SubType>
    226     </Compile>
    227     <Compile Include="UnderstandingSolutionsView.Designer.cs">
     234    <Compile Include="Views\UnderstandingSolutionsView.cs">
     235      <SubType>UserControl</SubType>
     236    </Compile>
     237    <Compile Include="Views\UnderstandingSolutionsView.Designer.cs">
    228238      <DependentUpon>UnderstandingSolutionsView.cs</DependentUpon>
    229239    </Compile>
    230     <Compile Include="Views\ExpertSystemViewBase.cs">
    231       <SubType>UserControl</SubType>
    232     </Compile>
    233     <Compile Include="Views\ExpertSystemViewBase.Designer.cs">
    234       <DependentUpon>ExpertSystemViewBase.cs</DependentUpon>
     240    <Compile Include="Views\KnowledgeCenterViewBase.cs">
     241      <SubType>UserControl</SubType>
     242    </Compile>
     243    <Compile Include="Views\KnowledgeCenterViewBase.Designer.cs">
     244      <DependentUpon>KnowledgeCenterViewBase.cs</DependentUpon>
    235245    </Compile>
    236246    <None Include="Properties\AssemblyInfo.cs.frame" />
     
    269279  </ItemGroup>
    270280  <ItemGroup>
    271     <EmbeddedResource Include="ExpertSystemView.resx">
    272       <DependentUpon>ExpertSystemView.cs</DependentUpon>
    273     </EmbeddedResource>
    274     <EmbeddedResource Include="KnowledgeBaseView.resx">
     281    <EmbeddedResource Include="Docking\AlgorithmControlForm.resx">
     282      <DependentUpon>AlgorithmControlForm.cs</DependentUpon>
     283    </EmbeddedResource>
     284    <EmbeddedResource Include="Views\KnowledgeCenterAllinOneView.resx">
     285      <DependentUpon>KnowledgeCenterAllinOneView.cs</DependentUpon>
     286    </EmbeddedResource>
     287    <EmbeddedResource Include="Views\KnowledgeBaseView.resx">
    275288      <DependentUpon>KnowledgeBaseView.cs</DependentUpon>
    276289    </EmbeddedResource>
    277     <EmbeddedResource Include="OptimizationExpertSystem.resx">
    278       <DependentUpon>OptimizationExpertSystem.cs</DependentUpon>
    279     </EmbeddedResource>
    280     <EmbeddedResource Include="SolverView.resx">
     290    <EmbeddedResource Include="OptimizationKnowledgeCenter.resx">
     291      <DependentUpon>OptimizationKnowledgeCenter.cs</DependentUpon>
     292    </EmbeddedResource>
     293    <EmbeddedResource Include="Views\SolverView.resx">
    281294      <DependentUpon>SolverView.cs</DependentUpon>
    282295    </EmbeddedResource>
    283     <EmbeddedResource Include="UnderstandingProblemInstanceView.resx">
     296    <EmbeddedResource Include="Views\UnderstandingProblemInstanceView.resx">
    284297      <DependentUpon>UnderstandingProblemInstanceView.cs</DependentUpon>
    285298    </EmbeddedResource>
    286     <EmbeddedResource Include="UnderstandingSolutionsView.resx">
     299    <EmbeddedResource Include="Views\UnderstandingSolutionsView.resx">
    287300      <DependentUpon>UnderstandingSolutionsView.cs</DependentUpon>
    288301    </EmbeddedResource>
    289     <EmbeddedResource Include="Views\ExpertSystemViewBase.resx">
    290       <DependentUpon>ExpertSystemViewBase.cs</DependentUpon>
    291     </EmbeddedResource>
    292   </ItemGroup>
     302    <EmbeddedResource Include="Views\KnowledgeCenterViewBase.resx">
     303      <DependentUpon>KnowledgeCenterViewBase.cs</DependentUpon>
     304    </EmbeddedResource>
     305  </ItemGroup>
     306  <ItemGroup />
    293307  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    294308  <PropertyGroup>
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Interfaces/IOptimizationKnowledgeCenterUi.cs

    r13721 r13722  
    2121
    2222namespace HeuristicLab.OptimizationExpertSystem {
    23   public interface IOptimizationExpertSystemUi { }
     23  public interface IOptimizationKnowledgeCenterUi { }
    2424}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/900_Tools/990_ShowAllInOneViewMenuItem.cs

    r13720 r13722  
    2525  internal class ShowAllInOneViewMenuItem : MenuItemBase {
    2626    public override void Execute() {
    27       MainForm.ShowContent(MainForm.ExpertSystem, typeof(ExpertSystemView));
     27      MainForm.ShowContent(MainForm.ExpertSystem, typeof(KnowledgeCenterAllinOneView));
    2828    }
    2929
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Menu/MenuItemBase.cs

    r13718 r13722  
    2323
    2424namespace HeuristicLab.OptimizationExpertSystem.Menu {
    25   internal abstract class MenuItemBase : MenuItem, IOptimizationExpertSystemUi {
    26     public OptimizationExpertSystem MainForm {
    27       get { return (OptimizationExpertSystem)HeuristicLab.MainForm.MainFormManager.MainForm; }
     25  internal abstract class MenuItemBase : MenuItem, IOptimizationKnowledgeCenterUi {
     26    public OptimizationKnowledgeCenter MainForm {
     27      get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; }
    2828    }
    2929  }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.Designer.cs

    r13721 r13722  
    11namespace HeuristicLab.OptimizationExpertSystem {
    2   partial class OptimizationExpertSystem {
     2  partial class OptimizationKnowledgeCenter {
    33    /// <summary>
    44    /// Required designer variable.
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/OptimizationKnowledgeCenter.cs

    r13721 r13722  
    2828
    2929namespace HeuristicLab.OptimizationExpertSystem {
    30   public partial class OptimizationExpertSystem : DockingMainForm {
     30  public partial class OptimizationKnowledgeCenter : DockingMainForm {
    3131    private ToolStripProgressBar progressBar;
    3232    private ToolStripLabel progressLabel;
    3333
    34     public ExpertSystem ExpertSystem { get; private set; }
     34    public KnowledgeCenter ExpertSystem { get; private set; }
    3535   
    36     public OptimizationExpertSystem(Type userInterfaceType) : base(userInterfaceType) {
     36    public OptimizationKnowledgeCenter(Type userInterfaceType) : base(userInterfaceType) {
    3737      InitializeComponent();
    38       ExpertSystem = new ExpertSystem();
     38      ExpertSystem = new KnowledgeCenter();
    3939      ExpertSystem.DownloadStarted += ExpertSystemOnDownloadStarted;
    4040      ShowContentInViewHost = false;
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame

    r13718 r13722  
    4646  internal class HeuristicLabOptimizationKnowledgeCenterApplication : ApplicationBase {
    4747    public override void Run(ICommandLineArgument[] args) {
    48       HeuristicLab.MainForm.WindowsForms.MainForm mainForm = new OptimizationExpertSystem(typeof(IOptimizationExpertSystemUi));
     48      HeuristicLab.MainForm.WindowsForms.MainForm mainForm = new OptimizationKnowledgeCenter(typeof(IOptimizationKnowledgeCenterUi));
    4949     
    5050      ClientInformation.InitializeAsync();
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeBaseView.cs

    r13721 r13722  
    2525namespace HeuristicLab.OptimizationExpertSystem {
    2626  [View("Knowledge Base View")]
    27   [Content(typeof(ExpertSystem), IsDefaultView = false)]
    28   public partial class KnowledgeBaseView : ExpertSystemViewBase {
     27  [Content(typeof(KnowledgeCenter), IsDefaultView = false)]
     28  public partial class KnowledgeBaseView : KnowledgeCenterViewBase {
    2929    public KnowledgeBaseView() {
    3030      InitializeComponent();
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterAllinOneView.Designer.cs

    r13721 r13722  
    2121
    2222namespace HeuristicLab.OptimizationExpertSystem {
    23   partial class ExpertSystemView {
     23  partial class KnowledgeCenterAllinOneView {
    2424    /// <summary>
    2525    /// Required designer variable.
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterAllinOneView.cs

    r13721 r13722  
    3030using HeuristicLab.Data.Views;
    3131using HeuristicLab.MainForm;
     32using HeuristicLab.MainForm.WindowsForms;
    3233using HeuristicLab.Optimization;
    3334using HeuristicLab.Optimization.Views;
     
    4344namespace HeuristicLab.OptimizationExpertSystem {
    4445  [View("Knowledge Center (all-in-one view)")]
    45   [Content(typeof(ExpertSystem), IsDefaultView = true)]
    46   public partial class ExpertSystemView : ItemView {
     46  [Content(typeof(KnowledgeCenter), IsDefaultView = true)]
     47  public partial class KnowledgeCenterAllinOneView : AsynchronousContentView {
    4748    private EnumValueView<SeedingStrategyTypes> seedingStrategyView;
    4849    private CheckedItemListView<IScope> seedingSolutionsView;
     
    5051    private bool okbDownloadInProgress;
    5152
    52     public new ExpertSystem Content {
    53       get { return (ExpertSystem)base.Content; }
     53    public new KnowledgeCenter Content {
     54      get { return (KnowledgeCenter)base.Content; }
    5455      set { base.Content = value; }
    5556    }
    5657
    57     public ExpertSystemView() {
     58    public KnowledgeCenterAllinOneView() {
    5859      InitializeComponent();
    5960      // brings progress panel to front (it is not visible by default, but obstructs other elements in designer)
     
    7778    #region Event Registration
    7879    protected override void DeregisterContentEvents() {
    79       Content.PropertyChanged -= ContentOnPropertyChanged;
    8080      Content.SuggestedInstances.CollectionReset -= SuggestedInstancesOnChanged;
    8181      Content.SuggestedInstances.ItemsAdded -= SuggestedInstancesOnChanged;
     
    9494    protected override void RegisterContentEvents() {
    9595      base.RegisterContentEvents();
    96       Content.PropertyChanged += ContentOnPropertyChanged;
    9796      Content.SuggestedInstances.CollectionReset += SuggestedInstancesOnChanged;
    9897      Content.SuggestedInstances.ItemsAdded += SuggestedInstancesOnChanged;
     
    145144          maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString();
    146145          problemViewHost.Content = Content.Problem;
    147           runsView.Content = Content.Runs;
     146          runsView.Content = Content.InstanceRuns;
    148147          kbViewHost.ViewType = typeof(RunCollectionRLDView);
    149148          kbViewHost.Content = Content.KnowledgeBase;
    150149          problemInstancesView.Content = Content.ProblemInstances;
    151           solverResultsView.Content = Content.CurrentResult;
     150          solverResultsView.Content = null;
    152151          seedingStrategyView.Content = Content.SeedingStrategy;
    153152          seedingSolutionsView.Content = Content.SolutionSeedingPool;
     
    181180    }
    182181
    183     private void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {
    184       if (InvokeRequired) {
    185         Invoke((Action<object, PropertyChangedEventArgs>)ContentOnPropertyChanged, sender, e);
    186         return;
    187       }
    188       SuppressEvents = true;
    189       try {
    190         switch (e.PropertyName) {
    191           case "KnowledgeBase": kbViewHost.Content = Content.KnowledgeBase; break;
    192           case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;
    193           case "Problem":
    194             DeregisterProblemEvents(problemViewHost.Content as OKBProblem);
    195             problemViewHost.Content = Content.Problem;
    196             RegisterProblemEvents(Content.Problem);
    197             UpdateNamesComboboxes();
    198             break;
    199           case "ProblemInstances": problemInstancesView.Content = Content.ProblemInstances; break;
    200           case "CurrentResult": solverResultsView.Content = Content.CurrentResult; break;
    201         }
    202       } finally { SuppressEvents = false; }
    203       SetEnabledStateOfControls();
    204     }
    205 
    206182    private void SuggestedInstancesOnChanged(object sender, EventArgs e) {
    207183      UpdateSuggestedInstancesCombobox();
     
    230206        //errorProvider.SetError(maxEvaluationsTextBox, "Please enter a valid integer number.");
    231207      } else {
    232         Content.MaximumEvaluations = value;
     208        Content.MaximumEvaluations.Value = value;
    233209        e.Cancel = false;
    234210        //errorProvider.SetError(maxEvaluationsTextBox, null);
     
    264240    }
    265241
    266     private void AlgorithmStartButtonOnClick(object sender, EventArgs e) {
    267       if (suggestedInstancesComboBox.SelectedIndex >= 0)
    268         Content.StartAlgorithmAsync(suggestedInstancesComboBox.SelectedIndex);
     242    private async void AlgorithmStartButtonOnClick(object sender, EventArgs e) {
     243      if (suggestedInstancesComboBox.SelectedIndex >= 0) {
     244        solverResultsView.Content = await Content.StartAlgorithmAsync(suggestedInstancesComboBox.SelectedIndex);
     245      }
    269246    }
    270247
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.Designer.cs

    r13721 r13722  
    2121
    2222namespace HeuristicLab.OptimizationExpertSystem {
    23   partial class ExpertSystemViewBase {
     23  partial class KnowledgeCenterViewBase {
    2424    /// <summary>
    2525    /// Required designer variable.
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.cs

    r13721 r13722  
    2121
    2222using HeuristicLab.Common;
    23 using HeuristicLab.Core.Views;
    2423using HeuristicLab.MainForm;
     24using HeuristicLab.MainForm.WindowsForms;
     25using HeuristicLab.Optimization;
    2526using HeuristicLab.OptimizationExpertSystem.Common;
    2627using System;
    27 using System.ComponentModel;
    2828
    2929namespace HeuristicLab.OptimizationExpertSystem {
    3030  [View("Expert-System View")]
    31   public partial class ExpertSystemViewBase : ItemView {
    32     public OptimizationExpertSystem MainForm {
    33       get { return (OptimizationExpertSystem)HeuristicLab.MainForm.MainFormManager.MainForm; }
     31  public partial class KnowledgeCenterViewBase : AsynchronousContentView {
     32    public OptimizationKnowledgeCenter MainForm {
     33      get { return (OptimizationKnowledgeCenter)HeuristicLab.MainForm.MainFormManager.MainForm; }
    3434    }
    3535
    36     public new ExpertSystem Content {
    37       get { return (ExpertSystem)base.Content; }
     36    public new KnowledgeCenter Content {
     37      get { return (KnowledgeCenter)base.Content; }
    3838      set { base.Content = value; }
    3939    }
    4040
    41     protected ExpertSystemViewBase() {
     41    protected KnowledgeCenterViewBase() {
    4242      InitializeComponent();
    4343    }
     
    4646    protected override void RegisterContentEvents() {
    4747      base.RegisterContentEvents();
    48       Content.PropertyChanged += ContentOnPropertyChanged;
    4948      Content.DownloadStarted += ContentOnDownloadStarted;
     49      Content.AlgorithmInstanceStarted += ContentOnAlgorithmInstanceStarted;
    5050      RegisterContentProblemEvents();
    5151      RegisterContentProblemInstancesEvents();
     
    8888    protected override void DeregisterContentEvents() {
    8989      base.DeregisterContentEvents();
    90       Content.PropertyChanged -= ContentOnPropertyChanged;
    9190      Content.DownloadStarted -= ContentOnDownloadStarted;
     91      Content.AlgorithmInstanceStarted -= ContentOnAlgorithmInstanceStarted;
    9292      DeregisterContentProblemEvents();
    9393      DeregisterContentProblemInstancesEvents();
     
    129129    #endregion
    130130
    131     private void ContentOnPropertyChanged(object sender, PropertyChangedEventArgs e) {
    132       if (InvokeRequired) Invoke((Action<string>)OnPropertyChanged, e.PropertyName);
    133       else {
    134         switch (e.PropertyName) {
    135           case "Problem": RegisterContentProblemEvents(); break;
    136           case "ProblemInstances": RegisterContentProblemInstancesEvents(); break;
    137           case "SolutionSeedingPool": RegisterContentSolutionSeedingPoolEvents(); break;
    138           case "SuggestedInstances": RegisterContentSuggestedInstancesEvents(); break;
    139         }
    140         OnPropertyChanged(e.PropertyName);
    141       }
    142     }
    143 
    144131    protected virtual void OnDownloadStarted(IProgress progress) { }
    145132    protected virtual void OnDownloadEnded() { }
     133    protected virtual void OnAlgorithmInstanceStarted(IAlgorithm algorithm) { }
    146134    protected virtual void OnPropertyChanged(string propertyName) { }
    147135    protected virtual void OnProblemChanged() { }
     
    150138    protected virtual void OnSolutionSeedingPoolChanged() { }
    151139    protected virtual void OnSuggestedInstancesChanged() { }
     140    protected virtual void OnKnowledgeBaseChanged() { }
    152141
    153142    #region Content Event Handlers
     
    157146      e.Value.ProgressStateChanged += ProgressOnStateChanged;
    158147      OnDownloadStarted(e.Value);
     148    }
     149
     150    private void ContentOnAlgorithmInstanceStarted(object sender, EventArgs<IAlgorithm> e) {
     151      if (InvokeRequired) { Invoke((Action<object, EventArgs<IAlgorithm>>)ContentOnAlgorithmInstanceStarted, sender, e); return; }
     152      OnAlgorithmInstanceStarted(e.Value);
    159153    }
    160154
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.Designer.cs

    r13721 r13722  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
     48      WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
     49      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     50      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     51      WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
     52      WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
     53      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     54      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     55      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     56      WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
     57      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     58      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     59      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     60      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     61      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
    4762      this.seedingStrategyPanel = new System.Windows.Forms.Panel();
    4863      this.solverTabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    4964      this.resultsTabPage = new System.Windows.Forms.TabPage();
    50       this.solverResultsView = new HeuristicLab.Optimization.Views.ResultCollectionView();
     65      this.showOnlyFinalResultCheckBox = new System.Windows.Forms.CheckBox();
     66      this.resultsDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
     67      this.runsTabPage = new System.Windows.Forms.TabPage();
     68      this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
    5169      this.solutionSeedingTabPage = new System.Windows.Forms.TabPage();
    5270      this.parametersTabPage = new System.Windows.Forms.TabPage();
     
    5876      this.evaluationsLimitabel = new System.Windows.Forms.Label();
    5977      this.algorithmSuggestionLabel = new System.Windows.Forms.Label();
    60       this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();
    6178      this.suggestedInstancesComboBox = new System.Windows.Forms.ComboBox();
    6279      this.algorithmCloneButton = new System.Windows.Forms.Button();
    63       this.runsTabPage = new System.Windows.Forms.TabPage();
    64       this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();
     80      this.maxEvaluationsView = new HeuristicLab.Data.Views.StringConvertibleValueView();
     81      this.seededRunsTabPage = new System.Windows.Forms.TabPage();
     82      this.seededRunsView = new HeuristicLab.Optimization.Views.RunCollectionView();
    6583      this.solverTabControl.SuspendLayout();
    6684      this.resultsTabPage.SuspendLayout();
     85      this.runsTabPage.SuspendLayout();
    6786      this.parametersTabPage.SuspendLayout();
    6887      this.operatorGraphTabPage.SuspendLayout();
    69       this.runsTabPage.SuspendLayout();
     88      this.seededRunsTabPage.SuspendLayout();
    7089      this.SuspendLayout();
    7190      //
     
    87106      this.solverTabControl.Controls.Add(this.resultsTabPage);
    88107      this.solverTabControl.Controls.Add(this.runsTabPage);
     108      this.solverTabControl.Controls.Add(this.seededRunsTabPage);
    89109      this.solverTabControl.Controls.Add(this.solutionSeedingTabPage);
    90110      this.solverTabControl.Controls.Add(this.parametersTabPage);
     
    98118      // resultsTabPage
    99119      //
    100       this.resultsTabPage.Controls.Add(this.solverResultsView);
     120      this.resultsTabPage.Controls.Add(this.showOnlyFinalResultCheckBox);
     121      this.resultsTabPage.Controls.Add(this.resultsDockPanel);
    101122      this.resultsTabPage.Location = new System.Drawing.Point(4, 22);
    102123      this.resultsTabPage.Name = "resultsTabPage";
     
    107128      this.resultsTabPage.UseVisualStyleBackColor = true;
    108129      //
    109       // solverResultsView
    110       //
    111       this.solverResultsView.Caption = "ResultCollection View";
    112       this.solverResultsView.Content = null;
    113       this.solverResultsView.Dock = System.Windows.Forms.DockStyle.Fill;
    114       this.solverResultsView.Location = new System.Drawing.Point(3, 3);
    115       this.solverResultsView.Name = "solverResultsView";
    116       this.solverResultsView.ReadOnly = true;
    117       this.solverResultsView.ShowDetails = true;
    118       this.solverResultsView.Size = new System.Drawing.Size(835, 448);
    119       this.solverResultsView.TabIndex = 1;
     130      // showOnlyFinalResultCheckBox
     131      //
     132      this.showOnlyFinalResultCheckBox.AutoSize = true;
     133      this.showOnlyFinalResultCheckBox.Location = new System.Drawing.Point(6, 6);
     134      this.showOnlyFinalResultCheckBox.Name = "showOnlyFinalResultCheckBox";
     135      this.showOnlyFinalResultCheckBox.Size = new System.Drawing.Size(158, 17);
     136      this.showOnlyFinalResultCheckBox.TabIndex = 1;
     137      this.showOnlyFinalResultCheckBox.Text = "show only final result (faster)";
     138      this.showOnlyFinalResultCheckBox.UseVisualStyleBackColor = true;
     139      //
     140      // resultsDockPanel
     141      //
     142      this.resultsDockPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     143            | System.Windows.Forms.AnchorStyles.Left)
     144            | System.Windows.Forms.AnchorStyles.Right)));
     145      this.resultsDockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
     146      this.resultsDockPanel.Location = new System.Drawing.Point(3, 29);
     147      this.resultsDockPanel.Name = "resultsDockPanel";
     148      this.resultsDockPanel.Size = new System.Drawing.Size(835, 422);
     149      dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
     150      dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
     151      autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
     152      tabGradient1.EndColor = System.Drawing.SystemColors.Control;
     153      tabGradient1.StartColor = System.Drawing.SystemColors.Control;
     154      tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     155      autoHideStripSkin1.TabGradient = tabGradient1;
     156      autoHideStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F);
     157      dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
     158      tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight;
     159      tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight;
     160      tabGradient2.TextColor = System.Drawing.SystemColors.ControlText;
     161      dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
     162      dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control;
     163      dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control;
     164      dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
     165      tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
     166      tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
     167      tabGradient3.TextColor = System.Drawing.SystemColors.ControlText;
     168      dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
     169      dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
     170      dockPaneStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F);
     171      tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption;
     172      tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     173      tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
     174      tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
     175      dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
     176      tabGradient5.EndColor = System.Drawing.SystemColors.Control;
     177      tabGradient5.StartColor = System.Drawing.SystemColors.Control;
     178      tabGradient5.TextColor = System.Drawing.SystemColors.ControlText;
     179      dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
     180      dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
     181      dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
     182      dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
     183      tabGradient6.EndColor = System.Drawing.SystemColors.InactiveCaption;
     184      tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     185      tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
     186      tabGradient6.TextColor = System.Drawing.SystemColors.InactiveCaptionText;
     187      dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
     188      tabGradient7.EndColor = System.Drawing.Color.Transparent;
     189      tabGradient7.StartColor = System.Drawing.Color.Transparent;
     190      tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     191      dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
     192      dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
     193      dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
     194      this.resultsDockPanel.Skin = dockPanelSkin1;
     195      this.resultsDockPanel.TabIndex = 0;
     196      //
     197      // runsTabPage
     198      //
     199      this.runsTabPage.Controls.Add(this.runsView);
     200      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
     201      this.runsTabPage.Name = "runsTabPage";
     202      this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
     203      this.runsTabPage.Size = new System.Drawing.Size(841, 454);
     204      this.runsTabPage.TabIndex = 4;
     205      this.runsTabPage.Text = "Runs";
     206      this.runsTabPage.UseVisualStyleBackColor = true;
     207      //
     208      // runsView
     209      //
     210      this.runsView.Caption = "RunCollection View";
     211      this.runsView.Content = null;
     212      this.runsView.Dock = System.Windows.Forms.DockStyle.Fill;
     213      this.runsView.Location = new System.Drawing.Point(3, 3);
     214      this.runsView.Name = "runsView";
     215      this.runsView.ReadOnly = false;
     216      this.runsView.Size = new System.Drawing.Size(835, 448);
     217      this.runsView.TabIndex = 0;
    120218      //
    121219      // solutionSeedingTabPage
     
    216314      this.algorithmSuggestionLabel.Text = "Suggested Solvers:";
    217315      //
    218       // maxEvaluationsTextBox
    219       //
    220       this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    221             | System.Windows.Forms.AnchorStyles.Right)));
    222       this.maxEvaluationsTextBox.Location = new System.Drawing.Point(108, 3);
    223       this.maxEvaluationsTextBox.Name = "maxEvaluationsTextBox";
    224       this.maxEvaluationsTextBox.Size = new System.Drawing.Size(741, 20);
    225       this.maxEvaluationsTextBox.TabIndex = 14;
    226       this.maxEvaluationsTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.MaxEvaluationsTextBoxOnValidating);
    227       //
    228316      // suggestedInstancesComboBox
    229317      //
     
    249337      this.algorithmCloneButton.Click += new System.EventHandler(this.AlgorithmCloneButtonOnClick);
    250338      //
    251       // runsTabPage
    252       //
    253       this.runsTabPage.Controls.Add(this.runsView);
    254       this.runsTabPage.Location = new System.Drawing.Point(4, 22);
    255       this.runsTabPage.Name = "runsTabPage";
    256       this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
    257       this.runsTabPage.Size = new System.Drawing.Size(841, 454);
    258       this.runsTabPage.TabIndex = 4;
    259       this.runsTabPage.Text = "Runs";
    260       this.runsTabPage.UseVisualStyleBackColor = true;
    261       //
    262       // runsView
    263       //
    264       this.runsView.Caption = "RunCollection View";
    265       this.runsView.Content = null;
    266       this.runsView.Dock = System.Windows.Forms.DockStyle.Fill;
    267       this.runsView.Location = new System.Drawing.Point(3, 3);
    268       this.runsView.Name = "runsView";
    269       this.runsView.ReadOnly = false;
    270       this.runsView.Size = new System.Drawing.Size(835, 448);
    271       this.runsView.TabIndex = 0;
     339      // maxEvaluationsView
     340      //
     341      this.maxEvaluationsView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     342            | System.Windows.Forms.AnchorStyles.Right)));
     343      this.maxEvaluationsView.Caption = "StringConvertibleValue View";
     344      this.maxEvaluationsView.Content = null;
     345      this.maxEvaluationsView.LabelVisible = false;
     346      this.maxEvaluationsView.Location = new System.Drawing.Point(91, 3);
     347      this.maxEvaluationsView.Name = "maxEvaluationsView";
     348      this.maxEvaluationsView.ReadOnly = false;
     349      this.maxEvaluationsView.Size = new System.Drawing.Size(758, 21);
     350      this.maxEvaluationsView.TabIndex = 16;
     351      //
     352      // seededRunsTabPage
     353      //
     354      this.seededRunsTabPage.Controls.Add(this.seededRunsView);
     355      this.seededRunsTabPage.Location = new System.Drawing.Point(4, 22);
     356      this.seededRunsTabPage.Name = "seededRunsTabPage";
     357      this.seededRunsTabPage.Padding = new System.Windows.Forms.Padding(3);
     358      this.seededRunsTabPage.Size = new System.Drawing.Size(841, 454);
     359      this.seededRunsTabPage.TabIndex = 5;
     360      this.seededRunsTabPage.Text = "Seeded Runs";
     361      this.seededRunsTabPage.UseVisualStyleBackColor = true;
     362      //
     363      // seededRunsView
     364      //
     365      this.seededRunsView.Caption = "RunCollection View";
     366      this.seededRunsView.Content = null;
     367      this.seededRunsView.Dock = System.Windows.Forms.DockStyle.Fill;
     368      this.seededRunsView.Location = new System.Drawing.Point(3, 3);
     369      this.seededRunsView.Name = "seededRunsView";
     370      this.seededRunsView.ReadOnly = false;
     371      this.seededRunsView.Size = new System.Drawing.Size(835, 448);
     372      this.seededRunsView.TabIndex = 1;
    272373      //
    273374      // SolverView
     
    275376      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    276377      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     378      this.Controls.Add(this.maxEvaluationsView);
    277379      this.Controls.Add(this.algorithmCloneButton);
    278380      this.Controls.Add(this.seedingStrategyPanel);
     
    282384      this.Controls.Add(this.evaluationsLimitabel);
    283385      this.Controls.Add(this.algorithmSuggestionLabel);
    284       this.Controls.Add(this.maxEvaluationsTextBox);
    285386      this.Controls.Add(this.suggestedInstancesComboBox);
    286387      this.Name = "SolverView";
     
    288389      this.solverTabControl.ResumeLayout(false);
    289390      this.resultsTabPage.ResumeLayout(false);
     391      this.resultsTabPage.PerformLayout();
     392      this.runsTabPage.ResumeLayout(false);
    290393      this.parametersTabPage.ResumeLayout(false);
    291394      this.operatorGraphTabPage.ResumeLayout(false);
    292       this.runsTabPage.ResumeLayout(false);
     395      this.seededRunsTabPage.ResumeLayout(false);
    293396      this.ResumeLayout(false);
    294397      this.PerformLayout();
     
    301404    private MainForm.WindowsForms.DragOverTabControl solverTabControl;
    302405    private System.Windows.Forms.TabPage resultsTabPage;
    303     private Optimization.Views.ResultCollectionView solverResultsView;
    304406    private System.Windows.Forms.TabPage solutionSeedingTabPage;
    305407    private System.Windows.Forms.TabPage parametersTabPage;
     
    311413    private System.Windows.Forms.Label evaluationsLimitabel;
    312414    private System.Windows.Forms.Label algorithmSuggestionLabel;
    313     private System.Windows.Forms.TextBox maxEvaluationsTextBox;
    314415    private System.Windows.Forms.ComboBox suggestedInstancesComboBox;
    315416    private System.Windows.Forms.Button algorithmCloneButton;
    316417    private System.Windows.Forms.TabPage runsTabPage;
    317418    private Optimization.Views.RunCollectionView runsView;
     419    private Data.Views.StringConvertibleValueView maxEvaluationsView;
     420    private WeifenLuo.WinFormsUI.Docking.DockPanel resultsDockPanel;
     421    private System.Windows.Forms.CheckBox showOnlyFinalResultCheckBox;
     422    private System.Windows.Forms.TabPage seededRunsTabPage;
     423    private Optimization.Views.RunCollectionView seededRunsView;
    318424  }
    319425}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.cs

    r13721 r13722  
    2828using HeuristicLab.OptimizationExpertSystem.Common;
    2929using System;
    30 using System.ComponentModel;
    3130using System.Windows.Forms;
    3231
    3332namespace HeuristicLab.OptimizationExpertSystem {
    3433  [View("Solver View")]
    35   [Content(typeof(ExpertSystem), IsDefaultView = false)]
    36   public partial class SolverView : ExpertSystemViewBase {
     34  [Content(typeof(KnowledgeCenter), IsDefaultView = false)]
     35  public partial class SolverView : KnowledgeCenterViewBase {
    3736    private EnumValueView<SeedingStrategyTypes> seedingStrategyView;
    3837    private CheckedItemListView<IScope> seedingSolutionsView;
     
    6059      try {
    6160        if (Content == null) {
    62           maxEvaluationsTextBox.Text = string.Empty;
     61          maxEvaluationsView.Content = null;
    6362          solverParametersView.Content = null;
    64           solverResultsView.Content = null;
    6563          runsView.Content = null;
     64          seededRunsView.Content = null;
    6665          seedingStrategyView.Content = null;
    6766          seedingSolutionsView.Content = null;
    6867        } else {
    69           maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString();
    70           runsView.Content = Content.Runs;
    71           solverResultsView.Content = Content.CurrentResult;
     68          maxEvaluationsView.Content = Content.MaximumEvaluations;
     69          runsView.Content = Content.InstanceRuns;
     70          seededRunsView.Content = Content.SeededRuns;
    7271          seedingStrategyView.Content = Content.SeedingStrategy;
    7372          seedingSolutionsView.Content = Content.SolutionSeedingPool;
     
    7978    protected override void SetEnabledStateOfControls() {
    8079      base.SetEnabledStateOfControls();
    81       maxEvaluationsTextBox.Enabled = Content != null && !ReadOnly && !Locked;
    8280      suggestedInstancesComboBox.Enabled = Content != null && !ReadOnly && !Locked;
    8381      algorithmStartButton.Enabled = Content != null && !ReadOnly && !Locked && suggestedInstancesComboBox.SelectedIndex >= 0;
     
    8684    }
    8785
    88     protected override void OnPropertyChanged(string propertyName) {
    89       base.OnPropertyChanged(propertyName);
    90       SuppressEvents = true;
    91       try {
    92         switch (propertyName) {
    93           case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;
    94           case "CurrentResult": solverResultsView.Content = Content.CurrentResult; break;
    95         }
    96       } finally { SuppressEvents = false; }
    97       SetEnabledStateOfControls();
     86    protected override void OnAlgorithmInstanceStarted(IAlgorithm algorithm) {
     87      base.OnAlgorithmInstanceStarted(algorithm);
     88      var form = new AlgorithmControlForm(algorithm, showOnlyFinalResultCheckBox.Checked);
     89      form.Show(resultsDockPanel);
    9890    }
    9991
     
    116108      if (prevNewIndex >= 0) {
    117109        suggestedInstancesComboBox.SelectedIndex = prevNewIndex;
    118       }
    119     }
    120 
    121     private void MaxEvaluationsTextBoxOnValidating(object sender, CancelEventArgs e) {
    122       if (SuppressEvents) return;
    123       if (InvokeRequired) {
    124         Invoke((Action<object, CancelEventArgs>)MaxEvaluationsTextBoxOnValidating, sender, e);
    125         return;
    126       }
    127       int value;
    128       if (!int.TryParse(maxEvaluationsTextBox.Text, out value)) {
    129         e.Cancel = !maxEvaluationsTextBox.ReadOnly && maxEvaluationsTextBox.Enabled;
    130         //errorProvider.SetError(maxEvaluationsTextBox, "Please enter a valid integer number.");
    131       } else {
    132         Content.MaximumEvaluations = value;
    133         e.Cancel = false;
    134         //errorProvider.SetError(maxEvaluationsTextBox, null);
    135110      }
    136111    }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingProblemInstanceView.cs

    r13721 r13722  
    3030namespace HeuristicLab.OptimizationExpertSystem {
    3131  [View("Understanding Problem Instance")]
    32   [Content(typeof(ExpertSystem), IsDefaultView = false)]
    33   public partial class UnderstandingProblemInstanceView : ExpertSystemViewBase {
     32  [Content(typeof(KnowledgeCenter), IsDefaultView = false)]
     33  public partial class UnderstandingProblemInstanceView : KnowledgeCenterViewBase {
    3434    public UnderstandingProblemInstanceView() {
    3535      InitializeComponent();
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingSolutionsView.Designer.cs

    r13721 r13722  
    6666      this.solutionsNetworkTabPage = new System.Windows.Forms.TabPage();
    6767      this.solutionsNetworkChart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
     68      this.pearsonsRSquaredLabel = new System.Windows.Forms.Label();
     69      this.fdcPearsonLabel = new System.Windows.Forms.Label();
     70      this.spearmansRankLabel = new System.Windows.Forms.Label();
     71      this.fdcSpearmanLabel = new System.Windows.Forms.Label();
    6872      this.solutionsTabControl.SuspendLayout();
    6973      this.solutionsQualityTabPage.SuspendLayout();
     
    209213      // solutionsFdcTabPage
    210214      //
     215      this.solutionsFdcTabPage.Controls.Add(this.fdcSpearmanLabel);
     216      this.solutionsFdcTabPage.Controls.Add(this.fdcPearsonLabel);
     217      this.solutionsFdcTabPage.Controls.Add(this.spearmansRankLabel);
     218      this.solutionsFdcTabPage.Controls.Add(this.pearsonsRSquaredLabel);
    211219      this.solutionsFdcTabPage.Controls.Add(this.fdcBetweenBestCheckBox);
    212220      this.solutionsFdcTabPage.Controls.Add(this.solutionsFdcViewHost);
     
    301309      this.solutionsNetworkChart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SolutionsNetworkChartOnMouseDoubleClick);
    302310      //
    303       // UnderstandingSolutions
     311      // pearsonsRSquaredLabel
     312      //
     313      this.pearsonsRSquaredLabel.AutoSize = true;
     314      this.pearsonsRSquaredLabel.Location = new System.Drawing.Point(436, 7);
     315      this.pearsonsRSquaredLabel.Name = "pearsonsRSquaredLabel";
     316      this.pearsonsRSquaredLabel.Size = new System.Drawing.Size(65, 13);
     317      this.pearsonsRSquaredLabel.TabIndex = 3;
     318      this.pearsonsRSquaredLabel.Text = "Pearson\'s r²:";
     319      //
     320      // fdcPearsonLabel
     321      //
     322      this.fdcPearsonLabel.AutoSize = true;
     323      this.fdcPearsonLabel.Location = new System.Drawing.Point(512, 7);
     324      this.fdcPearsonLabel.Name = "fdcPearsonLabel";
     325      this.fdcPearsonLabel.Size = new System.Drawing.Size(10, 13);
     326      this.fdcPearsonLabel.TabIndex = 4;
     327      this.fdcPearsonLabel.Text = "-";
     328      //
     329      // spearmansRankLabel
     330      //
     331      this.spearmansRankLabel.AutoSize = true;
     332      this.spearmansRankLabel.Location = new System.Drawing.Point(281, 7);
     333      this.spearmansRankLabel.Name = "spearmansRankLabel";
     334      this.spearmansRankLabel.Size = new System.Drawing.Size(74, 13);
     335      this.spearmansRankLabel.TabIndex = 3;
     336      this.spearmansRankLabel.Text = "Spearman\'s ρ:";
     337      //
     338      // fdcSpearmanLabel
     339      //
     340      this.fdcSpearmanLabel.AutoSize = true;
     341      this.fdcSpearmanLabel.Location = new System.Drawing.Point(357, 7);
     342      this.fdcSpearmanLabel.Name = "fdcSpearmanLabel";
     343      this.fdcSpearmanLabel.Size = new System.Drawing.Size(10, 13);
     344      this.fdcSpearmanLabel.TabIndex = 4;
     345      this.fdcSpearmanLabel.Text = "-";
     346      //
     347      // UnderstandingSolutionsView
    304348      //
    305349      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    310354      this.Controls.Add(this.similarityComboBox);
    311355      this.Controls.Add(this.solutionsTabControl);
    312       this.Name = "UnderstandingSolutions";
     356      this.Name = "UnderstandingSolutionsView";
    313357      this.Size = new System.Drawing.Size(732, 505);
    314358      this.solutionsTabControl.ResumeLayout(false);
     
    343387    private System.Windows.Forms.TabPage solutionsNetworkTabPage;
    344388    private Visualization.ChartControlsExtensions.EnhancedChart solutionsNetworkChart;
     389    private System.Windows.Forms.Label fdcPearsonLabel;
     390    private System.Windows.Forms.Label pearsonsRSquaredLabel;
     391    private System.Windows.Forms.Label fdcSpearmanLabel;
     392    private System.Windows.Forms.Label spearmansRankLabel;
    345393  }
    346394}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/UnderstandingSolutionsView.cs

    r13721 r13722  
    3636namespace HeuristicLab.OptimizationExpertSystem {
    3737  [View("Understanding Solutions")]
    38   [Content(typeof(ExpertSystem), IsDefaultView = false)]
    39   public partial class UnderstandingSolutionsView : ExpertSystemViewBase {
     38  [Content(typeof(KnowledgeCenter), IsDefaultView = false)]
     39  public partial class UnderstandingSolutionsView : KnowledgeCenterViewBase {
    4040    protected virtual bool SuppressEvents { get; set; }
    4141
     
    143143      try {
    144144        solutionsFdcViewHost.Content = null;
     145        fdcSpearmanLabel.Text = "-";
     146        fdcPearsonLabel.Text = "-";
    145147        var solutionScopes = GetSolutionScopes();
    146148        var points = new List<Point2D<double>>();
     
    166168          }
    167169        }
     170        var xs = points.Select(p => p.X).ToArray();
     171        var ys = points.Select(p => p.Y).ToArray();
     172        var scorr = alglib.spearmancorr2(xs, ys);
     173        var pcorr = alglib.pearsoncorr2(xs, ys);
     174        pcorr = pcorr * pcorr;
     175        fdcSpearmanLabel.Text = scorr.ToString("F2");
     176        fdcPearsonLabel.Text = pcorr.ToString("F2");
     177
    168178        var splot = new ScatterPlot("Fitness-Distance", "");
    169179        splot.VisualProperties.XAxisTitle = "Absolute Fitness Difference";
     180        splot.VisualProperties.XAxisMinimumAuto = false;
    170181        splot.VisualProperties.XAxisMinimumFixedValue = 0.0;
    171         splot.VisualProperties.XAxisMinimumAuto = false;
    172182        splot.VisualProperties.YAxisTitle = "Solution Distance";
     183        splot.VisualProperties.YAxisMinimumAuto = false;
    173184        splot.VisualProperties.YAxisMinimumFixedValue = 0.0;
    174         splot.VisualProperties.YAxisMinimumAuto = false;
     185        splot.VisualProperties.YAxisMaximumAuto = false;
    175186        splot.VisualProperties.YAxisMaximumFixedValue = 1.0;
    176         splot.VisualProperties.YAxisMaximumAuto = false;
    177187        var row = new ScatterPlotDataRow("Fdc", "", points);
    178         row.VisualProperties.PointSize = 7;
     188        row.VisualProperties.PointSize = 10;
     189        row.VisualProperties.ShowRegressionLine = true;
    179190        splot.Rows.Add(row);
    180191        solutionsFdcViewHost.Content = splot;
Note: See TracChangeset for help on using the changeset viewer.