Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/16/15 17:04:35 (9 years ago)
Author:
abeham
Message:

#2457, #2431: updated from trunk, worked on okb connection for downloading knowledge base

Location:
branches/PerformanceComparison
Files:
4 added
39 edited
5 copied

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison

    • Property svn:ignore
      •  

        old new  
        22*.suo
        33*.user
         4.git
         5.gitignore
  • branches/PerformanceComparison/HeuristicLab.Analysis

  • branches/PerformanceComparison/HeuristicLab.Analysis.Views

  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame

    r12753 r13475  
    2626  /// Plugin class for HeuristicLab.Analysis.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Analysis.Views", "3.3.12.$WCREV$")]
     28  [Plugin("HeuristicLab.Analysis.Views", "3.3.13.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Properties/AssemblyInfo.cs.frame

    r12753 r13475  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Plugin.cs.frame

    r12831 r13475  
    2626  /// Plugin class for HeuristicLab.Analysis plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Analysis", "3.3.12.$WCREV$")]
     28  [Plugin("HeuristicLab.Analysis", "3.3.13.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Analysis-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/PopulationSimilarityAnalysis/PopulationSimilarityAnalyzer.cs

    r12076 r13475  
    3939  public class PopulationSimilarityAnalyzer : SingleSuccessorOperator, IAnalyzer, ISimilarityBasedOperator {
    4040    private const string DiversityResultNameParameterName = "DiversityResultsName";
     41    private const string ExecuteInParallelParameterName = "ExecuteInParallel";
     42    private const string MaxDegreeOfParallelismParameterName = "MaxDegreeOfParallelism";
    4143
    4244    #region Backwards compatible code, remove with 3.4
     
    7173      get { return (FixedValueParameter<StringValue>)Parameters[DiversityResultNameParameterName]; }
    7274    }
     75    public IFixedValueParameter<BoolValue> ExecuteInParallelParameter {
     76      get { return (IFixedValueParameter<BoolValue>)Parameters[ExecuteInParallelParameterName]; }
     77    }
     78    public IFixedValueParameter<IntValue> MaxDegreeOfParallelismParameter {
     79      get { return (IFixedValueParameter<IntValue>)Parameters[MaxDegreeOfParallelismParameterName]; }
     80    }
    7381
    7482    public string DiversityResultName {
     
    7785    }
    7886
     87    public bool ExecuteInParallel {
     88      get { return ExecuteInParallelParameter.Value.Value; }
     89      set { ExecuteInParallelParameter.Value.Value = value; }
     90    }
     91
     92    public int MaxDegreeOfParallelism {
     93      get { return MaxDegreeOfParallelismParameter.Value.Value; }
     94      set { MaxDegreeOfParallelismParameter.Value.Value = value; }
     95    }
     96
    7997    [StorableConstructor]
    8098    protected PopulationSimilarityAnalyzer(bool deserializing) : base(deserializing) { }
    81     protected PopulationSimilarityAnalyzer(PopulationSimilarityAnalyzer original, Cloner cloner) : base(original, cloner) { }
     99
     100    protected PopulationSimilarityAnalyzer(PopulationSimilarityAnalyzer original, Cloner cloner)
     101      : base(original, cloner) {
     102      RegisterParametersEventHandlers();
     103    }
     104
    82105    public PopulationSimilarityAnalyzer(IEnumerable<ISolutionSimilarityCalculator> validSimilarityCalculators)
    83106      : base() {
     
    89112      Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the operator was called since the last update.", "PopulationDiversityAnalyzerUpdateCounter"));
    90113      Parameters.Add(new FixedValueParameter<StringValue>(DiversityResultNameParameterName, "Specifies how the diversity results should be named.", new StringValue("PopulationDiversity")));
     114      Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName, "Specifies whether similarity calculations should be parallelized.", new BoolValue(false)));
     115      Parameters.Add(new FixedValueParameter<IntValue>(MaxDegreeOfParallelismParameterName, "Specifies the maximum number of threads when calculating similarities in parallel.", new IntValue(-1)));
    91116
    92117      var similarityCalculators = SimilarityCalculatorParameter.ValidValues;
    93       foreach (var sc in validSimilarityCalculators)
     118      foreach (var sc in validSimilarityCalculators) {
    94119        similarityCalculators.Add(sc);
    95 
     120      }
    96121
    97122      ResultsParameter.Hidden = true;
    98123      UpdateCounterParameter.Hidden = true;
     124      ExecuteInParallelParameter.Hidden = true;
     125      MaxDegreeOfParallelismParameter.Hidden = true;
     126
     127      RegisterParametersEventHandlers();
     128    }
     129
     130    private void RegisterParametersEventHandlers() {
     131      ExecuteInParallelParameter.Value.ValueChanged += Value_ValueChanged;
     132      MaxDegreeOfParallelismParameter.Value.ValueChanged += Value_ValueChanged;
     133    }
     134
     135    private void Value_ValueChanged(object sender, EventArgs e) {
     136      var similarityCalculators = SimilarityCalculatorParameter.ValidValues;
     137      foreach (var similarityCalculator in similarityCalculators) {
     138        similarityCalculator.ExecuteInParallel = ExecuteInParallel;
     139        similarityCalculator.MaxDegreeOfParallelism = MaxDegreeOfParallelism;
     140      }
    99141    }
    100142
     
    113155        Parameters.Add(new ConstrainedValueParameter<ISolutionSimilarityCalculator>("SimilarityCalculator", "The similarity calculator that should be used to calculate solution similarity."));
    114156
    115       SimilarityCalculatorParameter.ValidValues.Add(oldSimilarityCalculator);
     157      if (oldSimilarityCalculator != null)
     158        SimilarityCalculatorParameter.ValidValues.Add(oldSimilarityCalculator);
     159
     160      if (!Parameters.ContainsKey(ExecuteInParallelParameterName)) {
     161        Parameters.Add(new FixedValueParameter<BoolValue>(ExecuteInParallelParameterName,
     162          "Specifies whether similarity calculations should be parallelized.", new BoolValue(false)));
     163        ExecuteInParallelParameter.Hidden = true;
     164      }
     165      if (!Parameters.ContainsKey(MaxDegreeOfParallelismParameterName)) {
     166        Parameters.Add(new FixedValueParameter<IntValue>(MaxDegreeOfParallelismParameterName,
     167          "Specifies the maximum number of threads when calculating similarities in parallel.", new IntValue(-1)));
     168        MaxDegreeOfParallelismParameter.Hidden = true;
     169      }
     170
     171      RegisterParametersEventHandlers();
    116172      #endregion
    117173    }
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Properties/AssemblyInfo.cs.frame

    r12753 r13475  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
  • branches/PerformanceComparison/HeuristicLab.Optimization

  • branches/PerformanceComparison/HeuristicLab.Optimization.Views

  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.Designer.cs

    r12012 r13475  
    5050      this.engineViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5151      this.operatorGraphTabPage = new System.Windows.Forms.TabPage();
    52       this.openOperatorGraphButton = new System.Windows.Forms.Button();
    53       this.newOperatorGraphButton = new System.Windows.Forms.Button();
    54       this.operatorGraphViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     52      this.operatorGraphViewHost = new HeuristicLab.Core.Views.BreadcrumbViewHost();
    5553      this.tabControl.SuspendLayout();
    5654      this.parametersTabPage.SuspendLayout();
     
    219217      // operatorGraphTabPage
    220218      //
    221       this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);
    222       this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);
    223219      this.operatorGraphTabPage.Controls.Add(this.operatorGraphViewHost);
    224220      this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22);
     
    229225      this.operatorGraphTabPage.UseVisualStyleBackColor = true;
    230226      //
    231       // openOperatorGraphButton
    232       //
    233       this.openOperatorGraphButton.Enabled = false;
    234       this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
    235       this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3);
    236       this.openOperatorGraphButton.Name = "openOperatorGraphButton";
    237       this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
    238       this.openOperatorGraphButton.TabIndex = 1;
    239       this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");
    240       this.openOperatorGraphButton.UseVisualStyleBackColor = true;
    241       //
    242       // newOperatorGraphButton
    243       //
    244       this.newOperatorGraphButton.Enabled = false;
    245       this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
    246       this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3);
    247       this.newOperatorGraphButton.Name = "newOperatorGraphButton";
    248       this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
    249       this.newOperatorGraphButton.TabIndex = 1;
    250       this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");
    251       this.newOperatorGraphButton.UseVisualStyleBackColor = true;
    252       //
    253227      // operatorGraphViewHost
    254228      //
     
    258232      this.operatorGraphViewHost.Caption = "View";
    259233      this.operatorGraphViewHost.Content = null;
     234      this.operatorGraphViewHost.EnableBreadcrumbs = true;
    260235      this.operatorGraphViewHost.Enabled = false;
    261       this.operatorGraphViewHost.Location = new System.Drawing.Point(3, 33);
     236      this.operatorGraphViewHost.Location = new System.Drawing.Point(6, 6);
    262237      this.operatorGraphViewHost.Name = "operatorGraphViewHost";
    263238      this.operatorGraphViewHost.ReadOnly = true;
    264       this.operatorGraphViewHost.Size = new System.Drawing.Size(699, 431);
     239      this.operatorGraphViewHost.ShowSingle = true;
     240      this.operatorGraphViewHost.Size = new System.Drawing.Size(693, 455);
    265241      this.operatorGraphViewHost.TabIndex = 0;
    266242      this.operatorGraphViewHost.ViewsLabelVisible = true;
     
    295271    protected HeuristicLab.MainForm.WindowsForms.ViewHost engineViewHost;
    296272    protected System.Windows.Forms.TabPage operatorGraphTabPage;
    297     protected HeuristicLab.MainForm.WindowsForms.ViewHost operatorGraphViewHost;
    298     protected System.Windows.Forms.Button openOperatorGraphButton;
    299     protected System.Windows.Forms.Button newOperatorGraphButton;
     273    protected HeuristicLab.Core.Views.BreadcrumbViewHost operatorGraphViewHost;
    300274
    301275  }
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs

    r12012 r13475  
    9595      base.SetEnabledStateOfControls();
    9696      engineViewHost.Enabled = Content != null;
    97       newOperatorGraphButton.Enabled = false;
    98       openOperatorGraphButton.Enabled = false;
    9997      operatorGraphViewHost.Enabled = Content != null;
    10098      operatorGraphViewHost.ReadOnly = true;
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs

    r12012 r13475  
    5151      this.CollapseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5252      this.CollapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    53       this.EditNodeLabelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    5453      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5554      this.optimizersGroupBox.SuspendLayout();
     
    165164      this.treeView.ImageIndex = 0;
    166165      this.treeView.ImageList = this.imageList;
    167       this.treeView.LabelEdit = true;
     166      this.treeView.LabelEdit = false;
    168167      this.treeView.Location = new System.Drawing.Point(4, 34);
    169168      this.treeView.Name = "optimizerTreeView";
     
    220219      //
    221220      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    222             this.EditNodeLabelToolStripMenuItem,
    223221            this.ExpandToolStripMenuItem,
    224222            this.ExpandAllToolStripMenuItem,
     
    255253      this.CollapseAllToolStripMenuItem.Text = "Collapse All";
    256254      this.CollapseAllToolStripMenuItem.Click += new System.EventHandler(this.CollapseAllToolStripMenuItem_Click);
    257       //
    258       // EditNodeLabelToolStripMenuItem
    259       //
    260       this.EditNodeLabelToolStripMenuItem.Name = "EditNodeLabelToolStripMenuItem";
    261       this.EditNodeLabelToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
    262       this.EditNodeLabelToolStripMenuItem.Text = "Edit Name";
    263       this.EditNodeLabelToolStripMenuItem.Click += new System.EventHandler(this.EditNodeLabelToolStripMenuItem_Click);
    264255
    265256      //
     
    300291    private System.Windows.Forms.ToolStripMenuItem CollapseToolStripMenuItem;
    301292    private System.Windows.Forms.ToolStripMenuItem CollapseAllToolStripMenuItem;
    302     private System.Windows.Forms.ToolStripMenuItem EditNodeLabelToolStripMenuItem;
    303293
    304294  }
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs

    r12012 r13475  
    664664        ExpandToolStripMenuItem.Enabled = ExpandToolStripMenuItem.Visible = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0;
    665665        CollapseToolStripMenuItem.Enabled = CollapseToolStripMenuItem.Visible = toolStripMenuNode.IsExpanded;
    666         EditNodeLabelToolStripMenuItem.Enabled = EditNodeLabelToolStripMenuItem.Visible = !Locked && !ReadOnly && toolStripMenuNode.Tag != null && toolStripMenuNode.Tag is INamedItem && ((INamedItem)toolStripMenuNode.Tag).CanChangeName;
    667666      } else {
    668667        ExpandToolStripMenuItem.Enabled = ExpandToolStripMenuItem.Visible = false;
    669668        CollapseToolStripMenuItem.Enabled = CollapseToolStripMenuItem.Visible = false;
    670         EditNodeLabelToolStripMenuItem.Enabled = EditNodeLabelToolStripMenuItem.Visible = false;
    671669      }
    672670      ExpandAllToolStripMenuItem.Enabled = ExpandAllToolStripMenuItem.Visible = !treeView.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x));
     
    687685    private void CollapseAllToolStripMenuItem_Click(object sender, EventArgs e) {
    688686      treeView.CollapseAll();
    689     }
    690     private void EditNodeLabelToolStripMenuItem_Click(object sender, EventArgs e) {
    691       if (toolStripMenuNode != null) {
    692         if (!toolStripMenuNode.IsEditing) toolStripMenuNode.BeginEdit();
    693       }
    694687    }
    695688
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r12804 r13475  
    150150      <Private>False</Private>
    151151    </Reference>
     152    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     153      <SpecificVersion>False</SpecificVersion>
     154      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     155      <Private>False</Private>
     156    </Reference>
    152157    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    153158      <SpecificVersion>False</SpecificVersion>
     
    344349      <DependentUpon>RunCollectionEqualityConstraintView.cs</DependentUpon>
    345350    </Compile>
     351    <Compile Include="RunCollectionViews\RunCollectionIteratedSamplingView.cs">
     352      <SubType>UserControl</SubType>
     353    </Compile>
     354    <Compile Include="RunCollectionViews\RunCollectionIteratedSamplingView.Designer.cs">
     355      <DependentUpon>RunCollectionIteratedSamplingView.cs</DependentUpon>
     356    </Compile>
    346357    <Compile Include="RunCollectionViews\RunCollectionRLDView.cs">
    347358      <SubType>UserControl</SubType>
     
    379390    <Compile Include="TimeLimitRunView.Designer.cs">
    380391      <DependentUpon>TimeLimitRunView.cs</DependentUpon>
     392    </Compile>
     393    <Compile Include="ThresholdTerminatorView.cs">
     394      <SubType>UserControl</SubType>
     395    </Compile>
     396    <Compile Include="ThresholdTerminatorView.Designer.cs">
     397      <DependentUpon>ThresholdTerminatorView.cs</DependentUpon>
    381398    </Compile>
    382399    <Compile Include="UserDefinedAlgorithmView.cs">
     
    447464    <EmbeddedResource Include="CreateNewSingleEncodingDialog.resx">
    448465      <DependentUpon>CreateNewSingleEncodingDialog.cs</DependentUpon>
     466    </EmbeddedResource>
     467    <EmbeddedResource Include="RunCollectionViews\RunCollectionIteratedSamplingView.resx">
     468      <DependentUpon>RunCollectionIteratedSamplingView.cs</DependentUpon>
    449469    </EmbeddedResource>
    450470  </ItemGroup>
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/Plugin.cs.frame

    r12753 r13475  
    2626  /// Plugin class for HeuristicLab.Optimization.Views plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Optimization.Views", "3.3.12.$WCREV$")]
     28  [Plugin("HeuristicLab.Optimization.Views", "3.3.13.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Optimization.Views-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/Properties/AssemblyInfo.cs.frame

    r12753 r13475  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs

    r12813 r13475  
    248248        matrix[5, i] = seriesValues.StandardDeviation();
    249249        matrix[6, i] = seriesValues.Variance();
    250         matrix[7, i] = seriesValues.Percentile(0.25);
    251         matrix[8, i] = seriesValues.Percentile(0.75);
     250        matrix[7, i] = seriesValues.Quantile(0.25);
     251        matrix[8, i] = seriesValues.Quantile(0.75);
    252252      }
    253253      statisticsMatrixView.Content = matrix;
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs

    r12692 r13475  
    8080        return;
    8181      }
     82      UpdateDataTableComboBox(); // will trigger AddRuns
     83    }
     84    private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     85      if (suppressUpdates) return;
     86      if (InvokeRequired) {
     87        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
     88        return;
     89      }
     90      RemoveRuns(e.Items);
    8291      UpdateDataTableComboBox();
    8392      UpdateDataRowComboBox();
    84       AddRuns(e.Items);
    85     }
    86     private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    87       if (suppressUpdates) return;
    88       if (InvokeRequired) {
    89         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e);
    90         return;
    91       }
     93      RebuildCombinedDataTable();
     94    }
     95    private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
     96      if (suppressUpdates) return;
     97      if (InvokeRequired) {
     98        Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
     99        return;
     100      }
     101      RemoveRuns(e.OldItems);
    92102      UpdateDataTableComboBox();
    93103      UpdateDataRowComboBox();
    94       RemoveRuns(e.Items);
    95     }
    96     private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    97       if (suppressUpdates) return;
    98       if (InvokeRequired) {
    99         Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e);
    100         return;
    101       }
    102       UpdateDataTableComboBox();
    103       UpdateDataRowComboBox();
    104       RemoveRuns(e.OldItems);
    105       AddRuns(e.Items);
     104      RebuildCombinedDataTable();
    106105    }
    107106    private void Content_AlgorithmNameChanged(object sender, EventArgs e) {
     
    117116      suppressUpdates = Content.UpdateOfRunsInProgress;
    118117      if (!suppressUpdates) {
     118        foreach (var run in runMapping)
     119          DeregisterRunEvents(run.Key);
     120        runMapping.Clear();
     121        combinedDataTable.Rows.Clear();
    119122        UpdateDataTableComboBox();
    120         UpdateDataRowComboBox();
    121         UpdateRuns(Content);
    122123      }
    123124    }
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs

    r12956 r13475  
    463463      ertTableView.DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
    464464    }
    465 
    466 
    467465    #endregion
    468466
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs

    r12692 r13475  
    2525using System.Linq;
    2626using System.Windows.Forms;
     27using HeuristicLab.Collections;
    2728using HeuristicLab.Core;
    2829using HeuristicLab.Data.Views;
     
    122123
    123124    protected override void UpdateColumnHeaders() {
    124       HashSet<string> visibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>()
    125        .Where(c => c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText));
    126 
     125      string[] colNames = base.Content.ColumnNames.ToArray();
     126      int colCount = colNames.Length;
    127127      for (int i = 0; i < dataGridView.ColumnCount; i++) {
    128         if (i < base.Content.ColumnNames.Count())
    129           dataGridView.Columns[i].HeaderText = base.Content.ColumnNames.ElementAt(i);
     128        if (i < colCount)
     129          dataGridView.Columns[i].HeaderText = colNames[i];
    130130        else
    131131          dataGridView.Columns[i].HeaderText = "Column " + (i + 1);
     132      }
     133
     134      HashSet<string> visibleColumnNames = new HashSet<string>(
     135        dataGridView.Columns.OfType<DataGridViewColumn>()
     136       .Where(c => c.Visible)
     137       .Where(c => !string.IsNullOrEmpty(c.HeaderText))
     138       .Where(c => !IsConstant(c.HeaderText))
     139       .Select(c => c.HeaderText));
     140
     141      for (int i = 0; i < dataGridView.ColumnCount; i++) {
    132142        dataGridView.Columns[i].Visible = visibleColumnNames.Count == 0 || visibleColumnNames.Contains(dataGridView.Columns[i].HeaderText);
    133143      }
     144    }
     145
     146    // returns true when all values in the column are the same (missing values are included in the count)
     147    private bool IsConstant(string columnName) {
     148      Func<IRun, string, string> GetStringValue = (IRun r, string colName) => {
     149        // also include missing values in the count
     150        IItem v = null;
     151        if (r.Parameters.TryGetValue(colName, out v)) return v.ToString();
     152        if (r.Results.TryGetValue(colName, out v)) return v.ToString();
     153        return string.Empty;
     154      };
     155
     156      var firstRun = Content.First();
     157      string firstValue = GetStringValue(firstRun, columnName);
     158      return Content.Skip(1).All(run => firstValue == GetStringValue(run, columnName));
    134159    }
    135160
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs

    r12692 r13475  
    389389        return;
    390390      ReadOnly = true;
     391
    391392      try {
     393        RunCollection.UpdateOfRunsInProgress = true;
    392394        RunCollection.Modify();
    393395      } finally {
    394396        ReadOnly = false;
     397        RunCollection.UpdateOfRunsInProgress = false;
    395398      }
    396399    }
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.Designer.cs

    r12627 r13475  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.cs

    r12627 r13475  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs

    r12012 r13475  
    6565      //
    6666      this.engineViewHost.Size = new System.Drawing.Size(693, 402);
    67       //
    68       // openOperatorGraphButton
    69       //
    70       this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");
    71       this.openOperatorGraphButton.Click += new System.EventHandler(openOperatorGraphButton_Click);
    72       //
    73       // newOperatorGraphButton
    74       //
    75       this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");
    76       this.newOperatorGraphButton.Click += new System.EventHandler(newOperatorGraphButton_Click);
    7767      //
    7868      // tabControl
  • branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs

    r12012 r13475  
    5757      base.SetEnabledStateOfControls();
    5858      globalScopeView.Enabled = Content != null;
    59       newOperatorGraphButton.Enabled = Content != null && !ReadOnly;
    60       openOperatorGraphButton.Enabled = Content != null && !ReadOnly;
    6159      operatorGraphViewHost.ReadOnly = Content == null || ReadOnly;
    62     }
    63 
    64     private void newOperatorGraphButton_Click(object sender, EventArgs e) {
    65       Content.OperatorGraph = new OperatorGraph();
    66     }
    67     private void openOperatorGraphButton_Click(object sender, EventArgs e) {
    68       openFileDialog.Title = "Open Operator Graph";
    69       if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
    70         newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = false;
    71         operatorGraphViewHost.Enabled = false;
    72 
    73         ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {
    74           try {
    75             if (error != null) throw error;
    76             OperatorGraph operatorGraph = content as OperatorGraph;
    77             if (operatorGraph == null)
    78               MessageBox.Show(this, "The selected file does not contain an operator graph.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
    79             else
    80               Content.OperatorGraph = operatorGraph;
    81           }
    82           catch (Exception ex) {
    83             ErrorHandling.ShowErrorDialog(this, ex);
    84           }
    85           finally {
    86             Invoke(new Action(delegate() {
    87               operatorGraphViewHost.Enabled = true;
    88               newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = true;
    89             }));
    90           }
    91         });
    92       }
    9360    }
    9461  }
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs

    r12012 r13475  
    6767      }
    6868    }
     69    [Storable]
    6970    private T solutionCreator;
    7071    public T SolutionCreator {
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r12764 r13475  
    209209    <Compile Include="Interfaces\ISimilarityBasedOperator.cs" />
    210210    <Compile Include="Interfaces\ISolutionSimilarityCalculator.cs" />
     211    <Compile Include="Interfaces\ITerminationBasedOperator.cs" />
     212    <Compile Include="Interfaces\ITerminator.cs" />
    211213    <Compile Include="MetaOptimizers\BatchRun.cs" />
    212214    <Compile Include="MetaOptimizers\Experiment.cs" />
    213215    <Compile Include="MetaOptimizers\TimeLimitRun.cs" />
    214216    <Compile Include="Results\ResultParameter.cs" />
     217    <Compile Include="RunCollection.cs">
     218      <SubType>Code</SubType>
     219    </Compile>
    215220    <Compile Include="RunCollectionModification\RunCollectionRunRemover.cs" />
    216221    <Compile Include="Plugin.cs" />
     
    220225    <Compile Include="RunCollectionModification\RunCollectionValueRemover.cs" />
    221226    <Compile Include="Interfaces\IRunCollectionModifier.cs" />
     227    <Compile Include="Termination\ComparisonTerminator.cs" />
     228    <Compile Include="Termination\ExecutionTimeTerminator.cs" />
     229    <Compile Include="Termination\MultiTerminator.cs" />
     230    <Compile Include="Termination\SingleObjectiveQualityTerminator.cs" />
     231    <Compile Include="Termination\TerminationOperator.cs" />
     232    <Compile Include="Termination\Terminator.cs" />
     233    <Compile Include="Termination\ThresholdTerminator.cs" />
    222234    <None Include="Plugin.cs.frame" />
    223235    <Compile Include="Algorithms\Algorithm.cs" />
     
    265277    <Compile Include="OptimizerList.cs" />
    266278    <Compile Include="Interfaces\IOptimizer.cs" />
    267     <Compile Include="RunCollection.cs" />
    268279    <Compile Include="Run.cs" />
    269280    <Compile Include="Results\IResult.cs" />
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Interfaces/ISolutionSimilarityCalculator.cs

    r12085 r13475  
    3030    string SolutionVariableName { get; set; }
    3131    string QualityVariableName { get; set; }
     32    bool ExecuteInParallel { get; set; }
     33    int MaxDegreeOfParallelism { get; set; }
    3234
    3335    /// <summary>
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs

    r12504 r13475  
    2424using System.Drawing;
    2525using System.Linq;
     26using System.Threading;
    2627using HeuristicLab.Collections;
    2728using HeuristicLab.Common;
     
    345346
    346347    private readonly object locker = new object();
     348    private readonly object runsLocker = new object();
    347349    private void optimizer_ExceptionOccurred(object sender, EventArgs<Exception> e) {
    348350      lock (locker)
     
    350352    }
    351353    private void optimizer_ExecutionTimeChanged(object sender, EventArgs e) {
    352       lock (locker)
     354      // only wait for maximally 100ms to acquire lock, otherwise return and don't update the execution time
     355      var success = Monitor.TryEnter(locker, 100);
     356      if (!success) return;
     357      try {
    353358        ExecutionTime = Optimizers.Aggregate(TimeSpan.Zero, (t, o) => t + o.ExecutionTime);
     359      }
     360      finally {
     361        Monitor.Exit(locker);
     362      }
    354363    }
    355364    private void optimizer_Paused(object sender, EventArgs e) {
     
    378387    }
    379388    private void optimizer_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    380       lock (locker) {
     389      lock (runsLocker) {
    381390        Runs.RemoveRange(e.OldItems);
    382391        Runs.AddRange(e.Items);
     
    384393    }
    385394    private void optimizer_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    386       lock (locker)
     395      lock (runsLocker)
    387396        Runs.AddRange(e.Items);
    388397    }
    389398    private void optimizer_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {
    390       lock (locker)
     399      lock (runsLocker)
    391400        Runs.RemoveRange(e.Items);
    392401    }
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs

    r12627 r13475  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Plugin.cs.frame

    r12753 r13475  
    2626  /// Plugin class for HeuristicLab.Optimization plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Optimization", "3.3.12.$WCREV$")]
     28  [Plugin("HeuristicLab.Optimization", "3.3.13.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Optimization-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs

  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Properties/AssemblyInfo.cs.frame

    r12753 r13475  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.13.$WCREV$")]
  • branches/PerformanceComparison/HeuristicLab.Optimization/3.3/RunCollection.cs

    r12692 r13475  
    483483    #region Filtering
    484484    private void UpdateFiltering(bool reset) {
    485       var oldUpateRuns = UpdateOfRunsInProgress;
    486       UpdateOfRunsInProgress = true;
    487485      if (reset)
    488486        list.ForEach(r => r.Visible = true);
    489487      foreach (IRunCollectionConstraint constraint in this.constraints)
    490488        constraint.Check();
    491       UpdateOfRunsInProgress = oldUpateRuns;
    492489    }
    493490
     
    539536    protected virtual void Constraint_ConstraintOperationChanged(object sender, EventArgs e) {
    540537      IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender;
    541       if (constraint.Active)
    542         this.UpdateFiltering(true);
     538      if (constraint.Active) {
     539        var oldUpdateRuns = UpdateOfRunsInProgress;
     540        try {
     541          UpdateOfRunsInProgress = true;
     542          UpdateFiltering(true);
     543        } finally { UpdateOfRunsInProgress = oldUpdateRuns; }
     544      }
    543545    }
    544546    protected virtual void Constraint_ConstraintDataChanged(object sender, EventArgs e) {
    545547      IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender;
    546       if (constraint.Active)
    547         this.UpdateFiltering(true);
     548      if (constraint.Active) {
     549        var oldUpdateRuns = UpdateOfRunsInProgress;
     550        try {
     551          UpdateOfRunsInProgress = true;
     552          UpdateFiltering(true);
     553        } finally { UpdateOfRunsInProgress = oldUpdateRuns; }
     554      }
    548555    }
    549556    #endregion
     
    551558    #region Modification
    552559    public void Modify() {
    553       var oldUpateRuns = UpdateOfRunsInProgress;
    554       UpdateOfRunsInProgress = true;
    555560      var runs = this.ToList();
    556561      var selectedRuns = runs.Where(r => r.Visible).ToList();
     
    566571        }
    567572      }
    568       UpdateOfRunsInProgress = oldUpateRuns;
    569573    }
    570574
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.Designer.cs

    r12957 r13475  
    3434    /// </summary>
    3535    private void InitializeComponent() {
     36      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExpertSystemView));
    3637      this.evaluationsLimitabel = new System.Windows.Forms.Label();
    3738      this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox();
     
    5051      this.algorithmInstancesViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5152      this.problemInstancesTabPage = new System.Windows.Forms.TabPage();
    52       this.problemInstancesView = new HeuristicLab.Optimization.Views.RunCollectionBubbleChartView();
     53      this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     54      this.instancesDropPanel = new System.Windows.Forms.Panel();
     55      this.dragFLAHereLabel = new System.Windows.Forms.Label();
     56      this.refreshMapButton = new System.Windows.Forms.Button();
    5357      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     58      this.okbDownloadButton = new System.Windows.Forms.Button();
    5459      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5560      this.tabControl.SuspendLayout();
     
    5964      this.okbTabPage.SuspendLayout();
    6065      this.problemInstancesTabPage.SuspendLayout();
     66      this.instancesDropPanel.SuspendLayout();
    6167      this.SuspendLayout();
    6268      //
     
    8389      // maxEvaluationsTextBox
    8490      //
    85       this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     91      this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    8692            | System.Windows.Forms.AnchorStyles.Right)));
    8793      this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26);
     
    94100      //
    95101      this.tabControl.AllowDrop = true;
    96       this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    97             | System.Windows.Forms.AnchorStyles.Left)
     102      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     103            | System.Windows.Forms.AnchorStyles.Left) 
    98104            | System.Windows.Forms.AnchorStyles.Right)));
    99105      this.tabControl.Controls.Add(this.problemTabPage);
     
    127133      // problemViewHost
    128134      //
    129       this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    130             | System.Windows.Forms.AnchorStyles.Left)
     135      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     136            | System.Windows.Forms.AnchorStyles.Left) 
    131137            | System.Windows.Forms.AnchorStyles.Right)));
    132138      this.problemViewHost.Caption = "View";
     
    143149      // openProblemButton
    144150      //
    145       this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
     151      this.openProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("openProblemButton.Image")));
    146152      this.openProblemButton.Location = new System.Drawing.Point(36, 6);
    147153      this.openProblemButton.Name = "openProblemButton";
     
    154160      // newProblemButton
    155161      //
    156       this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
     162      this.newProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("newProblemButton.Image")));
    157163      this.newProblemButton.Location = new System.Drawing.Point(6, 6);
    158164      this.newProblemButton.Name = "newProblemButton";
     
    178184      // algorithmViewHost
    179185      //
    180       this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    181             | System.Windows.Forms.AnchorStyles.Left)
     186      this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     187            | System.Windows.Forms.AnchorStyles.Left) 
    182188            | System.Windows.Forms.AnchorStyles.Right)));
    183189      this.algorithmViewHost.Caption = "View";
     
    203209      // suggestedInstancesComboBox
    204210      //
    205       this.suggestedInstancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     211      this.suggestedInstancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    206212            | System.Windows.Forms.AnchorStyles.Right)));
    207213      this.suggestedInstancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    237243      // okbTabPage
    238244      //
     245      this.okbTabPage.Controls.Add(this.okbDownloadButton);
    239246      this.okbTabPage.Controls.Add(this.algorithmInstancesViewHost);
    240247      this.okbTabPage.Location = new System.Drawing.Point(4, 22);
     
    248255      // algorithmInstancesViewHost
    249256      //
     257      this.algorithmInstancesViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     258            | System.Windows.Forms.AnchorStyles.Left)
     259            | System.Windows.Forms.AnchorStyles.Right)));
    250260      this.algorithmInstancesViewHost.Caption = "View";
    251261      this.algorithmInstancesViewHost.Content = null;
    252       this.algorithmInstancesViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    253262      this.algorithmInstancesViewHost.Enabled = false;
    254       this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 3);
     263      this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 35);
    255264      this.algorithmInstancesViewHost.Name = "algorithmInstancesViewHost";
    256265      this.algorithmInstancesViewHost.ReadOnly = false;
    257       this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 329);
     266      this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 297);
    258267      this.algorithmInstancesViewHost.TabIndex = 0;
    259268      this.algorithmInstancesViewHost.ViewsLabelVisible = true;
     
    263272      //
    264273      this.problemInstancesTabPage.Controls.Add(this.problemInstancesView);
     274      this.problemInstancesTabPage.Controls.Add(this.instancesDropPanel);
     275      this.problemInstancesTabPage.Controls.Add(this.refreshMapButton);
    265276      this.problemInstancesTabPage.Location = new System.Drawing.Point(4, 22);
    266277      this.problemInstancesTabPage.Name = "problemInstancesTabPage";
     
    273284      // problemInstancesView
    274285      //
    275       this.problemInstancesView.BackColor = System.Drawing.SystemColors.Window;
    276       this.problemInstancesView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
    277       this.problemInstancesView.Caption = "Bubble Chart";
     286      this.problemInstancesView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     287            | System.Windows.Forms.AnchorStyles.Left)
     288            | System.Windows.Forms.AnchorStyles.Right)));
     289      this.problemInstancesView.Caption = "View";
    278290      this.problemInstancesView.Content = null;
    279       this.problemInstancesView.Dock = System.Windows.Forms.DockStyle.Fill;
    280       this.problemInstancesView.Location = new System.Drawing.Point(3, 3);
     291      this.problemInstancesView.Enabled = false;
     292      this.problemInstancesView.Location = new System.Drawing.Point(3, 34);
    281293      this.problemInstancesView.Name = "problemInstancesView";
    282294      this.problemInstancesView.ReadOnly = false;
    283       this.problemInstancesView.Size = new System.Drawing.Size(532, 329);
    284       this.problemInstancesView.TabIndex = 0;
     295      this.problemInstancesView.Size = new System.Drawing.Size(532, 298);
     296      this.problemInstancesView.TabIndex = 3;
     297      this.problemInstancesView.ViewsLabelVisible = true;
     298      this.problemInstancesView.ViewType = null;
     299      //
     300      // instancesDropPanel
     301      //
     302      this.instancesDropPanel.AllowDrop = true;
     303      this.instancesDropPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     304            | System.Windows.Forms.AnchorStyles.Right)));
     305      this.instancesDropPanel.BackColor = System.Drawing.Color.LightYellow;
     306      this.instancesDropPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     307      this.instancesDropPanel.Controls.Add(this.dragFLAHereLabel);
     308      this.instancesDropPanel.Location = new System.Drawing.Point(35, 7);
     309      this.instancesDropPanel.Name = "instancesDropPanel";
     310      this.instancesDropPanel.Size = new System.Drawing.Size(500, 21);
     311      this.instancesDropPanel.TabIndex = 2;
     312      this.instancesDropPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragDrop);
     313      this.instancesDropPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragEnter);
     314      this.instancesDropPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragOver);
     315      //
     316      // dragFLAHereLabel
     317      //
     318      this.dragFLAHereLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
     319      this.dragFLAHereLabel.AutoSize = true;
     320      this.dragFLAHereLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
     321      this.dragFLAHereLabel.Location = new System.Drawing.Point(155, 3);
     322      this.dragFLAHereLabel.Name = "dragFLAHereLabel";
     323      this.dragFLAHereLabel.Size = new System.Drawing.Size(175, 13);
     324      this.dragFLAHereLabel.TabIndex = 0;
     325      this.dragFLAHereLabel.Text = "Drag and drop runs with FLA here...";
     326      //
     327      // refreshMapButton
     328      //
     329      this.refreshMapButton.Location = new System.Drawing.Point(3, 6);
     330      this.refreshMapButton.Name = "refreshMapButton";
     331      this.refreshMapButton.Size = new System.Drawing.Size(26, 23);
     332      this.refreshMapButton.TabIndex = 1;
     333      this.refreshMapButton.Text = "Refresh";
     334      this.refreshMapButton.UseVisualStyleBackColor = true;
     335      this.refreshMapButton.Click += new System.EventHandler(this.refreshMapButton_Click);
    285336      //
    286337      // openFileDialog
     
    290341      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
    291342      this.openFileDialog.Title = "Open Optimizer";
     343      //
     344      // okbDownloadButton
     345      //
     346      this.okbDownloadButton.Location = new System.Drawing.Point(6, 6);
     347      this.okbDownloadButton.Name = "okbDownloadButton";
     348      this.okbDownloadButton.Size = new System.Drawing.Size(146, 23);
     349      this.okbDownloadButton.TabIndex = 1;
     350      this.okbDownloadButton.Text = "Download from OKB";
     351      this.okbDownloadButton.UseVisualStyleBackColor = true;
     352      this.okbDownloadButton.Click += new System.EventHandler(this.okbDownloadButton_Click);
    292353      //
    293354      // ExpertSystemView
     
    313374      this.okbTabPage.ResumeLayout(false);
    314375      this.problemInstancesTabPage.ResumeLayout(false);
     376      this.instancesDropPanel.ResumeLayout(false);
     377      this.instancesDropPanel.PerformLayout();
    315378      this.ResumeLayout(false);
    316379      this.PerformLayout();
     
    337400    private MainForm.WindowsForms.ViewHost algorithmInstancesViewHost;
    338401    private System.Windows.Forms.TabPage problemInstancesTabPage;
    339     private Optimization.Views.RunCollectionBubbleChartView problemInstancesView;
     402    private System.Windows.Forms.Panel instancesDropPanel;
     403    private System.Windows.Forms.Button refreshMapButton;
     404    private System.Windows.Forms.Label dragFLAHereLabel;
     405    private MainForm.WindowsForms.ViewHost problemInstancesView;
     406    private System.Windows.Forms.Button okbDownloadButton;
    340407  }
    341408}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.cs

    r12860 r13475  
    2121
    2222using System;
     23using System.Collections;
    2324using System.ComponentModel;
     25using System.IO;
     26using System.Linq;
    2427using System.Windows.Forms;
     28using HeuristicLab.Clients.OKB.Administration;
     29using HeuristicLab.Clients.OKB.Query;
    2530using HeuristicLab.Common;
     31using HeuristicLab.Common.Resources;
     32using HeuristicLab.Core;
    2633using HeuristicLab.Core.Views;
    2734using HeuristicLab.MainForm;
    2835using HeuristicLab.Optimization;
     36using HeuristicLab.Persistence.Default.Xml;
    2937using HeuristicLab.PluginInfrastructure;
    3038
     
    4351    public ExpertSystemView() {
    4452      InitializeComponent();
     53      refreshMapButton.Text = string.Empty;
     54      refreshMapButton.Image = VSImageLibrary.Refresh;
    4555    }
    4656
     
    8393          runsView.Content = null;
    8494          algorithmInstancesViewHost.Content = null;
     95          problemInstancesView.Content = null;
    8596        } else {
    8697          maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString();
     
    8899          runsView.Content = Content.Runs;
    89100          algorithmInstancesViewHost.Content = Content.AlgorithmInstances;
     101          problemInstancesView.Content = Content.ProblemInstances;
    90102        }
    91103      } finally { SuppressEvents = false; }
     
    103115      runsView.Enabled = Content != null;
    104116      algorithmInstancesViewHost.Enabled = Content != null;
     117      refreshMapButton.Enabled = Content != null;
     118      okbDownloadButton.Enabled = Content != null && Content.Problem != null && !ReadOnly && !Locked;
    105119    }
    106120
     
    131145      try {
    132146        switch (e.PropertyName) {
     147          case "AlgorithmInstances": algorithmInstancesViewHost.Content = Content.AlgorithmInstances; break;
    133148          case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break;
    134149          case "Problem": problemViewHost.Content = Content.Problem; break;
     150          case "ProblemInstances": problemInstancesView.Content = Content.ProblemInstances; break;
    135151        }
    136152      } finally { SuppressEvents = false; }
     153      SetEnabledStateOfControls();
    137154    }
    138155
     
    233250    }
    234251    #endregion
     252
     253    private bool validDragOperation;
     254    private void instancesDropPanel_DragEnter(object sender, DragEventArgs e) {
     255      validDragOperation = false;
     256      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun)) {
     257        validDragOperation = true;
     258      } else if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable)) {
     259        validDragOperation = true;
     260        var items = (IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     261        foreach (object item in items)
     262          validDragOperation = validDragOperation && (item is IRun);
     263      }
     264    }
     265    private void instancesDropPanel_DragOver(object sender, DragEventArgs e) {
     266      e.Effect = DragDropEffects.None;
     267      if (!validDragOperation) return;
     268      if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     269      else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     270      else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
     271      else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;
     272      else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;
     273    }
     274    private void instancesDropPanel_DragDrop(object sender, DragEventArgs e) {
     275      if (e.Effect == DragDropEffects.None) return;
     276      if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun) {
     277        var item = (IRun)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
     278        Content.ProblemInstances.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (IRun)item.Clone() : item);
     279      } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
     280        var items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<IRun>();
     281        if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     282          var cloner = new Cloner();
     283          items = items.Select(x => cloner.Clone(x));
     284        }
     285        Content.ProblemInstances.AddRange(items);
     286      }
     287    }
    235288    #endregion
     289
     290    private void refreshMapButton_Click(object sender, EventArgs e) {
     291      Content.UpdateInstanceMap();
     292    }
     293
     294    private void okbDownloadButton_Click(object sender, EventArgs e) {
     295      var queryClient = QueryClient.Instance;
     296      queryClient.Refresh();
     297
     298      var problemTypeFilter = (StringComparisonAvailableValuesFilter)queryClient.Filters.Single(x => x.Label == "Problem Data Type Name");
     299      problemTypeFilter.Value = Content.Problem.GetType().Name;
     300
     301      var runIds = queryClient.GetRunIds(problemTypeFilter).ToList();
     302      var count = queryClient.GetNumberOfRuns(problemTypeFilter);
     303      if (count > 0) {
     304        var list = new ItemList<IAlgorithm>();
     305        var adminClient = AdministrationClient.Instance;
     306        adminClient.Refresh();
     307        var runs = queryClient.GetRuns(runIds, true).ToList();
     308        foreach (var rGroup in runs.GroupBy(x => x.Algorithm.Id)) {
     309          var data = AdministrationClient.GetAlgorithmData(rGroup.Key);
     310          if (data != null) {
     311            using (var stream = new MemoryStream(data)) {
     312              try {
     313                var alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream);
     314                alg.Runs.AddRange(rGroup.Select(x => queryClient.ConvertToOptimizationRun(x)));
     315                list.Add(alg);
     316              } catch (Exception) { }
     317              stream.Close();
     318            }
     319          }
     320        }
     321        Content.AlgorithmInstances = list;
     322      }
     323    }
    236324  }
    237325}
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj

    r12957 r13475  
    7878      <Private>False</Private>
    7979    </Reference>
     80    <Reference Include="HeuristicLab.Clients.OKB-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     81      <SpecificVersion>False</SpecificVersion>
     82      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Clients.OKB-3.3.dll</HintPath>
     83      <Private>False</Private>
     84    </Reference>
    8085    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    8186      <SpecificVersion>False</SpecificVersion>
     
    121126      <SpecificVersion>False</SpecificVersion>
    122127      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
     128      <Private>False</Private>
     129    </Reference>
     130    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     131      <SpecificVersion>False</SpecificVersion>
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
    123133      <Private>False</Private>
    124134    </Reference>
     
    136146    <Reference Include="System.Core" />
    137147    <Reference Include="System.Drawing" />
     148    <Reference Include="System.Runtime.Serialization" />
    138149    <Reference Include="System.Windows.Forms" />
    139150    <Reference Include="System.Xml.Linq" />
     
    185196    </ProjectReference>
    186197  </ItemGroup>
     198  <ItemGroup>
     199    <EmbeddedResource Include="ExpertSystemView.resx">
     200      <DependentUpon>ExpertSystemView.cs</DependentUpon>
     201    </EmbeddedResource>
     202  </ItemGroup>
    187203  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    188204  <PropertyGroup>
  • branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystem.cs

    r12957 r13475  
    7171        algorithmInstances = value;
    7272        OnPropertyChanged("AlgorithmInstances");
     73        // TODO: Attach event handlers
    7374      }
    7475    }
     
    155156      var runCollection = sender as RunCollection;
    156157      if (runCollection != null && runCollection.UpdateOfRunsInProgress) return;
    157       UpdateInstanceMap();
    158158      UpdateSuggestions();
    159159    }
    160160
    161     private void UpdateInstanceMap() {
     161    public void UpdateInstanceMap() {
    162162      var flaValues = ProblemInstances.ResultNames
    163163                      .Where(x => x.StartsWith("Characteristic.")
     
    203203          } else instance.Results.Add("Projection.PCA2", new DoubleValue(y));
    204204
     205          instanceCounter++;
     206
    205207          var bkQuality = ((DoubleValue)instance.Parameters["BestKnownQuality"]).Value;
    206208          var maximization = ((BoolValue)instance.Parameters["Maximization"]).Value;
     209
     210          if (!algInstRunDict.ContainsKey(probInstanceName)) continue;
    207211          foreach (var kvp in algInstRunDict[probInstanceName]) {
    208212            var algInstanceName = kvp.Key;
    209             foreach (var run in kvp.Value) {
    210               // TODO: Things needs to be configurable here (table name, targets)
    211               foreach (var target in new[] { 1, 1.01, 1.05, 1.1, 1.2, 1.5 }) {
    212                 var result = ExpectedRuntimeHelper.CalculateErt(kvp.Value, "QualityPerEvaluations", bkQuality * target, maximization);
    213                 var resultName = algInstanceName + "@" + ((target - 1) * 100) + "%";
    214                 if (run.Results.TryGetValue(resultName, out item))
    215                   ((DoubleValue)item).Value = result.ExpectedRuntime;
    216                 else run.Results.Add(resultName, new DoubleValue(result.ExpectedRuntime));
    217               }
     213            // TODO: Things needs to be configurable here (table name, targets)
     214            foreach (var target in new[] { 1, 1.01, 1.05, 1.1, 1.2, 1.5 }) {
     215              var result = ExpectedRuntimeHelper.CalculateErt(kvp.Value, "QualityPerEvaluations", bkQuality * target, maximization);
     216              var resultName = algInstanceName + "@" + ((target - 1) * 100) + "%";
     217              if (instance.Results.TryGetValue(resultName, out item)) {
     218                ((DoubleValue)item).Value = Math.Log10(result.ExpectedRuntime);
     219              } else instance.Results.Add(resultName, new DoubleValue(Math.Log10(result.ExpectedRuntime)));
    218220            }
    219221          }
Note: See TracChangeset for help on using the changeset viewer.