Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/12 13:07:00 (12 years ago)
Author:
mkommend
Message:

#1783: Corrected tool tips in optimizer views and last errors in batchrun execution state handling.

File:
1 edited

Legend:

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

    r8189 r8190  
    153153    }
    154154
     155    private bool batchRunPrepared = false;
    155156    private bool batchRunStarted = false;
    156157    private bool batchRunPaused = false;
     
    206207      batchRunPaused = original.batchRunPaused;
    207208      batchRunStopped = original.batchRunStopped;
     209      batchRunPrepared = original.batchRunPrepared;
    208210      Initialize();
    209211    }
     
    228230        repetitionsCounter = 0;
    229231        if (clearRuns) runs.Clear();
    230         Optimizer.Prepare(clearRuns);
     232        batchRunPrepared = true;
    231233        batchRunStarted = false;
    232234        batchRunPaused = false;
    233235        batchRunStopped = false;
     236        Optimizer.Prepare(clearRuns);
    234237      } else {
    235238        ExecutionState = ExecutionState.Stopped;
     
    241244      if (Optimizer == null) return;
    242245
     246      batchRunPrepared = false;
    243247      batchRunStarted = true;
    244248      batchRunPaused = false;
     
    253257      if (Optimizer.ExecutionState != ExecutionState.Started) return;
    254258
     259      batchRunPrepared = false;
    255260      batchRunStarted = false;
    256261      batchRunPaused = true;
     
    262267        throw new InvalidOperationException(string.Format("Stop not allowed in execution state \"{0}\".", ExecutionState));
    263268      if (Optimizer == null) return;
    264       if (Optimizer.ExecutionState != ExecutionState.Started && Optimizer.ExecutionState != ExecutionState.Paused) return;
     269      if (Optimizer.ExecutionState != ExecutionState.Started && Optimizer.ExecutionState != ExecutionState.Paused) {
     270        OnStopped();
     271        return;
     272      }
     273
     274      batchRunPrepared = false;
    265275      batchRunStarted = false;
    266276      batchRunPaused = false;
     
    292302    public event EventHandler Prepared;
    293303    private void OnPrepared() {
     304      batchRunPrepared = false;
    294305      ExecutionState = ExecutionState.Prepared;
    295306      EventHandler handler = Prepared;
     
    298309    public event EventHandler Started;
    299310    private void OnStarted() {
     311      //TODO add coment
    300312      ExecutionState = ExecutionState.Started;
    301313      EventHandler handler = Started;
     
    304316    public event EventHandler Paused;
    305317    private void OnPaused() {
     318      batchRunPaused = false;
    306319      ExecutionState = ExecutionState.Paused;
    307320      EventHandler handler = Paused;
     
    310323    public event EventHandler Stopped;
    311324    private void OnStopped() {
     325      //reset flags because it cannot be done if the optimizer gets prepared
     326      batchRunStopped = false;
    312327      ExecutionState = ExecutionState.Stopped;
    313328      EventHandler handler = Stopped;
     
    354369    }
    355370    private void Optimizer_Prepared(object sender, EventArgs e) {
    356       if (ExecutionState == ExecutionState.Stopped || !batchRunStarted) {
     371      if (batchRunPrepared || (ExecutionState == ExecutionState.Stopped)) {
    357372        ExecutionTime = TimeSpan.Zero;
    358373        runsExecutionTime = TimeSpan.Zero;
     374        repetitionsCounter = 0;
    359375        OnPrepared();
    360376      }
Note: See TracChangeset for help on using the changeset viewer.