- Timestamp:
- 10/29/10 16:58:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Optimization/3.3/Experiment.cs
r4551 r4665 128 128 stopPending = false; 129 129 } 130 131 130 [StorableHook(HookType.AfterDeserialization)] 131 private void AfterDeserialization() { 132 Initialize(); 133 } 134 protected Experiment(Experiment original, Cloner cloner) 135 : base(original, cloner) { 136 executionState = original.executionState; 137 executionTime = original.executionTime; 138 optimizers = cloner.Clone(original.optimizers); 139 runs = cloner.Clone(original.runs); 140 stopPending = original.stopPending; 141 Initialize(); 142 } 143 public override IDeepCloneable Clone(Cloner cloner) { 144 if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState)); 145 return new Experiment(this, cloner); 146 } 147 132 148 private void Initialize() { 133 149 RegisterOptimizersEvents(); … … 135 151 RegisterOptimizerEvents(optimizer); 136 152 if (runs != null) RegisterRunsEvents(); 137 }138 139 public override IDeepCloneable Clone(Cloner cloner) {140 if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState));141 Experiment clone = (Experiment)base.Clone(cloner);142 clone.executionState = executionState;143 clone.executionTime = executionTime;144 clone.optimizers = (OptimizerList)cloner.Clone(optimizers);145 clone.runs = (RunCollection)cloner.Clone(runs);146 clone.stopPending = stopPending;147 clone.Initialize();148 return clone;149 153 } 150 154
Note: See TracChangeset
for help on using the changeset viewer.