Changeset 12407 for branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
- Timestamp:
- 05/28/15 09:47:23 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r12405 r12407 351 351 UpdateAnalyzers(); 352 352 353 generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType. GreaterOrEqual, new IntValue(50)) { Name = "Generations" };354 evaluatedSolutionsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType. GreaterOrEqual, new IntValue(int.MaxValue)) { Name = "Evaluations" };355 selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", ComparisonType. GreaterOrEqual, new DoubleValue(200)) { Name = "Selection Pressure" };356 qualityTerminator = new ComparisonTerminator<DoubleValue>( threshold:new DoubleValue()) { Name = "Quality" };353 generationsTerminator = new ComparisonTerminator<IntValue>("Generations", ComparisonType.Less, new IntValue(50)) { Name = "Generations" }; 354 evaluatedSolutionsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(int.MaxValue)) { Name = "Evaluations" }; 355 selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", ComparisonType.Less, new DoubleValue(200)) { Name = "Selection Pressure" }; 356 qualityTerminator = new ComparisonTerminator<DoubleValue>(new DoubleValue()) { Name = "Quality" }; 357 357 executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5))) { Name = "Execution Time" }; 358 358 ParameterizeTerminators(); … … 508 508 if (maximizationParameter != null) { 509 509 bool maximization = maximizationParameter.Value.Value; 510 qualityTerminator.Comparison = maximization ? ComparisonType. GreaterOrEqual : ComparisonType.LessOrEqual;511 qualityTerminator.Threshold.Value = maximization ? double.M axValue : double.MinValue;510 qualityTerminator.Comparison = maximization ? ComparisonType.Less : ComparisonType.Greater; 511 qualityTerminator.Threshold.Value = maximization ? double.MinValue : double.MaxValue; 512 512 } 513 513 }
Note: See TracChangeset
for help on using the changeset viewer.