- Timestamp:
- 11/28/12 11:03:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RuntimeOptimizer/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs
r8956 r8961 78 78 private int snapshotTimesIndex; 79 79 [Storable] 80 private ObservableList< double> snapshotTimes;81 public ObservableList< double> SnapshotTimes {80 private ObservableList<TimeSpan> snapshotTimes; 81 public ObservableList<TimeSpan> SnapshotTimes { 82 82 get { return snapshotTimes; } 83 83 set { … … 170 170 : base(original, cloner) { 171 171 maximumExecutionTime = original.maximumExecutionTime; 172 snapshotTimes = new ObservableList< double>(original.snapshotTimes);172 snapshotTimes = new ObservableList<TimeSpan>(original.snapshotTimes); 173 173 snapshotTimesIndex = original.snapshotTimesIndex; 174 174 snapshots = cloner.Clone(original.snapshots); … … 200 200 description = ItemDescription; 201 201 maximumExecutionTime = TimeSpan.FromMinutes(1); 202 snapshotTimes = new ObservableList< double>(new[] {203 TimeSpan.FromSeconds(5) .TotalMilliseconds,204 TimeSpan.FromSeconds(10) .TotalMilliseconds,205 TimeSpan.FromSeconds(30) .TotalMilliseconds});202 snapshotTimes = new ObservableList<TimeSpan>(new[] { 203 TimeSpan.FromSeconds(5), 204 TimeSpan.FromSeconds(10), 205 TimeSpan.FromSeconds(30) }); 206 206 snapshotTimesIndex = 0; 207 207 snapTimer = new Timer() { … … 223 223 description = ItemDescription; 224 224 maximumExecutionTime = TimeSpan.FromMinutes(1); 225 snapshotTimes = new ObservableList< double>(new[] {226 TimeSpan.FromSeconds(5) .TotalMilliseconds,227 TimeSpan.FromSeconds(10) .TotalMilliseconds,228 TimeSpan.FromSeconds(30) .TotalMilliseconds});225 snapshotTimes = new ObservableList<TimeSpan>(new[] { 226 TimeSpan.FromSeconds(5), 227 TimeSpan.FromSeconds(10), 228 TimeSpan.FromSeconds(30) }); 229 229 snapshotTimesIndex = 0; 230 230 snapTimer = new Timer() { … … 245 245 : base(name, description) { 246 246 maximumExecutionTime = TimeSpan.FromMinutes(1); 247 snapshotTimes = new ObservableList< double>(new[] {248 TimeSpan.FromSeconds(5) .TotalMilliseconds,249 TimeSpan.FromSeconds(10) .TotalMilliseconds,250 TimeSpan.FromSeconds(30) .TotalMilliseconds});247 snapshotTimes = new ObservableList<TimeSpan>(new[] { 248 TimeSpan.FromSeconds(5), 249 TimeSpan.FromSeconds(10), 250 TimeSpan.FromSeconds(30) }); 251 251 snapshotTimesIndex = 0; 252 252 snapTimer = new Timer() { … … 320 320 var execTime = ExecutionTime; 321 321 if (snapshotTimesIndex < SnapshotTimes.Count && 322 SnapshotTimes[snapshotTimesIndex] <= execTime .TotalMilliseconds) {322 SnapshotTimes[snapshotTimesIndex] <= execTime) { 323 323 DoSnapshot(); 324 324 snapshotTimesIndex++; … … 345 345 private void FindNextSnapshotTimeIndex(TimeSpan reference) { 346 346 var index = 0; 347 while (index < snapshotTimes.Count && (snapshotTimes[index] - reference.TotalMilliseconds) <= 0) {347 while (index < snapshotTimes.Count && snapshotTimes[index] <= reference) { 348 348 index++; 349 349 };
Note: See TracChangeset
for help on using the changeset viewer.