Changeset 12549 for branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState
- Timestamp:
- 06/30/15 12:41:43 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithm.cs
r12534 r12549 209 209 } 210 210 211 iterationsTerminator = new ComparisonTerminator<IntValue>("Iterations", ComparisonType.Less, new IntValue(1000)) { Name = "Iterations" }; 212 211 213 ParameterizeSelectors(); 214 UpdateTerminators(); 215 212 216 Initialize(); 213 217 } … … 222 226 UpdateCrossovers(); 223 227 UpdateMutators(); 228 UpdateTerminators(); 224 229 } 225 230 protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) { … … 238 243 UpdateCrossovers(); 239 244 UpdateMutators(); 245 UpdateTerminators(); 240 246 } 241 247 protected override void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { … … 308 314 309 315 #region Updates 310 protected override void UpdateTerminators() { 316 317 private void UpdateTerminators() { 311 318 var newTerminators = new Dictionary<ITerminator, bool> { 312 319 {iterationsTerminator, !Terminators.Operators.Contains(iterationsTerminator) || Terminators.Operators.ItemChecked(iterationsTerminator)}, 320 {evaluationsTerminator, Terminators.Operators.Contains(evaluationsTerminator) && Terminators.Operators.ItemChecked(evaluationsTerminator)}, 321 {qualityTerminator, Terminators.Operators.Contains(qualityTerminator) && Terminators.Operators.ItemChecked(qualityTerminator) }, 322 {executionTimeTerminator, Terminators.Operators.Contains(executionTimeTerminator) && Terminators.Operators.ItemChecked(executionTimeTerminator)} 313 323 }; 314 315 base.UpdateTerminators(); 324 if (Problem != null) { 325 foreach (var terminator in Problem.Operators.OfType<ITerminator>()) 326 newTerminators.Add(terminator, !Terminators.Operators.Contains(terminator) || Terminators.Operators.ItemChecked(terminator)); 327 } 328 329 Terminators.Operators.Clear(); 316 330 317 331 foreach (var newTerminator in newTerminators) 318 Terminators.Operators.Insert(0, newTerminator.Key, newTerminator.Value); 319 } 320 protected override void CreateTerminators() { 321 iterationsTerminator = new ComparisonTerminator<IntValue>("Iterations", ComparisonType.Less, new IntValue(1000)) { Name = "Iterations" }; 322 base.CreateTerminators(); 332 Terminators.Operators.Add(newTerminator.Key, newTerminator.Value); 323 333 } 324 334 private void UpdateCrossovers() {
Note: See TracChangeset
for help on using the changeset viewer.