Changeset 12548 for branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Alps.cs
- Timestamp:
- 06/30/15 12:40:20 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Alps.cs
r12531 r12548 162 162 #region Preconfigured Terminators 163 163 [Storable] 164 pr ivateComparisonTerminator<IntValue> evaluationsTerminator;164 protected ComparisonTerminator<IntValue> evaluationsTerminator; 165 165 [Storable] 166 pr ivateSingleObjectiveQualityTerminator qualityTerminator;166 protected SingleObjectiveQualityTerminator qualityTerminator; 167 167 [Storable] 168 pr ivateExecutionTimeTerminator executionTimeTerminator;168 protected ExecutionTimeTerminator executionTimeTerminator; 169 169 #endregion 170 170 … … 201 201 layerQualityAnalyzer = new BestAverageWorstQualityAnalyzer(); 202 202 203 evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" }; 204 qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" }; 205 executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5))); 206 203 207 ParameterizeAgeLimits(); 204 208 ParameterizeAgeInheritanceReduction(); … … 207 211 UpdateAnalyzers(); 208 212 209 CreateTerminators();210 213 ParameterizeTerminators(); 211 UpdateTerminators();212 214 213 215 Initialize(); … … 231 233 ParameterizeTerminators(); 232 234 UpdateAnalyzers(); 233 UpdateTerminators();234 235 Problem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 235 236 } … … 262 263 ParameterizeStochasticOperator(@operator); 263 264 UpdateAnalyzers(); 264 UpdateTerminators();265 265 base.Problem_OperatorsChanged(sender, e); 266 266 } … … 410 410 } 411 411 } 412 protected virtual void UpdateTerminators() {413 var newTerminators = new Dictionary<ITerminator, bool> {414 {evaluationsTerminator, Terminators.Operators.Contains(evaluationsTerminator) && Terminators.Operators.ItemChecked(evaluationsTerminator)},415 {qualityTerminator, Terminators.Operators.Contains(qualityTerminator) && Terminators.Operators.ItemChecked(qualityTerminator) },416 {executionTimeTerminator, Terminators.Operators.Contains(executionTimeTerminator) && Terminators.Operators.ItemChecked(executionTimeTerminator)}417 };418 if (Problem != null) {419 foreach (var terminator in Problem.Operators.OfType<ITerminator>())420 newTerminators.Add(terminator, !Terminators.Operators.Contains(terminator) || Terminators.Operators.ItemChecked(terminator));421 }422 423 Terminators.Operators.Clear();424 425 foreach (var newTerminator in newTerminators)426 Terminators.Operators.Add(newTerminator.Key, newTerminator.Value);427 }428 protected virtual void CreateTerminators() {429 evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" };430 qualityTerminator = new SingleObjectiveQualityTerminator() { Name = "Quality" };431 executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));432 }433 412 #endregion 434 413 }
Note: See TracChangeset
for help on using the changeset viewer.