Changeset 12405 for branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
- Timestamp:
- 05/27/15 14:30:56 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r12404 r12405 116 116 get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 117 117 } 118 private IValueParameter<MultiTerminator> Terminat orsParameter {119 get { return (IValueParameter<MultiTerminator>)Parameters["Terminat or"]; }118 private IValueParameter<MultiTerminator> TerminationParameter { 119 get { return (IValueParameter<MultiTerminator>)Parameters["Termination"]; } 120 120 } 121 121 #endregion … … 204 204 } 205 205 private MultiTerminator Terminators { 206 get { return Terminat orsParameter.Value; }206 get { return TerminationParameter.Value; } 207 207 } 208 208 private RandomCreator RandomCreator { … … 287 287 Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue))); 288 288 Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true }); 289 Parameters.Add(new ValueParameter<MultiTerminator>("Terminat or", "The termination criteria which sould be checked.", new MultiTerminator()));289 Parameters.Add(new ValueParameter<MultiTerminator>("Termination", "The termination criteria which sould be checked.", new MultiTerminator())); 290 290 291 291 RandomCreator randomCreator = new RandomCreator(); … … 351 351 UpdateAnalyzers(); 352 352 353 generationsTerminator = new ComparisonTerminator<IntValue>("Generations", new IntValue(50), ComparisonType.GreaterOrEqual) { Name = "Generations" };354 evaluatedSolutionsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", "MaximumEvaluatedSolutions", ComparisonType.GreaterOrEqual) { Name = "Evaluations" };355 selectionPressureTerminator = new ComparisonTerminator<DoubleValue>("SelectionPressure", "MaximumSelectionPressure", ComparisonType.GreaterOrEqual) { Name = "Selection Pressure" };356 qualityTerminator = new ComparisonTerminator<DoubleValue>( ) { Name = "Quality" };357 executionTimeTerminator = new ExecutionTimeTerminator(this, TimeSpan.FromMinutes(5)) { Name = "Execution Time" };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" }; 357 executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5))) { Name = "Execution Time" }; 358 358 ParameterizeTerminators(); 359 359 UpdateTerminators(); … … 508 508 if (maximizationParameter != null) { 509 509 bool maximization = maximizationParameter.Value.Value; 510 qualityTerminator.Comparison = new Comparison(maximization ? ComparisonType.GreaterOrEqual : ComparisonType.LessOrEqual);511 qualityTerminator.Threshold Parameter.Value = new DoubleValue(maximization ? double.MaxValue : double.MinValue);510 qualityTerminator.Comparison = maximization ? ComparisonType.GreaterOrEqual : ComparisonType.LessOrEqual; 511 qualityTerminator.Threshold.Value = maximization ? double.MaxValue : double.MinValue; 512 512 } 513 513 } 514 qualityTerminator. ValueParameter.ActualName = qualityAnalyzer.CurrentBestQualityParameter.Name;514 qualityTerminator.ComparisonValueParameter.ActualName = qualityAnalyzer.CurrentBestQualityParameter.Name; 515 515 } 516 516 private void ParameterizeComparisonFactorModifiers() {
Note: See TracChangeset
for help on using the changeset viewer.