Changeset 5609 for branches/VNS/HeuristicLab.Operators/3.3/ScopeCleaner.cs
- Timestamp:
- 03/04/11 17:23:40 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VNS/HeuristicLab.Operators/3.3/ScopeCleaner.cs
r5445 r5609 24 24 using HeuristicLab.Parameters; 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Data; 26 27 27 28 namespace HeuristicLab.Operators { … … 38 39 get { return CurrentScopeParameter.ActualValue; } 39 40 } 41 public ValueParameter<BoolValue> ClearSubScopesParameter { 42 get { return (ValueParameter<BoolValue>)Parameters["ClearSubScopes"]; } 43 } 44 45 [StorableHook(HookType.AfterDeserialization)] 46 private void AfterDeserializationHook() { 47 #region Backwards Compatibility 48 if (!Parameters.ContainsKey("ClearSubScopes")) { 49 Parameters.Add(new ValueParameter<BoolValue>("ClearSubScopes", "Indicates, if the subscopes should be cleared.", new BoolValue(false))); 50 } 51 #endregion 52 } 40 53 41 54 [StorableConstructor] … … 47 60 : base() { 48 61 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope whose variables and sub-scopes should be removed.")); 62 Parameters.Add(new ValueParameter<BoolValue>("ClearSubScopes", "Indicates, if the subscopes should be cleared.", new BoolValue(false))); 49 63 } 50 64 … … 55 69 public override IOperation Apply() { 56 70 CurrentScope.Variables.Clear(); 57 CurrentScope.SubScopes.Clear(); 71 if(ClearSubScopesParameter.Value.Value) 72 CurrentScope.SubScopes.Clear(); 58 73 return base.Apply(); 59 74 }
Note: See TracChangeset
for help on using the changeset viewer.