Changeset 13475
- Timestamp:
- 12/16/15 17:04:35 (9 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 4 added
- 39 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison
- Property svn:ignore
-
old new 2 2 *.suo 3 3 *.user 4 .git 5 .gitignore
-
- Property svn:ignore
-
branches/PerformanceComparison/HeuristicLab.Analysis
- Property svn:mergeinfo changed
/stable/HeuristicLab.Analysis merged: 13316 /trunk/sources/HeuristicLab.Analysis merged: 13005,13321,13397
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
/stable/HeuristicLab.Analysis.Views merged: 13316 /trunk/sources/HeuristicLab.Analysis.Views merged: 13321,13397
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Plugin.cs.frame
r12753 r13475 26 26 /// Plugin class for HeuristicLab.Analysis.Views plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Analysis.Views", "3.3.1 2.$WCREV$")]28 [Plugin("HeuristicLab.Analysis.Views", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Analysis.Views-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/Properties/AssemblyInfo.cs.frame
r12753 r13475 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 2.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")] -
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Plugin.cs.frame
r12831 r13475 26 26 /// Plugin class for HeuristicLab.Analysis plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Analysis", "3.3.1 2.$WCREV$")]28 [Plugin("HeuristicLab.Analysis", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Analysis-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")] -
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/PopulationSimilarityAnalysis/PopulationSimilarityAnalyzer.cs
r12076 r13475 39 39 public class PopulationSimilarityAnalyzer : SingleSuccessorOperator, IAnalyzer, ISimilarityBasedOperator { 40 40 private const string DiversityResultNameParameterName = "DiversityResultsName"; 41 private const string ExecuteInParallelParameterName = "ExecuteInParallel"; 42 private const string MaxDegreeOfParallelismParameterName = "MaxDegreeOfParallelism"; 41 43 42 44 #region Backwards compatible code, remove with 3.4 … … 71 73 get { return (FixedValueParameter<StringValue>)Parameters[DiversityResultNameParameterName]; } 72 74 } 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 } 73 81 74 82 public string DiversityResultName { … … 77 85 } 78 86 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 79 97 [StorableConstructor] 80 98 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 82 105 public PopulationSimilarityAnalyzer(IEnumerable<ISolutionSimilarityCalculator> validSimilarityCalculators) 83 106 : base() { … … 89 112 Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the operator was called since the last update.", "PopulationDiversityAnalyzerUpdateCounter")); 90 113 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))); 91 116 92 117 var similarityCalculators = SimilarityCalculatorParameter.ValidValues; 93 foreach (var sc in validSimilarityCalculators) 118 foreach (var sc in validSimilarityCalculators) { 94 119 similarityCalculators.Add(sc); 95 120 } 96 121 97 122 ResultsParameter.Hidden = true; 98 123 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 } 99 141 } 100 142 … … 113 155 Parameters.Add(new ConstrainedValueParameter<ISolutionSimilarityCalculator>("SimilarityCalculator", "The similarity calculator that should be used to calculate solution similarity.")); 114 156 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(); 116 172 #endregion 117 173 } -
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Properties/AssemblyInfo.cs.frame
r12753 r13475 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 2.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")] -
branches/PerformanceComparison/HeuristicLab.Optimization
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Optimization.Views
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.Designer.cs
r12012 r13475 50 50 this.engineViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 51 51 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(); 55 53 this.tabControl.SuspendLayout(); 56 54 this.parametersTabPage.SuspendLayout(); … … 219 217 // operatorGraphTabPage 220 218 // 221 this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);222 this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);223 219 this.operatorGraphTabPage.Controls.Add(this.operatorGraphViewHost); 224 220 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); … … 229 225 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 230 226 // 231 // openOperatorGraphButton232 //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 // newOperatorGraphButton243 //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 //253 227 // operatorGraphViewHost 254 228 // … … 258 232 this.operatorGraphViewHost.Caption = "View"; 259 233 this.operatorGraphViewHost.Content = null; 234 this.operatorGraphViewHost.EnableBreadcrumbs = true; 260 235 this.operatorGraphViewHost.Enabled = false; 261 this.operatorGraphViewHost.Location = new System.Drawing.Point( 3, 33);236 this.operatorGraphViewHost.Location = new System.Drawing.Point(6, 6); 262 237 this.operatorGraphViewHost.Name = "operatorGraphViewHost"; 263 238 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); 265 241 this.operatorGraphViewHost.TabIndex = 0; 266 242 this.operatorGraphViewHost.ViewsLabelVisible = true; … … 295 271 protected HeuristicLab.MainForm.WindowsForms.ViewHost engineViewHost; 296 272 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; 300 274 301 275 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs
r12012 r13475 95 95 base.SetEnabledStateOfControls(); 96 96 engineViewHost.Enabled = Content != null; 97 newOperatorGraphButton.Enabled = false;98 openOperatorGraphButton.Enabled = false;99 97 operatorGraphViewHost.Enabled = Content != null; 100 98 operatorGraphViewHost.ReadOnly = true; -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs
r12012 r13475 51 51 this.CollapseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 52 this.CollapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 53 this.EditNodeLabelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();54 53 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 55 54 this.optimizersGroupBox.SuspendLayout(); … … 165 164 this.treeView.ImageIndex = 0; 166 165 this.treeView.ImageList = this.imageList; 167 this.treeView.LabelEdit = true;166 this.treeView.LabelEdit = false; 168 167 this.treeView.Location = new System.Drawing.Point(4, 34); 169 168 this.treeView.Name = "optimizerTreeView"; … … 220 219 // 221 220 this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 222 this.EditNodeLabelToolStripMenuItem,223 221 this.ExpandToolStripMenuItem, 224 222 this.ExpandAllToolStripMenuItem, … … 255 253 this.CollapseAllToolStripMenuItem.Text = "Collapse All"; 256 254 this.CollapseAllToolStripMenuItem.Click += new System.EventHandler(this.CollapseAllToolStripMenuItem_Click); 257 //258 // EditNodeLabelToolStripMenuItem259 //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);264 255 265 256 // … … 300 291 private System.Windows.Forms.ToolStripMenuItem CollapseToolStripMenuItem; 301 292 private System.Windows.Forms.ToolStripMenuItem CollapseAllToolStripMenuItem; 302 private System.Windows.Forms.ToolStripMenuItem EditNodeLabelToolStripMenuItem;303 293 304 294 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs
r12012 r13475 664 664 ExpandToolStripMenuItem.Enabled = ExpandToolStripMenuItem.Visible = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0; 665 665 CollapseToolStripMenuItem.Enabled = CollapseToolStripMenuItem.Visible = toolStripMenuNode.IsExpanded; 666 EditNodeLabelToolStripMenuItem.Enabled = EditNodeLabelToolStripMenuItem.Visible = !Locked && !ReadOnly && toolStripMenuNode.Tag != null && toolStripMenuNode.Tag is INamedItem && ((INamedItem)toolStripMenuNode.Tag).CanChangeName;667 666 } else { 668 667 ExpandToolStripMenuItem.Enabled = ExpandToolStripMenuItem.Visible = false; 669 668 CollapseToolStripMenuItem.Enabled = CollapseToolStripMenuItem.Visible = false; 670 EditNodeLabelToolStripMenuItem.Enabled = EditNodeLabelToolStripMenuItem.Visible = false;671 669 } 672 670 ExpandAllToolStripMenuItem.Enabled = ExpandAllToolStripMenuItem.Visible = !treeView.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x)); … … 687 685 private void CollapseAllToolStripMenuItem_Click(object sender, EventArgs e) { 688 686 treeView.CollapseAll(); 689 }690 private void EditNodeLabelToolStripMenuItem_Click(object sender, EventArgs e) {691 if (toolStripMenuNode != null) {692 if (!toolStripMenuNode.IsEditing) toolStripMenuNode.BeginEdit();693 }694 687 } 695 688 -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r12804 r13475 150 150 <Private>False</Private> 151 151 </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> 152 157 <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 153 158 <SpecificVersion>False</SpecificVersion> … … 344 349 <DependentUpon>RunCollectionEqualityConstraintView.cs</DependentUpon> 345 350 </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> 346 357 <Compile Include="RunCollectionViews\RunCollectionRLDView.cs"> 347 358 <SubType>UserControl</SubType> … … 379 390 <Compile Include="TimeLimitRunView.Designer.cs"> 380 391 <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> 381 398 </Compile> 382 399 <Compile Include="UserDefinedAlgorithmView.cs"> … … 447 464 <EmbeddedResource Include="CreateNewSingleEncodingDialog.resx"> 448 465 <DependentUpon>CreateNewSingleEncodingDialog.cs</DependentUpon> 466 </EmbeddedResource> 467 <EmbeddedResource Include="RunCollectionViews\RunCollectionIteratedSamplingView.resx"> 468 <DependentUpon>RunCollectionIteratedSamplingView.cs</DependentUpon> 449 469 </EmbeddedResource> 450 470 </ItemGroup> -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/Plugin.cs.frame
r12753 r13475 26 26 /// Plugin class for HeuristicLab.Optimization.Views plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Optimization.Views", "3.3.1 2.$WCREV$")]28 [Plugin("HeuristicLab.Optimization.Views", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization.Views-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/Properties/AssemblyInfo.cs.frame
r12753 r13475 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 2.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")] -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r12813 r13475 248 248 matrix[5, i] = seriesValues.StandardDeviation(); 249 249 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); 252 252 } 253 253 statisticsMatrixView.Content = matrix; -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
r12692 r13475 80 80 return; 81 81 } 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); 82 91 UpdateDataTableComboBox(); 83 92 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); 92 102 UpdateDataTableComboBox(); 93 103 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(); 106 105 } 107 106 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { … … 117 116 suppressUpdates = Content.UpdateOfRunsInProgress; 118 117 if (!suppressUpdates) { 118 foreach (var run in runMapping) 119 DeregisterRunEvents(run.Key); 120 runMapping.Clear(); 121 combinedDataTable.Rows.Clear(); 119 122 UpdateDataTableComboBox(); 120 UpdateDataRowComboBox();121 UpdateRuns(Content);122 123 } 123 124 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionRLDView.cs
r12956 r13475 463 463 ertTableView.DataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); 464 464 } 465 466 467 465 #endregion 468 466 -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs
r12692 r13475 25 25 using System.Linq; 26 26 using System.Windows.Forms; 27 using HeuristicLab.Collections; 27 28 using HeuristicLab.Core; 28 29 using HeuristicLab.Data.Views; … … 122 123 123 124 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; 127 127 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]; 130 130 else 131 131 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++) { 132 142 dataGridView.Columns[i].Visible = visibleColumnNames.Count == 0 || visibleColumnNames.Contains(dataGridView.Columns[i].HeaderText); 133 143 } 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)); 134 159 } 135 160 -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r12692 r13475 389 389 return; 390 390 ReadOnly = true; 391 391 392 try { 393 RunCollection.UpdateOfRunsInProgress = true; 392 394 RunCollection.Modify(); 393 395 } finally { 394 396 ReadOnly = false; 397 RunCollection.UpdateOfRunsInProgress = false; 395 398 } 396 399 } -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.Designer.cs
r12627 r13475 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/TimeLimitRunView.cs
r12627 r13475 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs
r12012 r13475 65 65 // 66 66 this.engineViewHost.Size = new System.Drawing.Size(693, 402); 67 //68 // openOperatorGraphButton69 //70 this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");71 this.openOperatorGraphButton.Click += new System.EventHandler(openOperatorGraphButton_Click);72 //73 // newOperatorGraphButton74 //75 this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");76 this.newOperatorGraphButton.Click += new System.EventHandler(newOperatorGraphButton_Click);77 67 // 78 68 // tabControl -
branches/PerformanceComparison/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r12012 r13475 57 57 base.SetEnabledStateOfControls(); 58 58 globalScopeView.Enabled = Content != null; 59 newOperatorGraphButton.Enabled = Content != null && !ReadOnly;60 openOperatorGraphButton.Enabled = Content != null && !ReadOnly;61 59 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 else80 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 }93 60 } 94 61 } -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs
r12012 r13475 67 67 } 68 68 } 69 [Storable] 69 70 private T solutionCreator; 70 71 public T SolutionCreator { -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r12764 r13475 209 209 <Compile Include="Interfaces\ISimilarityBasedOperator.cs" /> 210 210 <Compile Include="Interfaces\ISolutionSimilarityCalculator.cs" /> 211 <Compile Include="Interfaces\ITerminationBasedOperator.cs" /> 212 <Compile Include="Interfaces\ITerminator.cs" /> 211 213 <Compile Include="MetaOptimizers\BatchRun.cs" /> 212 214 <Compile Include="MetaOptimizers\Experiment.cs" /> 213 215 <Compile Include="MetaOptimizers\TimeLimitRun.cs" /> 214 216 <Compile Include="Results\ResultParameter.cs" /> 217 <Compile Include="RunCollection.cs"> 218 <SubType>Code</SubType> 219 </Compile> 215 220 <Compile Include="RunCollectionModification\RunCollectionRunRemover.cs" /> 216 221 <Compile Include="Plugin.cs" /> … … 220 225 <Compile Include="RunCollectionModification\RunCollectionValueRemover.cs" /> 221 226 <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" /> 222 234 <None Include="Plugin.cs.frame" /> 223 235 <Compile Include="Algorithms\Algorithm.cs" /> … … 265 277 <Compile Include="OptimizerList.cs" /> 266 278 <Compile Include="Interfaces\IOptimizer.cs" /> 267 <Compile Include="RunCollection.cs" />268 279 <Compile Include="Run.cs" /> 269 280 <Compile Include="Results\IResult.cs" /> -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Interfaces/ISolutionSimilarityCalculator.cs
r12085 r13475 30 30 string SolutionVariableName { get; set; } 31 31 string QualityVariableName { get; set; } 32 bool ExecuteInParallel { get; set; } 33 int MaxDegreeOfParallelism { get; set; } 32 34 33 35 /// <summary> -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs
r12504 r13475 24 24 using System.Drawing; 25 25 using System.Linq; 26 using System.Threading; 26 27 using HeuristicLab.Collections; 27 28 using HeuristicLab.Common; … … 345 346 346 347 private readonly object locker = new object(); 348 private readonly object runsLocker = new object(); 347 349 private void optimizer_ExceptionOccurred(object sender, EventArgs<Exception> e) { 348 350 lock (locker) … … 350 352 } 351 353 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 { 353 358 ExecutionTime = Optimizers.Aggregate(TimeSpan.Zero, (t, o) => t + o.ExecutionTime); 359 } 360 finally { 361 Monitor.Exit(locker); 362 } 354 363 } 355 364 private void optimizer_Paused(object sender, EventArgs e) { … … 378 387 } 379 388 private void optimizer_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 380 lock ( locker) {389 lock (runsLocker) { 381 390 Runs.RemoveRange(e.OldItems); 382 391 Runs.AddRange(e.Items); … … 384 393 } 385 394 private void optimizer_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) { 386 lock ( locker)395 lock (runsLocker) 387 396 Runs.AddRange(e.Items); 388 397 } 389 398 private void optimizer_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 390 lock ( locker)399 lock (runsLocker) 391 400 Runs.RemoveRange(e.Items); 392 401 } -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs
r12627 r13475 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Plugin.cs.frame
r12753 r13475 26 26 /// Plugin class for HeuristicLab.Optimization plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Optimization", "3.3.1 2.$WCREV$")]28 [Plugin("HeuristicLab.Optimization", "3.3.13.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/Properties/AssemblyInfo.cs.frame
r12753 r13475 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 2.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.13.$WCREV$")] -
branches/PerformanceComparison/HeuristicLab.Optimization/3.3/RunCollection.cs
r12692 r13475 483 483 #region Filtering 484 484 private void UpdateFiltering(bool reset) { 485 var oldUpateRuns = UpdateOfRunsInProgress;486 UpdateOfRunsInProgress = true;487 485 if (reset) 488 486 list.ForEach(r => r.Visible = true); 489 487 foreach (IRunCollectionConstraint constraint in this.constraints) 490 488 constraint.Check(); 491 UpdateOfRunsInProgress = oldUpateRuns;492 489 } 493 490 … … 539 536 protected virtual void Constraint_ConstraintOperationChanged(object sender, EventArgs e) { 540 537 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 } 543 545 } 544 546 protected virtual void Constraint_ConstraintDataChanged(object sender, EventArgs e) { 545 547 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 } 548 555 } 549 556 #endregion … … 551 558 #region Modification 552 559 public void Modify() { 553 var oldUpateRuns = UpdateOfRunsInProgress;554 UpdateOfRunsInProgress = true;555 560 var runs = this.ToList(); 556 561 var selectedRuns = runs.Where(r => r.Visible).ToList(); … … 566 571 } 567 572 } 568 UpdateOfRunsInProgress = oldUpateRuns;569 573 } 570 574 -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.Designer.cs
r12957 r13475 34 34 /// </summary> 35 35 private void InitializeComponent() { 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExpertSystemView)); 36 37 this.evaluationsLimitabel = new System.Windows.Forms.Label(); 37 38 this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox(); … … 50 51 this.algorithmInstancesViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 51 52 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(); 53 57 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 58 this.okbDownloadButton = new System.Windows.Forms.Button(); 54 59 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 60 this.tabControl.SuspendLayout(); … … 59 64 this.okbTabPage.SuspendLayout(); 60 65 this.problemInstancesTabPage.SuspendLayout(); 66 this.instancesDropPanel.SuspendLayout(); 61 67 this.SuspendLayout(); 62 68 // … … 83 89 // maxEvaluationsTextBox 84 90 // 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) 86 92 | System.Windows.Forms.AnchorStyles.Right))); 87 93 this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26); … … 94 100 // 95 101 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) 98 104 | System.Windows.Forms.AnchorStyles.Right))); 99 105 this.tabControl.Controls.Add(this.problemTabPage); … … 127 133 // problemViewHost 128 134 // 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) 131 137 | System.Windows.Forms.AnchorStyles.Right))); 132 138 this.problemViewHost.Caption = "View"; … … 143 149 // openProblemButton 144 150 // 145 this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;151 this.openProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("openProblemButton.Image"))); 146 152 this.openProblemButton.Location = new System.Drawing.Point(36, 6); 147 153 this.openProblemButton.Name = "openProblemButton"; … … 154 160 // newProblemButton 155 161 // 156 this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;162 this.newProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("newProblemButton.Image"))); 157 163 this.newProblemButton.Location = new System.Drawing.Point(6, 6); 158 164 this.newProblemButton.Name = "newProblemButton"; … … 178 184 // algorithmViewHost 179 185 // 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) 182 188 | System.Windows.Forms.AnchorStyles.Right))); 183 189 this.algorithmViewHost.Caption = "View"; … … 203 209 // suggestedInstancesComboBox 204 210 // 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) 206 212 | System.Windows.Forms.AnchorStyles.Right))); 207 213 this.suggestedInstancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 237 243 // okbTabPage 238 244 // 245 this.okbTabPage.Controls.Add(this.okbDownloadButton); 239 246 this.okbTabPage.Controls.Add(this.algorithmInstancesViewHost); 240 247 this.okbTabPage.Location = new System.Drawing.Point(4, 22); … … 248 255 // algorithmInstancesViewHost 249 256 // 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))); 250 260 this.algorithmInstancesViewHost.Caption = "View"; 251 261 this.algorithmInstancesViewHost.Content = null; 252 this.algorithmInstancesViewHost.Dock = System.Windows.Forms.DockStyle.Fill;253 262 this.algorithmInstancesViewHost.Enabled = false; 254 this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 3 );263 this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 35); 255 264 this.algorithmInstancesViewHost.Name = "algorithmInstancesViewHost"; 256 265 this.algorithmInstancesViewHost.ReadOnly = false; 257 this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 329);266 this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 297); 258 267 this.algorithmInstancesViewHost.TabIndex = 0; 259 268 this.algorithmInstancesViewHost.ViewsLabelVisible = true; … … 263 272 // 264 273 this.problemInstancesTabPage.Controls.Add(this.problemInstancesView); 274 this.problemInstancesTabPage.Controls.Add(this.instancesDropPanel); 275 this.problemInstancesTabPage.Controls.Add(this.refreshMapButton); 265 276 this.problemInstancesTabPage.Location = new System.Drawing.Point(4, 22); 266 277 this.problemInstancesTabPage.Name = "problemInstancesTabPage"; … … 273 284 // problemInstancesView 274 285 // 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"; 278 290 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); 281 293 this.problemInstancesView.Name = "problemInstancesView"; 282 294 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); 285 336 // 286 337 // openFileDialog … … 290 341 this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*"; 291 342 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); 292 353 // 293 354 // ExpertSystemView … … 313 374 this.okbTabPage.ResumeLayout(false); 314 375 this.problemInstancesTabPage.ResumeLayout(false); 376 this.instancesDropPanel.ResumeLayout(false); 377 this.instancesDropPanel.PerformLayout(); 315 378 this.ResumeLayout(false); 316 379 this.PerformLayout(); … … 337 400 private MainForm.WindowsForms.ViewHost algorithmInstancesViewHost; 338 401 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; 340 407 } 341 408 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.cs
r12860 r13475 21 21 22 22 using System; 23 using System.Collections; 23 24 using System.ComponentModel; 25 using System.IO; 26 using System.Linq; 24 27 using System.Windows.Forms; 28 using HeuristicLab.Clients.OKB.Administration; 29 using HeuristicLab.Clients.OKB.Query; 25 30 using HeuristicLab.Common; 31 using HeuristicLab.Common.Resources; 32 using HeuristicLab.Core; 26 33 using HeuristicLab.Core.Views; 27 34 using HeuristicLab.MainForm; 28 35 using HeuristicLab.Optimization; 36 using HeuristicLab.Persistence.Default.Xml; 29 37 using HeuristicLab.PluginInfrastructure; 30 38 … … 43 51 public ExpertSystemView() { 44 52 InitializeComponent(); 53 refreshMapButton.Text = string.Empty; 54 refreshMapButton.Image = VSImageLibrary.Refresh; 45 55 } 46 56 … … 83 93 runsView.Content = null; 84 94 algorithmInstancesViewHost.Content = null; 95 problemInstancesView.Content = null; 85 96 } else { 86 97 maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); … … 88 99 runsView.Content = Content.Runs; 89 100 algorithmInstancesViewHost.Content = Content.AlgorithmInstances; 101 problemInstancesView.Content = Content.ProblemInstances; 90 102 } 91 103 } finally { SuppressEvents = false; } … … 103 115 runsView.Enabled = Content != null; 104 116 algorithmInstancesViewHost.Enabled = Content != null; 117 refreshMapButton.Enabled = Content != null; 118 okbDownloadButton.Enabled = Content != null && Content.Problem != null && !ReadOnly && !Locked; 105 119 } 106 120 … … 131 145 try { 132 146 switch (e.PropertyName) { 147 case "AlgorithmInstances": algorithmInstancesViewHost.Content = Content.AlgorithmInstances; break; 133 148 case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break; 134 149 case "Problem": problemViewHost.Content = Content.Problem; break; 150 case "ProblemInstances": problemInstancesView.Content = Content.ProblemInstances; break; 135 151 } 136 152 } finally { SuppressEvents = false; } 153 SetEnabledStateOfControls(); 137 154 } 138 155 … … 233 250 } 234 251 #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 } 235 288 #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 } 236 324 } 237 325 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj
r12957 r13475 78 78 <Private>False</Private> 79 79 </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> 80 85 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 86 <SpecificVersion>False</SpecificVersion> … … 121 126 <SpecificVersion>False</SpecificVersion> 122 127 <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> 123 133 <Private>False</Private> 124 134 </Reference> … … 136 146 <Reference Include="System.Core" /> 137 147 <Reference Include="System.Drawing" /> 148 <Reference Include="System.Runtime.Serialization" /> 138 149 <Reference Include="System.Windows.Forms" /> 139 150 <Reference Include="System.Xml.Linq" /> … … 185 196 </ProjectReference> 186 197 </ItemGroup> 198 <ItemGroup> 199 <EmbeddedResource Include="ExpertSystemView.resx"> 200 <DependentUpon>ExpertSystemView.cs</DependentUpon> 201 </EmbeddedResource> 202 </ItemGroup> 187 203 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 188 204 <PropertyGroup> -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem/3.3/ExpertSystem.cs
r12957 r13475 71 71 algorithmInstances = value; 72 72 OnPropertyChanged("AlgorithmInstances"); 73 // TODO: Attach event handlers 73 74 } 74 75 } … … 155 156 var runCollection = sender as RunCollection; 156 157 if (runCollection != null && runCollection.UpdateOfRunsInProgress) return; 157 UpdateInstanceMap();158 158 UpdateSuggestions(); 159 159 } 160 160 161 p rivatevoid UpdateInstanceMap() {161 public void UpdateInstanceMap() { 162 162 var flaValues = ProblemInstances.ResultNames 163 163 .Where(x => x.StartsWith("Characteristic.") … … 203 203 } else instance.Results.Add("Projection.PCA2", new DoubleValue(y)); 204 204 205 instanceCounter++; 206 205 207 var bkQuality = ((DoubleValue)instance.Parameters["BestKnownQuality"]).Value; 206 208 var maximization = ((BoolValue)instance.Parameters["Maximization"]).Value; 209 210 if (!algInstRunDict.ContainsKey(probInstanceName)) continue; 207 211 foreach (var kvp in algInstRunDict[probInstanceName]) { 208 212 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))); 218 220 } 219 221 }
Note: See TracChangeset
for help on using the changeset viewer.