Changeset 3275
- Timestamp:
- 04/06/10 03:37:29 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.GeneticAlgorithm/3.3/GeneticAlgorithm.cs
r3274 r3275 179 179 } 180 180 181 public override void Prepare( bool clearResults) {182 if (Problem != null) base.Prepare( clearResults);181 public override void Prepare() { 182 if (Problem != null) base.Prepare(); 183 183 } 184 184 -
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r3274 r3275 154 154 } 155 155 156 public override void Prepare( bool clearResults) {156 public override void Prepare() { 157 157 if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null) 158 base.Prepare( clearResults);158 base.Prepare(); 159 159 } 160 160 -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r3274 r3275 182 182 } 183 183 184 public override void Prepare( bool clearResults) {184 public override void Prepare() { 185 185 if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null) 186 base.Prepare( clearResults);186 base.Prepare(); 187 187 } 188 188 -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r3274 r3275 176 176 } 177 177 178 public override void Prepare( bool clearResults) {178 public override void Prepare() { 179 179 if (Problem != null && MoveGenerator != null && MoveMaker != null && MoveEvaluator != null && 180 180 TabuMoveEvaluator != null && TabuMoveMaker != null) 181 base.Prepare( clearResults);181 base.Prepare(); 182 182 } 183 183 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs
r3262 r3275 64 64 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 65 65 this.stopButton = new System.Windows.Forms.Button(); 66 this.runsTabPage = new System.Windows.Forms.TabPage(); 67 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 66 68 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 67 69 this.tabControl.SuspendLayout(); … … 69 71 this.problemTabPage.SuspendLayout(); 70 72 this.resultsTabPage.SuspendLayout(); 73 this.runsTabPage.SuspendLayout(); 71 74 this.SuspendLayout(); 72 75 // … … 89 92 this.tabControl.Controls.Add(this.problemTabPage); 90 93 this.tabControl.Controls.Add(this.resultsTabPage); 94 this.tabControl.Controls.Add(this.runsTabPage); 91 95 this.tabControl.Location = new System.Drawing.Point(0, 52); 92 96 this.tabControl.Name = "tabControl"; … … 281 285 this.stopButton.UseVisualStyleBackColor = true; 282 286 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); 287 // 288 // runsTabPage 289 // 290 this.runsTabPage.Controls.Add(this.runsView); 291 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 292 this.runsTabPage.Name = "runsTabPage"; 293 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 294 this.runsTabPage.Size = new System.Drawing.Size(671, 374); 295 this.runsTabPage.TabIndex = 3; 296 this.runsTabPage.Text = "Runs"; 297 this.runsTabPage.UseVisualStyleBackColor = true; 298 // 299 // runsView 300 // 301 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 302 | System.Windows.Forms.AnchorStyles.Left) 303 | System.Windows.Forms.AnchorStyles.Right))); 304 this.runsView.Caption = "RunCollection"; 305 this.runsView.Content = null; 306 this.runsView.Location = new System.Drawing.Point(6, 6); 307 this.runsView.Name = "runsView"; 308 this.runsView.Size = new System.Drawing.Size(659, 362); 309 this.runsView.TabIndex = 0; 283 310 // 284 311 // AlgorithmView … … 311 338 this.problemTabPage.ResumeLayout(false); 312 339 this.resultsTabPage.ResumeLayout(false); 340 this.runsTabPage.ResumeLayout(false); 313 341 this.ResumeLayout(false); 314 342 this.PerformLayout(); … … 336 364 protected HeuristicLab.Optimization.Views.ResultCollectionView resultsView; 337 365 protected System.Windows.Forms.Button stopButton; 366 protected System.Windows.Forms.TabPage runsTabPage; 367 protected RunCollectionView runsView; 338 368 339 369 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r3274 r3275 96 96 problemViewHost.Content = null; 97 97 resultsView.Content = null; 98 runsView.Content = null; 98 99 tabControl.Enabled = false; 99 100 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; … … 106 107 problemViewHost.Content = Content.Problem; 107 108 resultsView.Content = Content.Results.AsReadOnly(); 109 runsView.Content = Content.Runs; 108 110 tabControl.Enabled = true; 109 111 EnableDisableButtons(); … … 144 146 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = Content.ExecutionState != ExecutionState.Started; 145 147 problemViewHost.Enabled = Content.ExecutionState != ExecutionState.Started; 146 resultsView.Enabled = Content.ExecutionState != ExecutionState.Started;147 148 EnableDisableButtons(); 148 149 } … … 237 238 } 238 239 protected virtual void resetButton_Click(object sender, EventArgs e) { 239 if (Content.R esults.Count > 0) {240 if (MessageBox.Show(this, "Clear all r esults of this run?", "Clear All Results?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)240 if (Content.Runs.Count > 0) { 241 if (MessageBox.Show(this, "Clear all runs executed so far?", "Clear All Runs?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) 241 242 Content.Prepare(true); 242 243 else -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.Designer.cs
r3274 r3275 47 47 this.tabControl = new System.Windows.Forms.TabControl(); 48 48 this.optimizersTabPage = new System.Windows.Forms.TabPage(); 49 this.optimizerListView = new HeuristicLab.Optimization.Views.OptimizerListView(); 49 50 this.startButton = new System.Windows.Forms.Button(); 50 51 this.stopButton = new System.Windows.Forms.Button(); … … 53 54 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 54 55 this.pauseButton = new System.Windows.Forms.Button(); 55 this.optimizerListView = new HeuristicLab.Optimization.Views.OptimizerListView(); 56 this.runsTabPage = new System.Windows.Forms.TabPage(); 57 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 56 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 57 59 this.tabControl.SuspendLayout(); 58 60 this.optimizersTabPage.SuspendLayout(); 61 this.runsTabPage.SuspendLayout(); 59 62 this.SuspendLayout(); 60 63 // … … 75 78 | System.Windows.Forms.AnchorStyles.Right))); 76 79 this.tabControl.Controls.Add(this.optimizersTabPage); 80 this.tabControl.Controls.Add(this.runsTabPage); 77 81 this.tabControl.Location = new System.Drawing.Point(0, 52); 78 82 this.tabControl.Name = "tabControl"; … … 91 95 this.optimizersTabPage.Text = "Optimizers"; 92 96 this.optimizersTabPage.UseVisualStyleBackColor = true; 97 // 98 // optimizerListView 99 // 100 this.optimizerListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 101 | System.Windows.Forms.AnchorStyles.Left) 102 | System.Windows.Forms.AnchorStyles.Right))); 103 this.optimizerListView.Caption = "OptimizerList"; 104 this.optimizerListView.Content = null; 105 this.optimizerListView.Location = new System.Drawing.Point(6, 6); 106 this.optimizerListView.Name = "optimizerListView"; 107 this.optimizerListView.Size = new System.Drawing.Size(659, 362); 108 this.optimizerListView.TabIndex = 0; 93 109 // 94 110 // startButton … … 159 175 this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click); 160 176 // 161 // optimizerListView 162 // 163 this.optimizerListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 177 // runsTabPage 178 // 179 this.runsTabPage.Controls.Add(this.runsView); 180 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 181 this.runsTabPage.Name = "runsTabPage"; 182 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 183 this.runsTabPage.Size = new System.Drawing.Size(671, 374); 184 this.runsTabPage.TabIndex = 2; 185 this.runsTabPage.Text = "Runs"; 186 this.runsTabPage.UseVisualStyleBackColor = true; 187 // 188 // runsView 189 // 190 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 164 191 | System.Windows.Forms.AnchorStyles.Left) 165 192 | System.Windows.Forms.AnchorStyles.Right))); 166 this. optimizerListView.Caption = "OptimizerList";167 this. optimizerListView.Content = null;168 this. optimizerListView.Location = new System.Drawing.Point(6, 6);169 this. optimizerListView.Name = "optimizerListView";170 this. optimizerListView.Size = new System.Drawing.Size(659, 362);171 this. optimizerListView.TabIndex = 0;193 this.runsView.Caption = "RunCollection"; 194 this.runsView.Content = null; 195 this.runsView.Location = new System.Drawing.Point(6, 6); 196 this.runsView.Name = "runsView"; 197 this.runsView.Size = new System.Drawing.Size(659, 362); 198 this.runsView.TabIndex = 0; 172 199 // 173 200 // ExperimentView … … 198 225 this.tabControl.ResumeLayout(false); 199 226 this.optimizersTabPage.ResumeLayout(false); 227 this.runsTabPage.ResumeLayout(false); 200 228 this.ResumeLayout(false); 201 229 this.PerformLayout(); … … 213 241 private System.Windows.Forms.Button pauseButton; 214 242 private OptimizerListView optimizerListView; 243 private System.Windows.Forms.TabPage runsTabPage; 244 private RunCollectionView runsView; 215 245 216 246 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r3274 r3275 71 71 if (Content == null) { 72 72 optimizerListView.Content = null; 73 runsView.Content = null; 73 74 tabControl.Enabled = false; 74 75 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; … … 77 78 } else { 78 79 optimizerListView.Content = Content.Optimizers; 80 runsView.Content = Content.Runs; 79 81 tabControl.Enabled = true; 80 82 EnableDisableButtons(); … … 125 127 } 126 128 private void resetButton_Click(object sender, EventArgs e) { 127 if (MessageBox.Show(this, "Clear all runs executed so far?", "Clear All Runs?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) 128 Content.Prepare(true); 129 else 130 Content.Prepare(false); 129 if (Content.Runs.Count > 0) { 130 if (MessageBox.Show(this, "Clear all runs executed so far?", "Clear All Runs?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) 131 Content.Prepare(true); 132 else 133 Content.Prepare(false); 134 } else { 135 Content.Prepare(); 136 } 131 137 } 132 138 #endregion -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs
r3262 r3275 76 76 this.tabControl.Controls.SetChildIndex(this.globalScopeTabPage, 0); 77 77 this.tabControl.Controls.SetChildIndex(this.operatorGraphTabPage, 0); 78 this.tabControl.Controls.SetChildIndex(this.runsTabPage, 0); 78 79 this.tabControl.Controls.SetChildIndex(this.resultsTabPage, 0); 79 80 this.tabControl.Controls.SetChildIndex(this.engineTabPage, 0); -
trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs
r3274 r3275 90 90 public abstract ResultCollection Results { get; } 91 91 92 [Storable] 93 private RunCollection runs; 94 public RunCollection Runs { 95 get { return runs; } 96 } 97 92 98 protected Algorithm() 93 99 : base() { 94 100 executionState = ExecutionState.Stopped; 95 101 executionTime = TimeSpan.Zero; 102 runs = new RunCollection(); 96 103 } 97 104 protected Algorithm(string name) … … 99 106 executionState = ExecutionState.Stopped; 100 107 executionTime = TimeSpan.Zero; 108 runs = new RunCollection(); 101 109 } 102 110 protected Algorithm(string name, ParameterCollection parameters) … … 104 112 executionState = ExecutionState.Stopped; 105 113 executionTime = TimeSpan.Zero; 114 runs = new RunCollection(); 106 115 } 107 116 protected Algorithm(string name, string description) … … 109 118 executionState = ExecutionState.Stopped; 110 119 executionTime = TimeSpan.Zero; 120 runs = new RunCollection(); 111 121 } 112 122 protected Algorithm(string name, string description, ParameterCollection parameters) … … 114 124 executionState = ExecutionState.Stopped; 115 125 executionTime = TimeSpan.Zero; 126 runs = new RunCollection(); 116 127 } 117 128 … … 121 132 clone.executionTime = executionTime; 122 133 clone.Problem = (IProblem)cloner.Clone(problem); 134 clone.runs = (RunCollection)cloner.Clone(runs); 123 135 return clone; 124 136 } 125 137 126 public void Prepare() { 127 Prepare(true); 128 } 129 public virtual void Prepare(bool clearResults) { 138 public virtual void Prepare() { 130 139 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused) && (ExecutionState != ExecutionState.Stopped)) 131 140 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); 132 ExecutionTime = TimeSpan.Zero; 141 } 142 public void Prepare(bool clearRuns) { 143 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused) && (ExecutionState != ExecutionState.Stopped)) 144 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); 145 if (clearRuns) runs.Clear(); 146 Prepare(); 133 147 } 134 148 public virtual void Start() { … … 172 186 public event EventHandler Prepared; 173 187 protected virtual void OnPrepared() { 188 ExecutionTime = TimeSpan.Zero; 174 189 ExecutionState = ExecutionState.Prepared; 175 190 EventHandler handler = Prepared; … … 190 205 public event EventHandler Stopped; 191 206 protected virtual void OnStopped() { 207 Run run = new Run("Run (" + ExecutionTime.ToString() + ")"); 208 CollectParameterValues(run.Parameters); 209 CollectResultValues(run.Results); 210 runs.Add(run); 192 211 ExecutionState = ExecutionState.Stopped; 193 212 EventHandler handler = Stopped; -
trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs
r3274 r3275 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Collections; 27 28 28 29 namespace HeuristicLab.Optimization { … … 83 84 if (algorithm != null) RegisterAlgorithmEvents(); 84 85 OnAlgorithmChanged(); 85 Prepare( );86 Prepare(true); 86 87 } 87 88 } … … 97 98 OnRepetitionsChanged(); 98 99 if ((runs.Count < repetitions) && (Algorithm != null) && (Algorithm.ExecutionState == ExecutionState.Stopped)) 99 Prepare( false);100 Prepare(); 100 101 } 101 102 } … … 145 146 146 147 public void Prepare() { 147 Prepare( true);148 } 149 public void Prepare(bool clearR esults) {148 Prepare(false); 149 } 150 public void Prepare(bool clearRuns) { 150 151 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused) && (ExecutionState != ExecutionState.Stopped)) 151 152 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); 152 153 if (Algorithm != null) { 153 if (clearR esults) {154 if (clearRuns) { 154 155 ExecutionTime = TimeSpan.Zero; 155 156 runs.Clear(); 156 157 } 157 Algorithm.Prepare( );158 Algorithm.Prepare(clearRuns); 158 159 } 159 160 } … … 233 234 algorithm.Started += new EventHandler(Algorithm_Started); 234 235 algorithm.Stopped += new EventHandler(Algorithm_Stopped); 236 algorithm.Runs.CollectionReset += new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_CollectionReset); 237 algorithm.Runs.ItemsAdded += new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_ItemsAdded); 238 algorithm.Runs.ItemsRemoved += new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_ItemsRemoved); 235 239 } 236 240 private void DeregisterAlgorithmEvents() { … … 241 245 algorithm.Started -= new EventHandler(Algorithm_Started); 242 246 algorithm.Stopped -= new EventHandler(Algorithm_Stopped); 243 } 244 247 algorithm.Runs.CollectionReset -= new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_CollectionReset); 248 algorithm.Runs.ItemsAdded -= new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_ItemsAdded); 249 algorithm.Runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<Run>(Algorithm_Runs_ItemsRemoved); 250 } 245 251 private void Algorithm_ExceptionOccurred(object sender, EventArgs<Exception> e) { 246 252 OnExceptionOccurred(e.Value); … … 261 267 private void Algorithm_Stopped(object sender, EventArgs e) { 262 268 ExecutionTime += Algorithm.ExecutionTime; 263 runs.Add(new Run("Run " + Algorithm.ExecutionTime.ToString(), Algorithm));264 269 OnStopped(); 265 270 … … 269 274 } 270 275 } 276 private void Algorithm_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<Run> e) { 277 Runs.RemoveRange(e.OldItems); 278 Runs.AddRange(e.Items); 279 } 280 private void Algorithm_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<Run> e) { 281 Runs.AddRange(e.Items); 282 } 283 private void Algorithm_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Run> e) { 284 Runs.RemoveRange(e.Items); 285 } 271 286 #endregion 272 287 } -
trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs
r3274 r3275 157 157 } 158 158 159 public override void Prepare(bool clearResults) { 160 base.Prepare(clearResults); 161 162 ResultCollection results = Results; 159 public override void Prepare() { 160 base.Prepare(); 163 161 globalScope.Clear(); 164 if (clearResults) 165 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 166 else 167 globalScope.Variables.Add(new Variable("Results", results)); 162 globalScope.Variables.Add(new Variable("Results", new ResultCollection())); 168 163 169 164 if (engine != null) { -
trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs
r3274 r3275 77 77 } 78 78 79 [Storable] 80 private RunCollection runs; 81 public RunCollection Runs { 82 get { return runs; } 83 } 84 79 85 private bool stopPending; 80 86 … … 84 90 executionTime = TimeSpan.Zero; 85 91 Optimizers = new OptimizerList(); 92 runs = new RunCollection(); 86 93 stopPending = false; 87 94 } … … 90 97 executionTime = TimeSpan.Zero; 91 98 Optimizers = new OptimizerList(); 99 runs = new RunCollection(); 92 100 stopPending = false; 93 101 } … … 96 104 executionTime = TimeSpan.Zero; 97 105 Optimizers = new OptimizerList(); 106 runs = new RunCollection(); 98 107 stopPending = false; 99 108 } … … 104 113 clone.executionTime = executionTime; 105 114 clone.Optimizers = (OptimizerList)cloner.Clone(optimizers); 115 clone.runs = (RunCollection)cloner.Clone(runs); 106 116 clone.stopPending = stopPending; 107 117 return clone; … … 109 119 110 120 public void Prepare() { 111 Prepare( true);112 } 113 public void Prepare(bool clearR esults) {121 Prepare(false); 122 } 123 public void Prepare(bool clearRuns) { 114 124 if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused) && (ExecutionState != ExecutionState.Stopped)) 115 125 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); 116 126 if (Optimizers.Count > 0) { 127 if (clearRuns) runs.Clear(); 117 128 foreach (IOptimizer optimizer in Optimizers.Where(x => x.ExecutionState != ExecutionState.Started)) 118 optimizer.Prepare(clearR esults);129 optimizer.Prepare(clearRuns); 119 130 } 120 131 } … … 233 244 optimizer.Started += new EventHandler(optimizer_Started); 234 245 optimizer.Stopped += new EventHandler(optimizer_Stopped); 235 } 236 246 optimizer.Runs.CollectionReset += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_CollectionReset); 247 optimizer.Runs.ItemsAdded += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsAdded); 248 optimizer.Runs.ItemsRemoved += new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsRemoved); 249 } 237 250 private void DeregisterOptimizerEvents(IOptimizer optimizer) { 238 251 optimizer.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); … … 242 255 optimizer.Started -= new EventHandler(optimizer_Started); 243 256 optimizer.Stopped -= new EventHandler(optimizer_Stopped); 257 optimizer.Runs.CollectionReset -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_CollectionReset); 258 optimizer.Runs.ItemsAdded -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsAdded); 259 optimizer.Runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<Run>(optimizer_Runs_ItemsRemoved); 244 260 } 245 261 private void optimizer_ExceptionOccurred(object sender, EventArgs<Exception> e) { … … 275 291 } 276 292 } 293 private void optimizer_Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<Run> e) { 294 Runs.RemoveRange(e.OldItems); 295 Runs.AddRange(e.Items); 296 } 297 private void optimizer_Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<Run> e) { 298 Runs.AddRange(e.Items); 299 } 300 private void optimizer_Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<Run> e) { 301 Runs.RemoveRange(e.Items); 302 } 277 303 #endregion 278 304 } -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IOptimizer.cs
r3274 r3275 26 26 /// Interface to represent optimizers such as algorithms, batch runs, or experiments. 27 27 /// </summary> 28 public interface IOptimizer : IExecutable { 29 void Prepare(bool clearResults); 28 public interface IOptimizer : INamedItem, IExecutable { 29 RunCollection Runs { get; } 30 31 void Prepare(bool clearRuns); 30 32 } 31 33 } -
trunk/sources/HeuristicLab.Optimization/3.3/Run.cs
r3260 r3275 59 59 results = new Dictionary<string, IItem>(); 60 60 } 61 public Run(string name, IAlgorithm algorithm)62 : base(name) {63 parameters = new Dictionary<string, IItem>();64 results = new Dictionary<string, IItem>();65 algorithm.CollectParameterValues(parameters);66 algorithm.CollectResultValues(results);67 }68 61 public Run(string name, string description) 69 62 : base(name, description) { 70 63 parameters = new Dictionary<string, IItem>(); 71 64 results = new Dictionary<string, IItem>(); 72 }73 public Run(string name, string description, IAlgorithm algorithm)74 : base(name, description) {75 parameters = new Dictionary<string, IItem>();76 results = new Dictionary<string, IItem>();77 algorithm.CollectParameterValues(parameters);78 algorithm.CollectResultValues(results);79 65 } 80 66
Note: See TracChangeset
for help on using the changeset viewer.