Changeset 15290


Ignore:
Timestamp:
07/27/17 10:06:10 (9 months ago)
Author:
jkarder
Message:

#2258: fixed MultiTrajectoryAnalysis

Location:
branches/FitnessLandscapeAnalysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape.Views/MultiTrajectory/MultiTrajectoryView.cs

    r7128 r15290  
    136136    }
    137137    private void startButton_Click(object sender, System.EventArgs e) {
    138       Content.Start();
     138      Content.StartAsync();
    139139    }
    140140    private void pauseButton_Click(object sender, System.EventArgs e) {
  • branches/FitnessLandscapeAnalysis/HeuristicLab.Analysis.FitnessLandscape/MultiTrajectory/MultiTrajectoryAnalysis.cs

    r7202 r15290  
    11using System;
    2 using System.Linq;
    32using System.Collections.Generic;
     3using System.Drawing;
     4using System.Threading;
     5using System.Threading.Tasks;
    46using HeuristicLab.Common;
     7using HeuristicLab.Common.Resources;
    58using HeuristicLab.Core;
    69using HeuristicLab.Data;
     10using HeuristicLab.Encodings.BinaryVectorEncoding;
     11using HeuristicLab.Encodings.PermutationEncoding;
     12using HeuristicLab.Encodings.RealVectorEncoding;
    713using HeuristicLab.Optimization;
    814using HeuristicLab.Parameters;
    915using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    1016using HeuristicLab.PluginInfrastructure;
    11 using HeuristicLab.Encodings.BinaryVectorEncoding;
    12 using HeuristicLab.Encodings.RealVectorEncoding;
    13 using HeuristicLab.Encodings.PermutationEncoding;
    14 using HeuristicLab.Common.Resources;
    15 using System.Drawing;
    1617
    1718namespace HeuristicLab.Analysis.FitnessLandscape.MultiTrajectory {
     
    314315      if (handler != null)
    315316        handler(this, EventArgs.Empty);
    316     }   
     317    }
    317318    protected virtual void OnStoreAlgorithmInEachRunChanged() {
    318319      EventHandler handler = StoreAlgorithmInEachRunChanged;
     
    445446
    446447    public void Start() {
     448      Start(CancellationToken.None);
     449    }
     450    public void Start(CancellationToken cancellationToken) {
    447451      running = true;
    448452      ExecutionState = ExecutionState.Started;
    449453      PerformNextStep();
     454    }
     455    public async Task StartAsync() { await StartAsync(CancellationToken.None); }
     456    public async Task StartAsync(CancellationToken cancellationToken) {
     457      await AsyncHelper.DoAsync(Start, cancellationToken);
    450458    }
    451459
     
    524532        values.Add(string.Format("{0}.{1}", prefix, value.Key), value.Value);
    525533      }
    526     }   
     534    }
    527535
    528536    protected virtual void CreateRun() {
     
    642650      OnProblemChanged();
    643651    }
    644     void Algorithm_Runs_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IRun> e) {     
     652    void Algorithm_Runs_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IRun> e) {
    645653      if (subAlgorithmRuns != null)
    646654        foreach (var run in e.Items) {
     
    686694          (PreassignedSolutionCreator == null || !(PreassignedSolutionCreator is IRealVectorCreator)))
    687695          PreassignedSolutionCreator = new PreassignedRealVectorCreator();
    688         else if (problem.SolutionCreator is IPermutationCreator && 
     696        else if (problem.SolutionCreator is IPermutationCreator &&
    689697          (PreassignedSolutionCreator == null || !(PreassignedSolutionCreator is IPermutationCreator)))
    690           PreassignedSolutionCreator = new PreassignePermutationCreator();       
    691       }     
     698          PreassignedSolutionCreator = new PreassignePermutationCreator();
     699      }
    692700    }
    693701    #endregion
Note: See TracChangeset for help on using the changeset viewer.