- Timestamp:
- 07/25/10 01:04:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.OneMax/3.3/OnemaxProblem.cs
r3797 r4098 97 97 get { return BestKnownQualityParameter.Value; } 98 98 } 99 private List<IOperator> operators;100 99 public IEnumerable<IOperator> Operators { 101 100 get { return operators.Cast<IOperator>(); } … … 106 105 #endregion 107 106 107 [Storable] 108 private List<IOperator> operators; 109 110 [StorableConstructor] 111 private OneMaxProblem(bool deserializing) : base() { } 108 112 public OneMaxProblem() 109 113 : base() { … … 122 126 ParameterizeEvaluator(); 123 127 124 Initialize(); 125 } 126 127 [StorableConstructor] 128 private OneMaxProblem(bool deserializing) : base() { } 128 InitializeOperators(); 129 AttachEventHandlers(); 130 } 129 131 130 132 public override IDeepCloneable Clone(Cloner cloner) { 131 133 OneMaxProblem clone = (OneMaxProblem)base.Clone(cloner); 132 clone.Initialize(); 134 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 135 clone.AttachEventHandlers(); 133 136 return clone; 134 137 } … … 195 198 #region Helpers 196 199 [StorableHook(HookType.AfterDeserialization)] 197 private void Initialize() { 198 InitializeOperators(); 200 private void AttachEventHandlers() { 201 // Start BackwardsCompatibility3.3 (remove with 3.4) 202 if (operators == null) InitializeOperators(); 203 // End BackwardsCompatibility3.3 199 204 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 200 205 SolutionCreator.BinaryVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_BinaryVectorParameter_ActualNameChanged);
Note: See TracChangeset
for help on using the changeset viewer.