Changeset 12447 for branches/TerminationCriteria/HeuristicLab.Termination/3.3/ComparisonTerminator.cs
- Timestamp:
- 06/15/15 15:47:47 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.