Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/18/12 12:56:25 (12 years ago)
Author:
mkommend
Message:

#1043: Implemented display of calculated repetitions of a batchrun in the experiment tree view by adapting the text of the batchrun node to "Batchrun-Name x/y".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs

    r8194 r8668  
    130130    [Storable]
    131131    private int repetitionsCounter;
     132    public int RepetitionsCounter {
     133      get { return repetitionsCounter; }
     134      private set {
     135        if (value != repetitionsCounter) {
     136          repetitionsCounter = value;
     137          OnRepetitionsCounterChanged();
     138        }
     139      }
     140    }
    132141
    133142    [Storable]
     
    224233      if (Optimizer != null) {
    225234        ExecutionTime = TimeSpan.Zero;
    226         repetitionsCounter = 0;
     235        RepetitionsCounter = 0;
    227236        if (clearRuns) runs.Clear();
    228237        batchRunAction = BatchRunAction.Prepare;
    229238        // a race-condition may occur when the optimizer has changed the state by itself in the meantime
    230         try { Optimizer.Prepare(clearRuns); } catch (InvalidOperationException) { }
     239        try { Optimizer.Prepare(clearRuns); }
     240        catch (InvalidOperationException) { }
    231241      } else {
    232242        ExecutionState = ExecutionState.Stopped;
     
    240250      if (Optimizer.ExecutionState == ExecutionState.Stopped) Optimizer.Prepare();
    241251      // a race-condition may occur when the optimizer has changed the state by itself in the meantime
    242       try { Optimizer.Start(); } catch (InvalidOperationException) { }
     252      try { Optimizer.Start(); }
     253      catch (InvalidOperationException) { }
    243254    }
    244255    public void Pause() {
     
    249260      if (Optimizer.ExecutionState != ExecutionState.Started) return;
    250261      // a race-condition may occur when the optimizer has changed the state by itself in the meantime
    251       try { Optimizer.Pause(); } catch (InvalidOperationException) { }
     262      try { Optimizer.Pause(); }
     263      catch (InvalidOperationException) { }
    252264    }
    253265    public void Stop() {
     
    261273      }
    262274      // a race-condition may occur when the optimizer has changed the state by itself in the meantime
    263       try { Optimizer.Stop(); } catch (InvalidOperationException) { }
     275      try { Optimizer.Stop(); }
     276      catch (InvalidOperationException) { }
    264277    }
    265278
     
    283296    private void OnRepetitionsChanged() {
    284297      EventHandler handler = RepetitionsChanged;
     298      if (handler != null) handler(this, EventArgs.Empty);
     299    }
     300    public event EventHandler RepetetionsCounterChanged;
     301    private void OnRepetitionsCounterChanged() {
     302      EventHandler handler = RepetetionsCounterChanged;
    285303      if (handler != null) handler(this, EventArgs.Empty);
    286304    }
     
    356374        ExecutionTime = TimeSpan.Zero;
    357375        runsExecutionTime = TimeSpan.Zero;
    358         repetitionsCounter = 0;
     376        RepetitionsCounter = 0;
    359377        OnPrepared();
    360378      }
     
    365383    }
    366384    private void Optimizer_Stopped(object sender, EventArgs e) {
    367       repetitionsCounter++;
     385      RepetitionsCounter++;
    368386      ExecutionTime += runsExecutionTime;
    369387      runsExecutionTime = TimeSpan.Zero;
Note: See TracChangeset for help on using the changeset viewer.