Changeset 12364 for branches/TerminationCriteria
- Timestamp:
- 04/29/15 16:34:33 (9 years ago)
- Location:
- branches/TerminationCriteria
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
r12356 r12364 351 351 UpdateAnalyzers(); 352 352 353 maximumGenerationsTerminationCriterion = new ComparisonTerminationCriterion<IntValue>("Generations", "MaximumGenerations", ComparisonType.GreaterOrEqual) { Name = "Maximum Generations" };353 maximumGenerationsTerminationCriterion = new ComparisonTerminationCriterion<IntValue>("Generations", new IntValue(50), ComparisonType.GreaterOrEqual) { Name = "Maximum Generations" }; 354 354 maximumEvaluatedSolutionsTerminationCriterion = new ComparisonTerminationCriterion<IntValue>("EvaluatedSolutions", "MaximumEvaluatedSolutions", ComparisonType.GreaterOrEqual) { Name = "Maximum Evaluations" }; 355 355 maximumSelectionPressureTerminationCriterion = new ComparisonTerminationCriterion<DoubleValue>("SelectionPressure", "MaximumSelectionPressure", ComparisonType.GreaterOrEqual) { Name = "Maximum Selection Pressure" }; -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/ComparisonTerminationCriterion.cs
r12328 r12364 48 48 [StorableConstructor] 49 49 protected ComparisonTerminationCriterion(bool deserializing) : base(deserializing) { } 50 [StorableHook(HookType.AfterDeserialization)] 51 private void AfterDeserialization() { 52 Initialize(); 53 } 50 54 protected ComparisonTerminationCriterion(ComparisonTerminationCriterion<T> original, Cloner cloner) 51 55 : base(original, cloner) { 56 Initialize(); 52 57 } 53 58 public override IDeepCloneable Clone(Cloner cloner) { … … 59 64 Parameters.Add(new ValueLookupParameter<T>("RightSide", "The right side of the comparison.")); 60 65 Parameters.Add(new ValueParameter<Comparison>("Comparison", "The type of comparison.", new Comparison(ComparisonType.GreaterOrEqual)) { Hidden = true }); 66 67 Initialize(); 61 68 } 62 69 public ComparisonTerminationCriterion(string leftSideActualName, string rightSideActualName, ComparisonType comparison = ComparisonType.GreaterOrEqual) … … 71 78 RightSideParameter.Value = rightSideValue; 72 79 Comparison.Value = comparison; 80 } 81 82 private void Initialize() { 83 RightSideParameter.ToStringChanged += (s, a) => OnToStringChanged(); 73 84 } 74 85 … … 95 106 } 96 107 } 108 109 public override string ToString() { 110 if (RightSideParameter.Value == null) return Name; 111 else return Name + ": " + RightSideParameter.Value; 112 } 97 113 } 98 114 } -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/Views/ComparisonTerminationCriterionView.cs
r12362 r12364 44 44 viewHost.Content = null; 45 45 if (Content != null) { 46 viewHost.Content = Content.RightSideParameter; 46 if (Content.RightSideParameter.Value != null) 47 viewHost.Content = Content.RightSideParameter.Value; 48 else 49 viewHost.Content = Content.RightSideParameter; 47 50 } 48 51 }
Note: See TracChangeset
for help on using the changeset viewer.