- Timestamp:
- 01/12/18 13:33:23 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
r15287 r15603 64 64 } 65 65 } 66 67 [Storable] 68 private TimeSpan executionTime; 69 public TimeSpan ExecutionTime { 70 get { return executionTime; } 71 protected set { 72 executionTime = value; 73 OnExecutionTimeChanged(); 74 } 75 } 66 67 public abstract TimeSpan ExecutionTime { get; } 76 68 77 69 public virtual Type ProblemType { … … 133 125 : base() { 134 126 executionState = ExecutionState.Stopped; 135 executionTime = TimeSpan.Zero;136 127 storeAlgorithmInEachRun = false; 137 128 runsCounter = 0; … … 141 132 : base(name) { 142 133 executionState = ExecutionState.Stopped; 143 executionTime = TimeSpan.Zero;144 134 storeAlgorithmInEachRun = false; 145 135 runsCounter = 0; … … 149 139 : base(name, parameters) { 150 140 executionState = ExecutionState.Stopped; 151 executionTime = TimeSpan.Zero;152 141 storeAlgorithmInEachRun = false; 153 142 runsCounter = 0; … … 157 146 : base(name, description) { 158 147 executionState = ExecutionState.Stopped; 159 executionTime = TimeSpan.Zero;160 148 storeAlgorithmInEachRun = false; 161 149 runsCounter = 0; … … 165 153 : base(name, description, parameters) { 166 154 executionState = ExecutionState.Stopped; 167 executionTime = TimeSpan.Zero;168 155 storeAlgorithmInEachRun = false; 169 156 runsCounter = 0; … … 181 168 if (ExecutionState == ExecutionState.Started) throw new InvalidOperationException(string.Format("Clone not allowed in execution state \"{0}\".", ExecutionState)); 182 169 executionState = original.executionState; 183 executionTime = original.executionTime;184 170 problem = cloner.Clone(original.problem); 185 171 storeAlgorithmInEachRun = original.storeAlgorithmInEachRun; … … 259 245 if (handler != null) handler(this, EventArgs.Empty); 260 246 } 261 public event EventHandler ExecutionTimeChanged;262 protected virtual void OnExecutionTimeChanged() {263 EventHandler handler = ExecutionTimeChanged;264 if (handler != null) handler(this, EventArgs.Empty);265 }266 247 public event EventHandler ProblemChanged; 267 248 protected virtual void OnProblemChanged() { … … 276 257 public event EventHandler Prepared; 277 258 protected virtual void OnPrepared() { 278 ExecutionTime = TimeSpan.Zero;279 259 foreach (IStatefulItem statefulObject in this.GetObjectGraphObjects(new HashSet<object>() { Runs }).OfType<IStatefulItem>()) { 280 260 statefulObject.InitializeState(); … … 347 327 } 348 328 #endregion 329 330 [Obsolete("Deprecate, does nothing, needs to be removed from IExecutable")] 331 public event EventHandler ExecutionTimeChanged; 349 332 } 350 333 }
Note: See TracChangeset
for help on using the changeset viewer.