Changeset 4098 for trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3
- Timestamp:
- 07/25/10 01:04:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/ArtificialAntProblem.cs
r4068 r4098 42 42 [StorableClass] 43 43 public sealed class ArtificialAntProblem : ParameterizedNamedItem, ISingleObjectiveProblem { 44 44 45 public override Image ItemImage { 45 46 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; } … … 180 181 get { return BestKnownQualityParameter.Value; } 181 182 } 182 private List<IOperator> operators;183 183 public IEnumerable<IOperator> Operators { 184 184 get { return operators; } … … 190 190 #endregion 191 191 192 [Storable] 193 private List<IOperator> operators; 194 195 [StorableConstructor] 196 private ArtificialAntProblem(bool deserializing) : base() { } 192 197 public ArtificialAntProblem() 193 198 : base() { … … 212 217 ParameterizeSolutionCreator(); 213 218 ParameterizeEvaluator(); 214 Initialize(); 215 } 216 217 [StorableConstructor] 218 private ArtificialAntProblem(bool deserializing) : base() { } 219 InitializeOperators(); 220 AttachEventHandlers(); 221 } 219 222 220 223 public override IDeepCloneable Clone(Cloner cloner) { 221 224 ArtificialAntProblem clone = (ArtificialAntProblem)base.Clone(cloner); 222 clone.Initialize(); 225 clone.operators = operators.Select(x => (IOperator)cloner.Clone(x)).ToList(); 226 clone.AttachEventHandlers(); 223 227 return clone; 224 228 } … … 274 278 #region Helpers 275 279 [StorableHook(HookType.AfterDeserialization)] 276 private void Initialize() { 277 InitializeOperators(); 280 private void AttachEventHandlers() { 281 // Start BackwardsCompatibility3.3 (remove with 3.4) 282 if (operators == null) InitializeOperators(); 283 // End BackwardsCompatibility3.3 278 284 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 279 285 SolutionCreator.SymbolicExpressionTreeParameter.ActualNameChanged += new EventHandler(SolutionCreator_SymbolicExpressionTreeParameter_ActualNameChanged);
Note: See TracChangeset
for help on using the changeset viewer.