Changeset 12414
- Timestamp:
- 06/02/15 16:21:17 (10 years ago)
- Location:
- branches/TerminationCriteria/HeuristicLab.Termination/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TerminationCriteria/HeuristicLab.Termination/3.3/MultiTerminator.cs
r12405 r12414 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Drawing; 24 25 using System.Linq; … … 66 67 return next; 67 68 } 69 70 public override void CollectParameterValues(IDictionary<string, IItem> values) { 71 foreach (var opParam in OperatorParameters) { 72 var op = opParam.Value; 73 var @checked = Operators.ItemChecked(op); 74 if (!@checked) continue; 75 var children = GetCollectedValues(opParam); 76 foreach (var c in children) { 77 if (String.IsNullOrEmpty(c.Key)) 78 values.Add(opParam.Name, new StringValue(opParam.Value.ToString())); 79 else values.Add(opParam.Name + "." + c.Key, c.Value); 80 } 81 } 82 } 68 83 } 69 84 } -
branches/TerminationCriteria/HeuristicLab.Termination/3.3/Terminator.cs
r12413 r12414 32 32 [Item("Terminator", "A base class for all termination criteria.")] 33 33 [StorableClass] 34 public abstract class Terminator : InstrumentedOperator, ITerminator {34 public abstract class Terminator : SingleSuccessorOperator, ITerminator { 35 35 public static new Image StaticItemImage { 36 36 get { return HeuristicLab.Common.Resources.VSImageLibrary.FlagRed; } … … 50 50 } 51 51 52 public sealed override IOperation InstrumentedApply() {52 public sealed override IOperation Apply() { 53 53 if (!TerminateParameter.ActualValue.Value) { // If terminate flag is already set, no need to check further termination criteria. 54 54 bool terminate = !CheckContinueCriterion(); 55 55 TerminateParameter.ActualValue = new BoolValue(terminate); 56 56 } 57 return base. InstrumentedApply();57 return base.Apply(); 58 58 } 59 59 … … 62 62 public override void CollectParameterValues(IDictionary<string, IItem> values) { 63 63 base.CollectParameterValues(values); 64 values["Description"] = new StringValue(ToString());65 64 values["Type"] = new StringValue(GetType().GetPrettyName(false)); 66 65 }
Note: See TracChangeset
for help on using the changeset viewer.