Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/16 12:40:40 (9 years ago)
Author:
abeham
Message:

#2457: worked on recommendation algorithms

Location:
branches/PerformanceComparison
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/ExpectedRuntimeHelper.cs

    r13757 r13774  
    5353
    5454    public override string ToString() {
    55       return SuccessfulRuns == 0 ? "\u221e"
     55      return SuccessfulRuns == 0 ? "\u221e" // infinity symbol
    5656                                 : ExpectedRuntime.ToString("##,0.0", CultureInfo.CurrentCulture.NumberFormat);
    5757    }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/HeuristicLab.OptimizationExpertSystem.Common-3.3.csproj

    r13757 r13774  
    7878      <Private>False</Private>
    7979    </Reference>
     80    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     81      <SpecificVersion>False</SpecificVersion>
     82      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
     83      <Private>False</Private>
     84    </Reference>
    8085    <Reference Include="HeuristicLab.Clients.OKB-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    8186      <SpecificVersion>False</SpecificVersion>
     
    120125    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    121126      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     127      <Private>False</Private>
     128    </Reference>
     129    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     130      <SpecificVersion>False</SpecificVersion>
     131      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
    122132      <Private>False</Private>
    123133    </Reference>
     
    148158  </ItemGroup>
    149159  <ItemGroup>
     160    <Compile Include="OverallBestRecommender.cs" />
     161    <Compile Include="DistanceWeightedRecommender.cs" />
     162    <Compile Include="IAlgorithmInstanceRecommender.cs" />
     163    <Compile Include="KNearestNeighborRecommender.cs" />
    150164    <Compile Include="KnowledgeCenter.cs" />
    151165    <Compile Include="Plugin.cs" />
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs

    r13759 r13774  
    3030using HeuristicLab.Optimization;
    3131using HeuristicLab.Persistence.Default.Xml;
     32using HeuristicLab.Problems.DataAnalysis;
    3233using HeuristicLab.Random;
    3334using System;
     
    5051    public string Filename { get; set; }
    5152
    52     public static new Image StaticItemImage {
     53    public static Image StaticItemImage {
    5354      get { return VSImageLibrary.Library; }
    5455    }
     
    8485    }
    8586
    86     private readonly ItemList<IAlgorithm> suggestedInstances;
    87     private readonly ReadOnlyItemList<IAlgorithm> readOnlySuggestedInstances;
    88     public ReadOnlyItemList<IAlgorithm> SuggestedInstances {
    89       get { return readOnlySuggestedInstances; }
     87    private readonly ItemList<IAlgorithm> algorithmInstances;
     88    private readonly ReadOnlyItemList<IAlgorithm> readonlyAlgorithmInstances;
     89    public ReadOnlyItemList<IAlgorithm> AlgorithmInstances {
     90      get { return readonlyAlgorithmInstances; }
    9091    }
    9192
     
    101102    }
    102103
    103     private readonly EnumValue<ProblemInstanceProximityType> problemInstanceProximity;
    104     public EnumValue<ProblemInstanceProximityType> ProblemInstanceProximity {
    105       get { return problemInstanceProximity; }
    106     }
    107 
    108     private readonly DoubleValue problemInstanceNeighborhoodFactor;
    109     public DoubleValue ProblemInstanceNeighborhoodFactor {
    110       get { return problemInstanceNeighborhoodFactor; }
     104    private IAlgorithmInstanceRecommender algorithmInstanceRecommender;
     105    public IAlgorithmInstanceRecommender AlgorithmInstanceRecommender {
     106      get { return algorithmInstanceRecommender; }
     107      set { algorithmInstanceRecommender = value; }
    111108    }
    112109
     
    125122    private BidirectionalDictionary<long, IRun> problemId2ProblemInstanceMapping;
    126123   
    127     private bool Maximization {
     124    public bool Maximization {
    128125      get { return Problem != null && Problem.ProblemId >= 0 && ((IValueParameter<BoolValue>)Problem.MaximizationParameter).Value.Value; }
    129126    }
     
    135132      seededRuns = new RunCollection();
    136133      knowledgeBase = new RunCollection();
    137       suggestedInstances = new ItemList<IAlgorithm>();
    138       readOnlySuggestedInstances = suggestedInstances.AsReadOnly();
     134      algorithmInstances = new ItemList<IAlgorithm>();
     135      readonlyAlgorithmInstances = algorithmInstances.AsReadOnly();
    139136      problemInstances = new RunCollection();
    140137      problemCharacteristics = new CheckedItemList<StringValue>();
    141       problemInstanceProximity = new EnumValue<ProblemInstanceProximityType>(ProblemInstanceProximityType.FeatureSpace);
    142       problemInstanceNeighborhoodFactor = new DoubleValue(5);
    143138      readonlyProblemCharacteristics = problemCharacteristics.AsReadOnly();
     139      algorithmInstanceRecommender = new OverallBestRecommender(this);
    144140      problem = new SingleObjectiveOKBProblem();
    145141      algorithmId2RunMapping = new BidirectionalLookup<long, IRun>();
     
    176172      problemCharacteristics.CollectionReset += CharacteristicChanged;
    177173      problemCharacteristics.CheckedItemsChanged += CharacteristicChanged;
    178       problemInstanceProximity.ValueChanged += ProblemInstanceProximityChanged;
    179       problemInstanceNeighborhoodFactor.ValueChanged += ProblemInstanceProximityChanged;
    180174    }
    181175
     
    205199      UpdateInstanceProjection();
    206200    }
    207 
    208     private void ProblemInstanceProximityChanged(object sender, EventArgs e) {
    209       UpdateSuggestions();
    210     }
    211 
     201   
    212202    public bool IsCurrentInstance(IRun run) {
    213203      if (!problemId2ProblemInstanceMapping.ContainsSecond(run)) return false;
     
    339329
    340330    public Task<ResultCollection> StartAlgorithmAsync(int index, CancellationToken cancellation) {
    341       var selectedInstance = suggestedInstances[index];
     331      var selectedInstance = algorithmInstances[index];
    342332      var algorithmClone = (IAlgorithm)selectedInstance.Clone();
    343333      var problemClone = Problem.CloneProblem() as ISingleObjectiveHeuristicOptimizationProblem;
     
    627617    }
    628618
    629     private void UpdateSuggestions() {
    630       if (Problem == null) return;
    631       var piDistances = GetProblemDistances();
    632       var maxDist = piDistances.Max(x => x.Value);
    633       var instances = new SortedList<double, IAlgorithm>();
     619    public void UpdateSuggestions() {
     620      // TODO: Maintain a separate list of suggested instances
     621      // TODO: expose expected expected run time
     622      algorithmInstances.Replace(AlgorithmInstanceRecommender.GetRanking());
     623    }
     624
     625    public Dictionary<IAlgorithm, double> GetAlgorithmPerformance(IRun problemInstance) {
     626      if (!problemInstance.Parameters.ContainsKey("BestKnownQuality")) return new Dictionary<IAlgorithm, double>();
     627      var target = GetTarget(((DoubleValue)problemInstance.Parameters["BestKnownQuality"]).Value);
     628      return knowledgeBase.Where(x => ((StringValue)x.Parameters["Problem Name"]).Value == ((StringValue)problemInstance.Parameters["Problem Name"]).Value)
     629                          .GroupBy(x => algorithmId2AlgorithmInstanceMapping.GetByFirst(algorithmId2RunMapping.GetBySecond(x).Single()))
     630                          .ToDictionary(x => x.Key, x => ExpectedRuntimeHelper.CalculateErt(x.ToList(), "QualityPerEvaluations", target, Maximization).ExpectedRuntime);
     631    }
     632
     633    public Dictionary<IAlgorithm, List<IRun>> GetKnowledgeBaseByAlgorithm() {
     634      return KnowledgeBase.GroupBy(x => algorithmId2AlgorithmInstanceMapping.GetByFirst(algorithmId2RunMapping.GetBySecond(x).Single()))
     635                          .ToDictionary(x => x.Key, x => x.ToList());
     636    }
     637
     638    public IEnumerable<IRegressionProblem> GetDataAnalysisProblem(double target) {
     639      if (Problem == null) yield break;
     640      var characteristics = GetProblemCharacteristics();
     641      // TODO: knowledgebase only stores problem name as a string
     642      // this doesn't work if there are two equally named problem instances
     643      var problemMap = ProblemInstances.Select(x => new { Key = ((StringValue)x.Parameters["Problem Name"]).Value, Value = x })
     644                                       .ToDictionary(x => x.Key, x => x.Value);
    634645      foreach (var relevantRuns in knowledgeBase.GroupBy(x => algorithmId2RunMapping.GetBySecond(x).Single())) {
    635         var algorithm = algorithmId2AlgorithmInstanceMapping.GetByFirst(relevantRuns.Key);
    636         Func<double, double> distFunc = (d) => Math.Exp(ProblemInstanceNeighborhoodFactor.Value * (-d / maxDist));
    637         var pis = relevantRuns.Select(x => ((StringValue)x.Parameters["Problem Name"]).Value).Distinct()
    638                               .Select(x => Tuple.Create(x, ProblemInstances.SingleOrDefault(y => ((StringValue)y.Parameters["Problem Name"]).Value == x)))
    639                               .Where(x => x.Item2 != null)
    640                               .Select(x => Tuple.Create(x.Item1, distFunc(piDistances[x.Item2]), ((DoubleValue)x.Item2.Parameters["BestKnownQuality"]).Value))
    641                               .ToDictionary(x => x.Item1, x => Tuple.Create(x.Item2, x.Item3));
    642         var sumPis = pis.Sum(x => x.Value.Item1);
    643         var avgERT = 0.0;
    644         foreach (var problemRuns in relevantRuns.GroupBy(x => ((StringValue)x.Parameters["Problem Name"]).Value)) {
    645           Tuple<double, double> info;
    646           if (!pis.TryGetValue(problemRuns.Key, out info)) continue;
    647           var convGraph = new List<List<Tuple<double, double>>>();
    648           foreach (var run in problemRuns) {
    649             var current = new List<Tuple<double, double>>();
    650             var performanceGraph = ((IndexedDataTable<double>)run.Results["QualityPerEvaluations"]);
    651             current.AddRange(performanceGraph.Rows.First().Values.TakeWhile(v => v.Item1 < MaximumEvaluations.Value));
    652             if (current.Count > 0) {
    653               current.Add(Tuple.Create((double)MaximumEvaluations.Value, current.Last().Item2));
    654               convGraph.Add(current);
    655             }
    656           }
    657           var ert = ExpectedRuntimeHelper.CalculateErt(convGraph, (Maximization ? (1 - MinimumTarget.Value) : (1 + MinimumTarget.Value)) * info.Item2, Maximization).ExpectedRuntime;
    658           if (double.IsNaN(ert)) {
    659             ert = ExpectedRuntimeHelper.CalculateErt(problemRuns.ToList(), "QualityPerEvaluations", (Maximization ? (1 - MinimumTarget.Value) : (1 + MinimumTarget.Value)) * info.Item2, Maximization).ExpectedRuntime;
    660             if (double.IsNaN(ert)) ert = int.MaxValue;
    661           }
    662           avgERT += info.Item1 * ert;
    663         }
    664         avgERT /= sumPis;
    665         if (instances.ContainsKey(avgERT)) {
    666           avgERT += new System.Random().NextDouble();
    667         }
    668         instances.Add(avgERT, algorithm);
    669       }
    670 
    671       var instanceLadder = instances.Select(x => (IAlgorithm)x.Value.Clone()).ToList();
    672       suggestedInstances.Replace(instanceLadder);
    673     }
    674 
    675     private Dictionary<IRun, double> GetProblemDistances() {
     646        var problemRuns = relevantRuns.GroupBy(x => ((StringValue)x.Parameters["Problem Name"]).Value).ToList();
     647        var ds = new ModifiableDataset();
     648        ds.AddVariable("Problem Name", new List<string>());
     649        foreach (var pc in ProblemCharacteristics.CheckedItems)
     650          ds.AddVariable(pc.Value.Value, new List<double>());
     651        ds.AddVariable("ERT", new List<double>());
     652        var max = Maximization;
     653        foreach (var pr in problemRuns) {
     654          var prob = problemMap[pr.Key];
     655          var features = characteristics[prob];
     656          var bkq = ((DoubleValue)prob.Parameters["BestKnownQuality"]).Value;
     657          var ert = ExpectedRuntimeHelper.CalculateErt(pr.ToList(), "QualityPerEvaluations", GetTarget(bkq), max).ExpectedRuntime;
     658          if (double.IsNaN(ert)) ert = int.MaxValue;
     659          ds.AddRow(new object[] { pr.Key }.Concat(features.Cast<object>()).Concat(new object[] { ert }));
     660        }
     661        var datAnalysisData = new RegressionProblemData(ds, ProblemCharacteristics.CheckedItems.Select(x => x.Value.Value), "ERT");
     662        var result = new RegressionProblem() {
     663          Name = algorithmId2AlgorithmInstanceMapping.GetByFirst(relevantRuns.Key).Name
     664        };
     665        result.ProblemDataParameter.Value = datAnalysisData;
     666        yield return result;
     667      }
     668    }
     669
     670    private double GetTarget(double bestKnownQuality) {
     671      return bestKnownQuality * (Maximization ? (1 - MinimumTarget.Value) : (1 + MinimumTarget.Value));
     672    }
     673
     674    public Dictionary<IRun, double> GetProblemDistances(ProblemInstanceProximityType proximityType) {
    676675      var result = new Dictionary<IRun, double>();
    677676      var currentInstance = problemId2ProblemInstanceMapping.GetByFirst(Problem.ProblemId);
    678       switch (ProblemInstanceProximity.Value) {
     677      switch (proximityType) {
    679678        case ProblemInstanceProximityType.MDS:
    680679        case ProblemInstanceProximityType.PCA:
    681680        case ProblemInstanceProximityType.SOM:
    682681          double xa, ya;
    683           GetProjectionCoordinates(currentInstance, out xa, out ya);
     682          GetProjectionCoordinates(currentInstance, proximityType, out xa, out ya);
    684683          foreach (var b in ProblemInstances) {
     684            if (b == currentInstance) continue;
    685685            double xb, yb;
    686             GetProjectionCoordinates(b, out xb, out yb);
     686            GetProjectionCoordinates(b, proximityType, out xb, out yb);
    687687            var d = Math.Sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
    688688            result[b] = d;
     
    693693          var cF = features[currentInstance];
    694694          foreach (var b in ProblemInstances) {
     695            if (b == currentInstance) continue;
    695696            var sum = features[b].Select((t, f) => (cF[f] - t) * (cF[f] - t)).Sum();
    696697            result[b] = Math.Sqrt(sum);
    697698          }
    698699          break;
    699         default: throw new InvalidOperationException(string.Format("Unkonwn proximity type {0}", ProblemInstanceProximity.Value));
     700        default: throw new InvalidOperationException(string.Format("Unkonwn proximity type {0}", proximityType));
    700701      }
    701702      return result;
    702703    }
    703704
    704     private void GetProjectionCoordinates(IRun problemInstance, out double x, out double y) {
    705       x = ((DoubleValue)problemInstance.Results["Projection." + ProblemInstanceProximity.Value + ".X"]).Value;
    706       y = ((DoubleValue)problemInstance.Results["Projection." + ProblemInstanceProximity.Value + ".Y"]).Value;
    707       if (ProblemInstanceProximity.Value == ProblemInstanceProximityType.SOM) {
     705    private void GetProjectionCoordinates(IRun problemInstance, ProblemInstanceProximityType proximityType, out double x, out double y) {
     706      x = ((DoubleValue)problemInstance.Results["Projection." + proximityType + ".X"]).Value;
     707      y = ((DoubleValue)problemInstance.Results["Projection." + proximityType + ".Y"]).Value;
     708      if (proximityType == ProblemInstanceProximityType.SOM) {
    708709        x = Math.Floor(x);
    709710        y = Math.Floor(y);
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Docking/AlgorithmControlForm.cs

    r13722 r13774  
    119119
    120120    #region Algorithm Events
    121     private void AlgorithmOnExecutionStateChanged(object sender, EventArgs eventArgs) {
     121    private void AlgorithmOnExecutionStateChanged(object sender, EventArgs e) {
     122      if (InvokeRequired) { Invoke((Action<object, EventArgs>)AlgorithmOnExecutionStateChanged, sender, e); return; }
    122123      if (ShowOnlyFinalResult && (Algorithm.ExecutionState == ExecutionState.Stopped
    123124        || Algorithm.ExecutionState == ExecutionState.Paused))
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Plugin.cs.frame

    r13722 r13774  
    2020#endregion
    2121
     22using HeuristicLab.Clients.Access;
     23using HeuristicLab.Common;
     24using HeuristicLab.Core;
     25using HeuristicLab.PluginInfrastructure;
    2226using System.Windows.Forms;
    23 using HeuristicLab.Clients.Access;
    24 using HeuristicLab.PluginInfrastructure;
    2527
    2628namespace HeuristicLab.OptimizationExpertSystem {
     
    5052      ClientInformation.InitializeAsync();
    5153      UserInformation.InitializeAsync();
    52 
     54      ContentManager.Initialize(new PersistenceContentManager());
    5355      mainForm.ShowContentInViewHost = true;
    5456      Application.Run(mainForm);
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterAllinOneView.cs

    r13751 r13774  
    7878    #region Event Registration
    7979    protected override void DeregisterContentEvents() {
    80       Content.SuggestedInstances.CollectionReset -= SuggestedInstancesOnChanged;
    81       Content.SuggestedInstances.ItemsAdded -= SuggestedInstancesOnChanged;
    82       Content.SuggestedInstances.ItemsMoved -= SuggestedInstancesOnChanged;
    83       Content.SuggestedInstances.ItemsRemoved -= SuggestedInstancesOnChanged;
    84       Content.SuggestedInstances.ItemsReplaced -= SuggestedInstancesOnChanged;
     80      Content.AlgorithmInstances.CollectionReset -= SuggestedInstancesOnChanged;
     81      Content.AlgorithmInstances.ItemsAdded -= SuggestedInstancesOnChanged;
     82      Content.AlgorithmInstances.ItemsMoved -= SuggestedInstancesOnChanged;
     83      Content.AlgorithmInstances.ItemsRemoved -= SuggestedInstancesOnChanged;
     84      Content.AlgorithmInstances.ItemsReplaced -= SuggestedInstancesOnChanged;
    8585      Content.SolutionSeedingPool.CollectionReset -= SeedingPoolOnChanged;
    8686      Content.SolutionSeedingPool.ItemsAdded -= SeedingPoolOnChanged;
     
    9494    protected override void RegisterContentEvents() {
    9595      base.RegisterContentEvents();
    96       Content.SuggestedInstances.CollectionReset += SuggestedInstancesOnChanged;
    97       Content.SuggestedInstances.ItemsAdded += SuggestedInstancesOnChanged;
    98       Content.SuggestedInstances.ItemsMoved += SuggestedInstancesOnChanged;
    99       Content.SuggestedInstances.ItemsRemoved += SuggestedInstancesOnChanged;
    100       Content.SuggestedInstances.ItemsReplaced += SuggestedInstancesOnChanged;
     96      Content.AlgorithmInstances.CollectionReset += SuggestedInstancesOnChanged;
     97      Content.AlgorithmInstances.ItemsAdded += SuggestedInstancesOnChanged;
     98      Content.AlgorithmInstances.ItemsMoved += SuggestedInstancesOnChanged;
     99      Content.AlgorithmInstances.ItemsRemoved += SuggestedInstancesOnChanged;
     100      Content.AlgorithmInstances.ItemsReplaced += SuggestedInstancesOnChanged;
    101101      Content.SolutionSeedingPool.CollectionReset += SeedingPoolOnChanged;
    102102      Content.SolutionSeedingPool.ItemsAdded += SeedingPoolOnChanged;
     
    248248    private void AlgorithmCloneButtonOnClick(object sender, EventArgs e) {
    249249      if (suggestedInstancesComboBox.SelectedIndex >= 0)
    250         MainFormManager.MainForm.ShowContent((IAlgorithm)Content.SuggestedInstances[suggestedInstancesComboBox.SelectedIndex].Clone());
     250        MainFormManager.MainForm.ShowContent((IAlgorithm)Content.AlgorithmInstances[suggestedInstancesComboBox.SelectedIndex].Clone());
    251251    }
    252252
     
    279279      if (InvokeRequired) { Invoke((Action<object, EventArgs>)SuggestedInstancesComboBoxOnSelectedIndexChanged, sender, e); return; }
    280280      if (suggestedInstancesComboBox.SelectedIndex >= 0) {
    281         var alg = Content.SuggestedInstances[suggestedInstancesComboBox.SelectedIndex];
     281        var alg = Content.AlgorithmInstances[suggestedInstancesComboBox.SelectedIndex];
    282282        solverParametersView.Content = alg.Parameters;
    283283        var engineAlg = alg as EngineAlgorithm;
     
    328328      if (Content == null) return;
    329329
    330       for (var i = 0; i < Content.SuggestedInstances.Count; i++) {
    331         suggestedInstancesComboBox.Items.Add(Content.SuggestedInstances[i]);
    332         if (prevSelection == null || Content.SuggestedInstances[i].Name == prevSelection.Name)
     330      for (var i = 0; i < Content.AlgorithmInstances.Count; i++) {
     331        suggestedInstancesComboBox.Items.Add(Content.AlgorithmInstances[i]);
     332        if (prevSelection == null || Content.AlgorithmInstances[i].Name == prevSelection.Name)
    333333          prevNewIndex = prevSelection == null ? 0 : i;
    334334      }
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/KnowledgeCenterViewBase.cs

    r13752 r13774  
    8888
    8989    private void RegisterContentSuggestedInstancesEvents() {
    90       Content.SuggestedInstances.CollectionReset += ContentOnSuggestedInstancesChanged;
    91       Content.SuggestedInstances.ItemsAdded += ContentOnSuggestedInstancesChanged;
    92       Content.SuggestedInstances.ItemsMoved += ContentOnSuggestedInstancesChanged;
    93       Content.SuggestedInstances.ItemsRemoved += ContentOnSuggestedInstancesChanged;
    94       Content.SuggestedInstances.ItemsReplaced += ContentOnSuggestedInstancesChanged;
     90      Content.AlgorithmInstances.CollectionReset += ContentOnSuggestedInstancesChanged;
     91      Content.AlgorithmInstances.ItemsAdded += ContentOnSuggestedInstancesChanged;
     92      Content.AlgorithmInstances.ItemsMoved += ContentOnSuggestedInstancesChanged;
     93      Content.AlgorithmInstances.ItemsRemoved += ContentOnSuggestedInstancesChanged;
     94      Content.AlgorithmInstances.ItemsReplaced += ContentOnSuggestedInstancesChanged;
    9595    }
    9696
     
    139139
    140140    private void DeregisterContentSuggestedInstancesEvents() {
    141       Content.SuggestedInstances.CollectionReset -= ContentOnSuggestedInstancesChanged;
    142       Content.SuggestedInstances.ItemsAdded -= ContentOnSuggestedInstancesChanged;
    143       Content.SuggestedInstances.ItemsMoved -= ContentOnSuggestedInstancesChanged;
    144       Content.SuggestedInstances.ItemsRemoved -= ContentOnSuggestedInstancesChanged;
    145       Content.SuggestedInstances.ItemsReplaced -= ContentOnSuggestedInstancesChanged;
     141      Content.AlgorithmInstances.CollectionReset -= ContentOnSuggestedInstancesChanged;
     142      Content.AlgorithmInstances.ItemsAdded -= ContentOnSuggestedInstancesChanged;
     143      Content.AlgorithmInstances.ItemsMoved -= ContentOnSuggestedInstancesChanged;
     144      Content.AlgorithmInstances.ItemsRemoved -= ContentOnSuggestedInstancesChanged;
     145      Content.AlgorithmInstances.ItemsReplaced -= ContentOnSuggestedInstancesChanged;
    146146    }
    147147    #endregion
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.Designer.cs

    r13759 r13774  
    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();
     47      WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin2 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
     48      WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin2 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
     49      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient4 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     50      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient8 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     51      WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
     52      WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
     53      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient9 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     54      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient5 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     55      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient10 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     56      WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
     57      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient11 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     58      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient12 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     59      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient6 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     60      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient13 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     61      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient14 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
    6262      this.minTargetView = new HeuristicLab.Data.Views.StringConvertibleValueView();
    6363      this.maxEvaluationsView = new HeuristicLab.Data.Views.StringConvertibleValueView();
     
    8181      this.seedingStrategyLabel = new System.Windows.Forms.Label();
    8282      this.evaluationsLimitabel = new System.Windows.Forms.Label();
    83       this.algorithmSuggestionLabel = new System.Windows.Forms.Label();
     83      this.recommenderLabel = new System.Windows.Forms.Label();
    8484      this.suggestedInstancesComboBox = new System.Windows.Forms.ComboBox();
     85      this.recommenderComboBox = new System.Windows.Forms.ComboBox();
     86      this.solverSplitContainer = new System.Windows.Forms.SplitContainer();
     87      this.recommenderViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     88      this.instanceLabel = new System.Windows.Forms.Label();
     89      this.recommendRefreshButton = new System.Windows.Forms.Button();
    8590      this.solverTabControl.SuspendLayout();
    8691      this.resultsTabPage.SuspendLayout();
     
    8994      this.parametersTabPage.SuspendLayout();
    9095      this.operatorGraphTabPage.SuspendLayout();
     96      ((System.ComponentModel.ISupportInitialize)(this.solverSplitContainer)).BeginInit();
     97      this.solverSplitContainer.Panel1.SuspendLayout();
     98      this.solverSplitContainer.Panel2.SuspendLayout();
     99      this.solverSplitContainer.SuspendLayout();
    91100      this.SuspendLayout();
    92101      //
     
    115124      // algorithmCloneButton
    116125      //
    117       this.algorithmCloneButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    118       this.algorithmCloneButton.Location = new System.Drawing.Point(823, 56);
     126      this.algorithmCloneButton.Location = new System.Drawing.Point(123, 60);
    119127      this.algorithmCloneButton.Name = "algorithmCloneButton";
    120128      this.algorithmCloneButton.Size = new System.Drawing.Size(26, 23);
     
    136144      //
    137145      this.solverTabControl.AllowDrop = true;
    138       this.solverTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    139             | System.Windows.Forms.AnchorStyles.Left)
    140             | System.Windows.Forms.AnchorStyles.Right)));
    141146      this.solverTabControl.Controls.Add(this.resultsTabPage);
    142147      this.solverTabControl.Controls.Add(this.runsTabPage);
     
    145150      this.solverTabControl.Controls.Add(this.parametersTabPage);
    146151      this.solverTabControl.Controls.Add(this.operatorGraphTabPage);
    147       this.solverTabControl.Location = new System.Drawing.Point(0, 84);
     152      this.solverTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
     153      this.solverTabControl.Location = new System.Drawing.Point(3, 3);
    148154      this.solverTabControl.Name = "solverTabControl";
    149155      this.solverTabControl.SelectedIndex = 0;
    150       this.solverTabControl.Size = new System.Drawing.Size(849, 480);
     156      this.solverTabControl.Size = new System.Drawing.Size(556, 502);
    151157      this.solverTabControl.TabIndex = 11;
    152158      //
     
    158164      this.resultsTabPage.Name = "resultsTabPage";
    159165      this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3);
    160       this.resultsTabPage.Size = new System.Drawing.Size(841, 454);
     166      this.resultsTabPage.Size = new System.Drawing.Size(548, 476);
    161167      this.resultsTabPage.TabIndex = 2;
    162168      this.resultsTabPage.Text = "Results";
     
    166172      //
    167173      this.showOnlyFinalResultCheckBox.AutoSize = true;
     174      this.showOnlyFinalResultCheckBox.Checked = true;
     175      this.showOnlyFinalResultCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
    168176      this.showOnlyFinalResultCheckBox.Location = new System.Drawing.Point(6, 6);
    169177      this.showOnlyFinalResultCheckBox.Name = "showOnlyFinalResultCheckBox";
     
    181189      this.resultsDockPanel.Location = new System.Drawing.Point(3, 29);
    182190      this.resultsDockPanel.Name = "resultsDockPanel";
    183       this.resultsDockPanel.Size = new System.Drawing.Size(835, 422);
    184       dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
    185       dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
    186       autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
    187       tabGradient1.EndColor = System.Drawing.SystemColors.Control;
    188       tabGradient1.StartColor = System.Drawing.SystemColors.Control;
    189       tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark;
    190       autoHideStripSkin1.TabGradient = tabGradient1;
    191       autoHideStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F);
    192       dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
    193       tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight;
    194       tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight;
    195       tabGradient2.TextColor = System.Drawing.SystemColors.ControlText;
    196       dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
    197       dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control;
    198       dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control;
    199       dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
    200       tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
    201       tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
    202       tabGradient3.TextColor = System.Drawing.SystemColors.ControlText;
    203       dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
    204       dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
    205       dockPaneStripSkin1.TextFont = new System.Drawing.Font("Segoe UI", 9F);
    206       tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption;
    207       tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    208       tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
    209       tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
    210       dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
    211       tabGradient5.EndColor = System.Drawing.SystemColors.Control;
    212       tabGradient5.StartColor = System.Drawing.SystemColors.Control;
    213       tabGradient5.TextColor = System.Drawing.SystemColors.ControlText;
    214       dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
    215       dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
    216       dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
    217       dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
    218       tabGradient6.EndColor = System.Drawing.SystemColors.InactiveCaption;
    219       tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    220       tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
    221       tabGradient6.TextColor = System.Drawing.SystemColors.InactiveCaptionText;
    222       dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
    223       tabGradient7.EndColor = System.Drawing.Color.Transparent;
    224       tabGradient7.StartColor = System.Drawing.Color.Transparent;
    225       tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark;
    226       dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
    227       dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
    228       dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
    229       this.resultsDockPanel.Skin = dockPanelSkin1;
     191      this.resultsDockPanel.Size = new System.Drawing.Size(542, 444);
     192      dockPanelGradient4.EndColor = System.Drawing.SystemColors.ControlLight;
     193      dockPanelGradient4.StartColor = System.Drawing.SystemColors.ControlLight;
     194      autoHideStripSkin2.DockStripGradient = dockPanelGradient4;
     195      tabGradient8.EndColor = System.Drawing.SystemColors.Control;
     196      tabGradient8.StartColor = System.Drawing.SystemColors.Control;
     197      tabGradient8.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     198      autoHideStripSkin2.TabGradient = tabGradient8;
     199      autoHideStripSkin2.TextFont = new System.Drawing.Font("Segoe UI", 9F);
     200      dockPanelSkin2.AutoHideStripSkin = autoHideStripSkin2;
     201      tabGradient9.EndColor = System.Drawing.SystemColors.ControlLightLight;
     202      tabGradient9.StartColor = System.Drawing.SystemColors.ControlLightLight;
     203      tabGradient9.TextColor = System.Drawing.SystemColors.ControlText;
     204      dockPaneStripGradient2.ActiveTabGradient = tabGradient9;
     205      dockPanelGradient5.EndColor = System.Drawing.SystemColors.Control;
     206      dockPanelGradient5.StartColor = System.Drawing.SystemColors.Control;
     207      dockPaneStripGradient2.DockStripGradient = dockPanelGradient5;
     208      tabGradient10.EndColor = System.Drawing.SystemColors.ControlLight;
     209      tabGradient10.StartColor = System.Drawing.SystemColors.ControlLight;
     210      tabGradient10.TextColor = System.Drawing.SystemColors.ControlText;
     211      dockPaneStripGradient2.InactiveTabGradient = tabGradient10;
     212      dockPaneStripSkin2.DocumentGradient = dockPaneStripGradient2;
     213      dockPaneStripSkin2.TextFont = new System.Drawing.Font("Segoe UI", 9F);
     214      tabGradient11.EndColor = System.Drawing.SystemColors.ActiveCaption;
     215      tabGradient11.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     216      tabGradient11.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
     217      tabGradient11.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
     218      dockPaneStripToolWindowGradient2.ActiveCaptionGradient = tabGradient11;
     219      tabGradient12.EndColor = System.Drawing.SystemColors.Control;
     220      tabGradient12.StartColor = System.Drawing.SystemColors.Control;
     221      tabGradient12.TextColor = System.Drawing.SystemColors.ControlText;
     222      dockPaneStripToolWindowGradient2.ActiveTabGradient = tabGradient12;
     223      dockPanelGradient6.EndColor = System.Drawing.SystemColors.ControlLight;
     224      dockPanelGradient6.StartColor = System.Drawing.SystemColors.ControlLight;
     225      dockPaneStripToolWindowGradient2.DockStripGradient = dockPanelGradient6;
     226      tabGradient13.EndColor = System.Drawing.SystemColors.InactiveCaption;
     227      tabGradient13.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     228      tabGradient13.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
     229      tabGradient13.TextColor = System.Drawing.SystemColors.InactiveCaptionText;
     230      dockPaneStripToolWindowGradient2.InactiveCaptionGradient = tabGradient13;
     231      tabGradient14.EndColor = System.Drawing.Color.Transparent;
     232      tabGradient14.StartColor = System.Drawing.Color.Transparent;
     233      tabGradient14.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     234      dockPaneStripToolWindowGradient2.InactiveTabGradient = tabGradient14;
     235      dockPaneStripSkin2.ToolWindowGradient = dockPaneStripToolWindowGradient2;
     236      dockPanelSkin2.DockPaneStripSkin = dockPaneStripSkin2;
     237      this.resultsDockPanel.Skin = dockPanelSkin2;
    230238      this.resultsDockPanel.TabIndex = 0;
    231239      //
     
    236244      this.runsTabPage.Name = "runsTabPage";
    237245      this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
    238       this.runsTabPage.Size = new System.Drawing.Size(841, 454);
     246      this.runsTabPage.Size = new System.Drawing.Size(548, 476);
    239247      this.runsTabPage.TabIndex = 4;
    240248      this.runsTabPage.Text = "Runs";
     
    249257      this.runsView.Name = "runsView";
    250258      this.runsView.ReadOnly = false;
    251       this.runsView.Size = new System.Drawing.Size(835, 448);
     259      this.runsView.Size = new System.Drawing.Size(542, 470);
    252260      this.runsView.TabIndex = 0;
    253261      //
     
    258266      this.seededRunsTabPage.Name = "seededRunsTabPage";
    259267      this.seededRunsTabPage.Padding = new System.Windows.Forms.Padding(3);
    260       this.seededRunsTabPage.Size = new System.Drawing.Size(841, 454);
     268      this.seededRunsTabPage.Size = new System.Drawing.Size(548, 476);
    261269      this.seededRunsTabPage.TabIndex = 5;
    262270      this.seededRunsTabPage.Text = "Seeded Runs";
     
    271279      this.seededRunsView.Name = "seededRunsView";
    272280      this.seededRunsView.ReadOnly = false;
    273       this.seededRunsView.Size = new System.Drawing.Size(835, 448);
     281      this.seededRunsView.Size = new System.Drawing.Size(542, 470);
    274282      this.seededRunsView.TabIndex = 1;
    275283      //
     
    279287      this.solutionSeedingTabPage.Name = "solutionSeedingTabPage";
    280288      this.solutionSeedingTabPage.Padding = new System.Windows.Forms.Padding(3);
    281       this.solutionSeedingTabPage.Size = new System.Drawing.Size(841, 454);
     289      this.solutionSeedingTabPage.Size = new System.Drawing.Size(548, 476);
    282290      this.solutionSeedingTabPage.TabIndex = 1;
    283291      this.solutionSeedingTabPage.Text = "Seeding Pool";
     
    290298      this.parametersTabPage.Name = "parametersTabPage";
    291299      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    292       this.parametersTabPage.Size = new System.Drawing.Size(841, 454);
     300      this.parametersTabPage.Size = new System.Drawing.Size(548, 476);
    293301      this.parametersTabPage.TabIndex = 0;
    294302      this.parametersTabPage.Text = "Parameters";
     
    305313      this.solverParametersView.ReadOnly = true;
    306314      this.solverParametersView.ShowDetails = true;
    307       this.solverParametersView.Size = new System.Drawing.Size(835, 448);
     315      this.solverParametersView.Size = new System.Drawing.Size(542, 470);
    308316      this.solverParametersView.TabIndex = 0;
    309317      //
     
    314322      this.operatorGraphTabPage.Name = "operatorGraphTabPage";
    315323      this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3);
    316       this.operatorGraphTabPage.Size = new System.Drawing.Size(841, 454);
     324      this.operatorGraphTabPage.Size = new System.Drawing.Size(548, 476);
    317325      this.operatorGraphTabPage.TabIndex = 3;
    318326      this.operatorGraphTabPage.Text = "Operator Graph";
     
    328336      this.operatorGraphViewHost.Name = "operatorGraphViewHost";
    329337      this.operatorGraphViewHost.ReadOnly = true;
    330       this.operatorGraphViewHost.Size = new System.Drawing.Size(835, 448);
     338      this.operatorGraphViewHost.Size = new System.Drawing.Size(542, 470);
    331339      this.operatorGraphViewHost.TabIndex = 0;
    332340      this.operatorGraphViewHost.ViewsLabelVisible = true;
     
    335343      // algorithmStartButton
    336344      //
    337       this.algorithmStartButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    338       this.algorithmStartButton.Location = new System.Drawing.Point(791, 55);
     345      this.algorithmStartButton.Location = new System.Drawing.Point(91, 60);
    339346      this.algorithmStartButton.Name = "algorithmStartButton";
    340347      this.algorithmStartButton.Size = new System.Drawing.Size(26, 23);
     
    371378      this.evaluationsLimitabel.Text = "Budget (FE):";
    372379      //
    373       // algorithmSuggestionLabel
    374       //
    375       this.algorithmSuggestionLabel.AutoSize = true;
    376       this.algorithmSuggestionLabel.Location = new System.Drawing.Point(3, 59);
    377       this.algorithmSuggestionLabel.Name = "algorithmSuggestionLabel";
    378       this.algorithmSuggestionLabel.Size = new System.Drawing.Size(99, 13);
    379       this.algorithmSuggestionLabel.TabIndex = 9;
    380       this.algorithmSuggestionLabel.Text = "Suggested Solvers:";
     380      // recommenderLabel
     381      //
     382      this.recommenderLabel.AutoSize = true;
     383      this.recommenderLabel.Location = new System.Drawing.Point(6, 9);
     384      this.recommenderLabel.Name = "recommenderLabel";
     385      this.recommenderLabel.Size = new System.Drawing.Size(79, 13);
     386      this.recommenderLabel.TabIndex = 9;
     387      this.recommenderLabel.Text = "Recommender:";
    381388      //
    382389      // suggestedInstancesComboBox
     
    386393      this.suggestedInstancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    387394      this.suggestedInstancesComboBox.FormattingEnabled = true;
    388       this.suggestedInstancesComboBox.Location = new System.Drawing.Point(108, 56);
     395      this.suggestedInstancesComboBox.Location = new System.Drawing.Point(91, 33);
    389396      this.suggestedInstancesComboBox.Name = "suggestedInstancesComboBox";
    390       this.suggestedInstancesComboBox.Size = new System.Drawing.Size(677, 21);
     397      this.suggestedInstancesComboBox.Size = new System.Drawing.Size(186, 21);
    391398      this.suggestedInstancesComboBox.TabIndex = 7;
    392399      this.suggestedInstancesComboBox.SelectedIndexChanged += new System.EventHandler(this.SuggestedInstancesComboBoxOnSelectedIndexChanged);
    393400      //
     401      // recommenderComboBox
     402      //
     403      this.recommenderComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     404            | System.Windows.Forms.AnchorStyles.Right)));
     405      this.recommenderComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     406      this.recommenderComboBox.FormattingEnabled = true;
     407      this.recommenderComboBox.Location = new System.Drawing.Point(91, 6);
     408      this.recommenderComboBox.Name = "recommenderComboBox";
     409      this.recommenderComboBox.Size = new System.Drawing.Size(154, 21);
     410      this.recommenderComboBox.TabIndex = 7;
     411      this.recommenderComboBox.SelectedIndexChanged += new System.EventHandler(this.RecommenderComboBoxOnSelectedIndexChanged);
     412      //
     413      // solverSplitContainer
     414      //
     415      this.solverSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     416            | System.Windows.Forms.AnchorStyles.Left)
     417            | System.Windows.Forms.AnchorStyles.Right)));
     418      this.solverSplitContainer.Location = new System.Drawing.Point(0, 56);
     419      this.solverSplitContainer.Name = "solverSplitContainer";
     420      //
     421      // solverSplitContainer.Panel1
     422      //
     423      this.solverSplitContainer.Panel1.Controls.Add(this.recommenderViewHost);
     424      this.solverSplitContainer.Panel1.Controls.Add(this.instanceLabel);
     425      this.solverSplitContainer.Panel1.Controls.Add(this.recommenderLabel);
     426      this.solverSplitContainer.Panel1.Controls.Add(this.recommenderComboBox);
     427      this.solverSplitContainer.Panel1.Controls.Add(this.algorithmCloneButton);
     428      this.solverSplitContainer.Panel1.Controls.Add(this.suggestedInstancesComboBox);
     429      this.solverSplitContainer.Panel1.Controls.Add(this.recommendRefreshButton);
     430      this.solverSplitContainer.Panel1.Controls.Add(this.algorithmStartButton);
     431      this.solverSplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(3);
     432      //
     433      // solverSplitContainer.Panel2
     434      //
     435      this.solverSplitContainer.Panel2.Controls.Add(this.solverTabControl);
     436      this.solverSplitContainer.Panel2.Padding = new System.Windows.Forms.Padding(3);
     437      this.solverSplitContainer.Size = new System.Drawing.Size(849, 508);
     438      this.solverSplitContainer.SplitterDistance = 283;
     439      this.solverSplitContainer.TabIndex = 17;
     440      //
     441      // recommenderViewHost
     442      //
     443      this.recommenderViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     444            | System.Windows.Forms.AnchorStyles.Left)
     445            | System.Windows.Forms.AnchorStyles.Right)));
     446      this.recommenderViewHost.Caption = "View";
     447      this.recommenderViewHost.Content = null;
     448      this.recommenderViewHost.Enabled = false;
     449      this.recommenderViewHost.Location = new System.Drawing.Point(6, 89);
     450      this.recommenderViewHost.Name = "recommenderViewHost";
     451      this.recommenderViewHost.ReadOnly = false;
     452      this.recommenderViewHost.Size = new System.Drawing.Size(271, 412);
     453      this.recommenderViewHost.TabIndex = 16;
     454      this.recommenderViewHost.ViewsLabelVisible = true;
     455      this.recommenderViewHost.ViewType = null;
     456      //
     457      // instanceLabel
     458      //
     459      this.instanceLabel.AutoSize = true;
     460      this.instanceLabel.Location = new System.Drawing.Point(6, 36);
     461      this.instanceLabel.Name = "instanceLabel";
     462      this.instanceLabel.Size = new System.Drawing.Size(51, 13);
     463      this.instanceLabel.TabIndex = 9;
     464      this.instanceLabel.Text = "Instance:";
     465      //
     466      // recommendRefreshButton
     467      //
     468      this.recommendRefreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     469      this.recommendRefreshButton.Location = new System.Drawing.Point(251, 6);
     470      this.recommendRefreshButton.Name = "recommendRefreshButton";
     471      this.recommendRefreshButton.Size = new System.Drawing.Size(26, 23);
     472      this.recommendRefreshButton.TabIndex = 10;
     473      this.recommendRefreshButton.Text = "Start";
     474      this.recommendRefreshButton.UseVisualStyleBackColor = true;
     475      this.recommendRefreshButton.Click += new System.EventHandler(this.button1_Click);
     476      //
    394477      // SolverView
    395478      //
    396479      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    397480      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     481      this.Controls.Add(this.solverSplitContainer);
    398482      this.Controls.Add(this.minTargetView);
    399483      this.Controls.Add(this.maxEvaluationsView);
    400       this.Controls.Add(this.algorithmCloneButton);
    401484      this.Controls.Add(this.seedingStrategyPanel);
    402       this.Controls.Add(this.solverTabControl);
    403       this.Controls.Add(this.algorithmStartButton);
    404485      this.Controls.Add(this.minimumTargetLabel);
    405486      this.Controls.Add(this.seedingStrategyLabel);
    406487      this.Controls.Add(this.evaluationsLimitabel);
    407       this.Controls.Add(this.algorithmSuggestionLabel);
    408       this.Controls.Add(this.suggestedInstancesComboBox);
    409488      this.Name = "SolverView";
    410489      this.Size = new System.Drawing.Size(849, 564);
     
    416495      this.parametersTabPage.ResumeLayout(false);
    417496      this.operatorGraphTabPage.ResumeLayout(false);
     497      this.solverSplitContainer.Panel1.ResumeLayout(false);
     498      this.solverSplitContainer.Panel1.PerformLayout();
     499      this.solverSplitContainer.Panel2.ResumeLayout(false);
     500      ((System.ComponentModel.ISupportInitialize)(this.solverSplitContainer)).EndInit();
     501      this.solverSplitContainer.ResumeLayout(false);
    418502      this.ResumeLayout(false);
    419503      this.PerformLayout();
     
    434518    private System.Windows.Forms.Label seedingStrategyLabel;
    435519    private System.Windows.Forms.Label evaluationsLimitabel;
    436     private System.Windows.Forms.Label algorithmSuggestionLabel;
     520    private System.Windows.Forms.Label recommenderLabel;
    437521    private System.Windows.Forms.ComboBox suggestedInstancesComboBox;
    438522    private System.Windows.Forms.Button algorithmCloneButton;
     
    446530    private System.Windows.Forms.Label minimumTargetLabel;
    447531    private Data.Views.StringConvertibleValueView minTargetView;
     532    private System.Windows.Forms.ComboBox recommenderComboBox;
     533    private System.Windows.Forms.SplitContainer solverSplitContainer;
     534    private MainForm.WindowsForms.ViewHost recommenderViewHost;
     535    private System.Windows.Forms.Label instanceLabel;
     536    private System.Windows.Forms.Button recommendRefreshButton;
    448537  }
    449538}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/Views/SolverView.cs

    r13759 r13774  
    4444      algorithmCloneButton.Text = string.Empty;
    4545      algorithmCloneButton.Image = VSImageLibrary.Clone;
     46      recommendRefreshButton.Text = string.Empty;
     47      recommendRefreshButton.Image = VSImageLibrary.Refresh;
    4648      seedingStrategyView = new EnumValueView<SeedingStrategyTypes>() {
    4749        Dock = DockStyle.Fill
     
    6668          seedingStrategyView.Content = null;
    6769          seedingSolutionsView.Content = null;
     70          recommenderViewHost.Content = null;
    6871        } else {
    6972          maxEvaluationsView.Content = Content.MaximumEvaluations;
     
    7376          seedingStrategyView.Content = Content.SeedingStrategy;
    7477          seedingSolutionsView.Content = Content.SolutionSeedingPool;
     78          recommenderViewHost.Content = Content.AlgorithmInstanceRecommender;
    7579        }
    7680      } finally { SuppressEvents = false; }
    7781      UpdateSuggestedInstancesCombobox();
     82      UpdateRecommenderCombobox();
    7883    }
    7984
     
    103108      if (Content == null) return;
    104109
    105       for (var i = 0; i < Content.SuggestedInstances.Count; i++) {
    106         suggestedInstancesComboBox.Items.Add(Content.SuggestedInstances[i]);
    107         if (prevSelection == null || Content.SuggestedInstances[i].Name == prevSelection.Name)
     110      for (var i = 0; i < Content.AlgorithmInstances.Count; i++) {
     111        suggestedInstancesComboBox.Items.Add(Content.AlgorithmInstances[i]);
     112        if (prevSelection == null || Content.AlgorithmInstances[i].Name == prevSelection.Name)
    108113          prevNewIndex = prevSelection == null ? 0 : i;
    109114      }
    110       if (prevNewIndex >= 0) {
    111         suggestedInstancesComboBox.SelectedIndex = prevNewIndex;
     115      if (prevNewIndex >= 0) suggestedInstancesComboBox.SelectedIndex = prevNewIndex;
     116    }
     117
     118    private void UpdateRecommenderCombobox() {
     119      var prevSelection = Content.AlgorithmInstanceRecommender;
     120      var prevNewIndex = -1;
     121      recommenderComboBox.Items.Clear();
     122      if (Content == null) return;
     123
     124      /*var i = 0;
     125      foreach (var type in ApplicationManager.Manager.GetTypes(typeof (IAlgorithmInstanceRecommender))) {
     126        var r = (IAlgorithmInstanceRecommender)Activator.CreateInstance(type, BindingFlags.CreateInstance, Content);
     127        recommenderComboBox.Items.Add(r);
     128        if (prevSelection == null || type == prevSelection.GetType())
     129          prevNewIndex = prevSelection == null ? 0 : i;
     130        i++;
    112131      }
     132      if (prevNewIndex >= 0) recommenderComboBox.SelectedIndex = prevNewIndex;*/
     133      recommenderComboBox.Items.Add(new OverallBestRecommender(Content));
     134      if (prevSelection is OverallBestRecommender) recommenderComboBox.SelectedIndex = recommenderComboBox.Items.Count - 1;
     135      recommenderComboBox.Items.Add(new KNearestNeighborRecommender(Content));
     136      if (prevSelection is KNearestNeighborRecommender) recommenderComboBox.SelectedIndex = recommenderComboBox.Items.Count - 1;
     137      recommenderComboBox.Items.Add(new DistanceWeightedRecommender(Content));
     138      if (prevSelection is DistanceWeightedRecommender) recommenderComboBox.SelectedIndex = recommenderComboBox.Items.Count - 1;
    113139    }
    114140
     
    120146    private void AlgorithmCloneButtonOnClick(object sender, EventArgs e) {
    121147      if (suggestedInstancesComboBox.SelectedIndex >= 0)
    122         MainForm.ShowContent((IAlgorithm)Content.SuggestedInstances[suggestedInstancesComboBox.SelectedIndex].Clone());
     148        MainForm.ShowContent((IAlgorithm)Content.AlgorithmInstances[suggestedInstancesComboBox.SelectedIndex].Clone());
    123149    }
    124150
     
    126152      if (InvokeRequired) { Invoke((Action<object, EventArgs>)SuggestedInstancesComboBoxOnSelectedIndexChanged, sender, e); return; }
    127153      if (suggestedInstancesComboBox.SelectedIndex >= 0) {
    128         var alg = Content.SuggestedInstances[suggestedInstancesComboBox.SelectedIndex];
     154        var alg = Content.AlgorithmInstances[suggestedInstancesComboBox.SelectedIndex];
    129155        solverParametersView.Content = alg.Parameters;
    130156        var engineAlg = alg as EngineAlgorithm;
     
    137163      SetEnabledStateOfControls();
    138164    }
     165
     166    private void RecommenderComboBoxOnSelectedIndexChanged(object sender, EventArgs e) {
     167      if (InvokeRequired) { Invoke((Action<object, EventArgs>)RecommenderComboBoxOnSelectedIndexChanged, sender, e); return; }
     168      if (recommenderComboBox.SelectedIndex < 0) return;
     169      Content.AlgorithmInstanceRecommender = (IAlgorithmInstanceRecommender)recommenderComboBox.SelectedItem;
     170      recommenderViewHost.Content = Content.AlgorithmInstanceRecommender;
     171      Content.UpdateSuggestions();
     172    }
     173
     174    private void button1_Click(object sender, EventArgs e) {
     175      Content.UpdateSuggestions();
     176    }
    139177  }
    140178}
Note: See TracChangeset for help on using the changeset viewer.