Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 08:56:15 (14 years ago)
Author:
cneumuel
Message:

#1215

  • minor changes
Location:
branches/HeuristicLab.MetaOptimization
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/HeuristicLab.MetaOptimization.Test.csproj

    r6017 r6445  
    379379  </ItemGroup>
    380380  <ItemGroup>
     381    <Compile Include="ObjectDumper.cs" />
    381382    <Compile Include="Program.cs" />
    382383    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.MetaOptimization.Test/Program.cs

    r6421 r6445  
    6363
    6464
     65      bool y = ParameterConfiguration.IsSubclassOfRawGeneric(typeof(Tuple<,,,>), typeof(Tuple<,>));
     66      bool a = ParameterConfiguration.IsSubclassOfRawGeneric(typeof(Tuple<>), typeof(Tuple<int>));
     67
     68
    6569      var x = typeof(float).IsPrimitive;
    6670
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/AlgorithmExecutor.cs

    r6421 r6445  
    2222using System;
    2323using System.Threading;
    24 using HeuristicLab.Optimization;
     24using HeuristicLab.Core;
    2525
    2626namespace HeuristicLab.Problems.MetaOptimization {
    2727  public static class AlgorithmExtensions {
    28     public static void StartSync(this IAlgorithm algorithm, CancellationToken cancellationToken) {
    29       var executor = new AlgorithmExecutor(algorithm, cancellationToken);
     28    public static void StartSync(this IExecutable executable, CancellationToken cancellationToken) {
     29      var executor = new AlgorithmExecutor(executable, cancellationToken);
    3030      executor.StartSync();
    3131    }
     
    3636  /// </summary>
    3737  internal class AlgorithmExecutor {
    38     private IAlgorithm algorithm;
     38    private IExecutable executable;
    3939    private AutoResetEvent waitHandle = new AutoResetEvent(false);
    4040    private CancellationToken cancellationToken;
    4141
    42     public AlgorithmExecutor(IAlgorithm algorithm, CancellationToken cancellationToken) {
    43       this.algorithm = algorithm;
     42    public AlgorithmExecutor(IExecutable executable, CancellationToken cancellationToken) {
     43      this.executable = executable;
    4444      this.cancellationToken = cancellationToken;
    4545    }
    4646
    4747    public void StartSync() {
    48       algorithm.Stopped += new EventHandler(algorithm_Stopped);
    49       algorithm.Paused += new EventHandler(algorithm_Paused);
     48      executable.Stopped += new EventHandler(algorithm_Stopped);
     49      executable.Paused += new EventHandler(algorithm_Paused);
    5050
    5151      using (CancellationTokenRegistration registration = cancellationToken.Register(new Action(cancellationToken_Canceled))) {
    52         algorithm.Start();
     52        executable.Start();
    5353        waitHandle.WaitOne();
    5454        waitHandle.Dispose();
    5555      }
    5656
    57       algorithm.Stopped -= new EventHandler(algorithm_Stopped);
    58       algorithm.Paused -= new EventHandler(algorithm_Paused);
    59       if (algorithm.ExecutionState == Core.ExecutionState.Started) {
    60         algorithm.Pause();
     57      executable.Stopped -= new EventHandler(algorithm_Stopped);
     58      executable.Paused -= new EventHandler(algorithm_Paused);
     59      if (executable.ExecutionState == Core.ExecutionState.Started) {
     60        executable.Pause();
    6161      }
    6262      cancellationToken.ThrowIfCancellationRequested();
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurations/ParameterConfiguration.cs

    r6421 r6445  
    316316        return null;
    317317      }
     318     
    318319    }
    319320
     
    351352    }
    352353
    353     private static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) {
     354    public static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) {
    354355      while (toCheck != typeof(object)) {
    355356        var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck;
Note: See TracChangeset for help on using the changeset viewer.