- Timestamp:
- 06/15/15 15:47:47 (9 years ago)
- Location:
- branches/TerminationCriteria
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r12412 r12447 114 114 get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; } 115 115 } 116 private IValueParameter<MultiTerminator> Terminat ionParameter {117 get { return (IValueParameter<MultiTerminator>)Parameters["Terminat ion"]; }116 private IValueParameter<MultiTerminator> TerminatorParameter { 117 get { return (IValueParameter<MultiTerminator>)Parameters["Terminator"]; } 118 118 } 119 119 #endregion … … 197 197 } 198 198 private MultiTerminator Terminators { 199 get { return Terminat ionParameter.Value; }199 get { return TerminatorParameter.Value; } 200 200 } 201 201 private RandomCreator RandomCreator { … … 279 279 Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer())); 280 280 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 }); 281 Parameters.Add(new ValueParameter<MultiTerminator>("Terminat ion", "The termination criteria which sould be checked.", new MultiTerminator()));281 Parameters.Add(new ValueParameter<MultiTerminator>("Terminator", "The termination criteria which sould be checked.", new MultiTerminator())); 282 282 283 283 RandomCreator randomCreator = new RandomCreator(); -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/ComparisonTerminator.cs
r12436 r12447 40 40 } 41 41 42 public ComparisonType Comparison {42 public ComparisonType ComparisonType { 43 43 get { return ComparisonParameter.Value.Value; } 44 44 set { ComparisonParameter.Value.Value = value; } … … 67 67 Initialize(); 68 68 } 69 public ComparisonTerminator(string comparisonValueActualName, ComparisonType comparison , T threshold)69 public ComparisonTerminator(string comparisonValueActualName, ComparisonType comparisonType, T threshold) 70 70 : this(threshold) { 71 71 ComparisonValueParameter.ActualName = comparisonValueActualName; 72 Comparison = comparison;72 ComparisonType = comparisonType; 73 73 } 74 public ComparisonTerminator(string comparisonValueActualName, ComparisonType comparison , IFixedValueParameter<T> thresholdParameter)74 public ComparisonTerminator(string comparisonValueActualName, ComparisonType comparisonType, IFixedValueParameter<T> thresholdParameter) 75 75 : this() { 76 76 ComparisonValueParameter.ActualName = comparisonValueActualName; 77 Comparison = comparison;77 ComparisonType = comparisonType; 78 78 ThresholdParameter = thresholdParameter; 79 79 } … … 83 83 IComparable rhs = ThresholdParameter.Value; 84 84 85 return Comparison .Compare(lhs, rhs);85 return ComparisonType.Compare(lhs, rhs); 86 86 } 87 87 88 88 private void Initialize() { 89 ComparisonParameter.Value.ValueChanged += new EventHandler(Comparison _ValueChanged);89 ComparisonParameter.Value.ValueChanged += new EventHandler(ComparisonType_ValueChanged); 90 90 } 91 private void Comparison _ValueChanged(object sender, EventArgs e) {92 OnComparison Changed();91 private void ComparisonType_ValueChanged(object sender, EventArgs e) { 92 OnComparisonTypeChanged(); 93 93 } 94 protected virtual void OnComparison Changed() {94 protected virtual void OnComparisonTypeChanged() { 95 95 OnToStringChanged(); 96 96 } … … 103 103 public override string ToString() { 104 104 if (Threshold == null) return Name; 105 else return string.Format("{0} {1} {2}", Name, Comparison .ToSymbol(), ThresholdParameter.Value);105 else return string.Format("{0} {1} {2}", Name, ComparisonType.ToSymbol(), ThresholdParameter.Value); 106 106 } 107 107 } -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/SingleObjectiveQualityTerminator.cs
r12444 r12447 43 43 if (maximizationParameter != null) { 44 44 bool maximization = maximizationParameter.Value.Value; 45 Comparison = maximization ? ComparisonType.Less : ComparisonType.Greater;45 ComparisonType = maximization ? ComparisonType.Less : ComparisonType.Greater; 46 46 Threshold.Value = maximization ? double.MaxValue : double.MinValue; 47 47 } -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/TerminationOperator.cs
r12444 r12447 31 31 [StorableClass] 32 32 public sealed class TerminationOperator : InstrumentedOperator, ITerminationBasedOperator { 33 public ILookupParameter<ITerminator> Terminat ionParameter {34 get { return (ILookupParameter<ITerminator>)Parameters["Terminat ion"]; }33 public ILookupParameter<ITerminator> TerminatorParameter { 34 get { return (ILookupParameter<ITerminator>)Parameters["Terminator"]; } 35 35 } 36 36 public ILookupParameter<BoolValue> TerminateParameter { … … 64 64 public TerminationOperator() 65 65 : base() { 66 Parameters.Add(new LookupParameter<ITerminator>("Terminat ion", "The termination criteria which sould be checked."));66 Parameters.Add(new LookupParameter<ITerminator>("Terminator", "The termination criteria which sould be checked.")); 67 67 Parameters.Add(new LookupParameter<BoolValue>("Terminate", "The parameter which will be set to determine if execution should be terminated or schould continue.")); 68 68 Parameters.Add(new OperatorParameter("ContinueBranch", "The operator which is executed if no termination criteria has met.")); … … 74 74 75 75 var placeholder = new Placeholder() { Name = "Check termination criteria (Placeholder)" }; 76 placeholder.OperatorParameter.ActualName = Terminat ionParameter.Name;76 placeholder.OperatorParameter.ActualName = TerminatorParameter.Name; 77 77 78 78 BeforeExecutionOperators.Add(assigner);
Note: See TracChangeset
for help on using the changeset viewer.