Changeset 4722 for trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs
- Timestamp:
- 11/06/10 01:56:04 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/CloningRefactoring (added) merged: 4656-4693,4696-4697,4711-4714,4718-4719
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs
r4533 r4722 167 167 stopPending = false; 168 168 } 169 170 169 [StorableHook(HookType.AfterDeserialization)] 170 private void AfterDeserialization() { 171 Initialize(); 172 } 173 174 private BatchRun(BatchRun original, Cloner cloner) 175 : base(original, cloner) { 176 executionState = original.executionState; 177 executionTime = original.executionTime; 178 algorithm = cloner.Clone(original.algorithm); 179 repetitions = original.repetitions; 180 repetitionsCounter = original.repetitionsCounter; 181 runs = cloner.Clone(original.runs); 182 stopPending = original.stopPending; 183 Initialize(); 184 } 185 public override IDeepCloneable Clone(Cloner cloner) { 186 if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState)); 187 return new BatchRun(this, cloner); 188 } 189 171 190 private void Initialize() { 172 191 if (algorithm != null) RegisterAlgorithmEvents(); 173 192 if (runs != null) RegisterRunsEvents(); 174 }175 176 public override IDeepCloneable Clone(Cloner cloner) {177 if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState));178 BatchRun clone = (BatchRun)base.Clone(cloner);179 clone.executionState = executionState;180 clone.executionTime = executionTime;181 clone.algorithm = (IAlgorithm)cloner.Clone(algorithm);182 clone.repetitions = repetitions;183 clone.repetitionsCounter = repetitionsCounter;184 clone.runs = (RunCollection)cloner.Clone(runs);185 clone.stopPending = stopPending;186 clone.Initialize();187 return clone;188 193 } 189 194
Note: See TracChangeset
for help on using the changeset viewer.