Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13469


Ignore:
Timestamp:
12/15/15 15:16:24 (7 years ago)
Author:
mkommend
Message:

#2521: Refactored problem base classes and adapted scheduling encoding, scheduling problem and unit tests.

Location:
branches/ProblemRefactoring
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleCreator.cs

    r13437 r13469  
    2525
    2626namespace HeuristicLab.Encodings.ScheduleEncoding {
    27   public interface IScheduleCreator : ISolutionCreator<ISchedule>, IScheduleOperator {
    28     ILookupParameter<ISchedule> ScheduleParameter { get; }
     27  public interface IScheduleCreator<TSchedule> : ISolutionCreator<TSchedule>, IScheduleOperator
     28  where TSchedule : class,ISchedule {
     29    ILookupParameter<TSchedule> ScheduleParameter { get; }
    2930    IValueLookupParameter<IntValue> JobsParameter { get; }
    3031    IValueLookupParameter<IntValue> ResourcesParameter { get; }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Interfaces/IScheduleDecoder.cs

    r13443 r13469  
    3030    Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData);
    3131  }
     32
     33  public interface IScheduleDecoder<TSchedule> : IScheduleDecoder
     34    where TSchedule : class, ISchedule {
     35    Schedule DecodeSchedule(TSchedule solution, ItemList<Job> jobData);
     36  }
    3237}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMDecoder.cs

    r13449 r13469  
    3434  [Item("JobSequenceMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequence Matrix.")]
    3535  [StorableClass]
    36   public class JSMDecoder : ScheduleDecoder {
     36  public class JSMDecoder : ScheduleDecoder<JSMEncoding> {
    3737
    3838    public IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>> DecodingErrorPolicyParameter {
     
    130130    }
    131131
    132     public override Schedule DecodeSchedule(ISchedule encoding, ItemList<Job> jobData) {
    133       var solution = encoding as JSMEncoding;
    134       if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding");
    135       return DecodeSchedule(solution, jobData, DecodingErrorPolicy, ForcingStrategy);
     132    public override Schedule DecodeSchedule(JSMEncoding encoding, ItemList<Job> jobData) {
     133      return Decode(encoding, jobData, DecodingErrorPolicy, ForcingStrategy);
    136134    }
    137135
    138     public static Schedule DecodeSchedule(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
     136    public static Schedule Decode(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
    139137      var random = new FastRandom(solution.RandomSeed);
    140138      var jobs = (ItemList<Job>)jobData.Clone();
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs

    r13443 r13469  
    3030  [Item("JobSequenceMatrixCreator", "Creator class used to create Job Sequence Matrix solutions for standard JobShop scheduling problems.")]
    3131  [StorableClass]
    32   public class JSMRandomCreator : ScheduleCreator, IStochasticOperator {
     32  public class JSMRandomCreator : ScheduleCreator<JSMEncoding>, IStochasticOperator {
    3333
    3434    public ILookupParameter<IRandom> RandomParameter {
     
    5656    }
    5757
    58     protected override ISchedule CreateSolution() {
     58    protected override JSMEncoding CreateSolution() {
    5959      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    6060    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Decoder/PWRDecoder.cs

    r13443 r13469  
    2828  [Item("PWRDecoder", "An item used to convert a PWR-individual into a generalized schedule.")]
    2929  [StorableClass]
    30   public class PWRDecoder : ScheduleDecoder {
     30  public class PWRDecoder : ScheduleDecoder<PWREncoding> {
    3131    [StorableConstructor]
    3232    protected PWRDecoder(bool deserializing) : base(deserializing) { }
     
    3838    }
    3939
    40     public override Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData) {
    41       var pwr = solution as PWREncoding;
    42       if (pwr == null) throw new InvalidOperationException("Encoding is not of type PWREncoding");
    43       return DecodeSchedule(pwr, jobData);
     40    public override Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     41      return Decode(solution, jobData);
    4442    }
    4543
    46     public static Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     44    public static Schedule Decode(PWREncoding solution, ItemList<Job> jobData) {
    4745      var jobs = (ItemList<Job>)jobData.Clone();
    4846      var resultingSchedule = new Schedule(jobs[0].Tasks.Count);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs

    r13437 r13469  
    2929  [Item("PermutationWithRepetitionRandomCreator", "Creates PWR-individuals at random.")]
    3030  [StorableClass]
    31   public class PWRRandomCreator : ScheduleCreator, IStochasticOperator {
     31  public class PWRRandomCreator : ScheduleCreator<PWREncoding>, IStochasticOperator {
    3232
    3333    public ILookupParameter<IRandom> RandomParameter {
     
    5151    }
    5252
    53     protected override ISchedule CreateSolution() {
     53    protected override PWREncoding CreateSolution() {
    5454      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    5555    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/Plugin.cs.frame

    r13321 r13469  
    3535  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3636  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     37  [PluginDependency("HeuristicLab.Random", "3.3")]
    3738  public class HeuristicLabEncodingsScheduleEncodingPlugin : PluginBase {
    3839  }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Decoder/PRVDecoder.cs

    r13443 r13469  
    2020#endregion
    2121
    22 using System;
    2322using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
    26 using HeuristicLab.Encodings.ScheduleEncoding;
    2725using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2826using HeuristicLab.Random;
     
    3129  [Item("JobSequencingMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequencing Matrix.")]
    3230  [StorableClass]
    33   public class PRVDecoder : ScheduleDecoder {
     31  public class PRVDecoder : ScheduleDecoder<PRVEncoding> {
    3432    #region Priority Rules
    3533    //smallest number of remaining tasks
     
    189187    }
    190188
    191     public override Schedule DecodeSchedule(ISchedule encoding, ItemList<Job> jobData) {
    192       var solution = encoding as PRVEncoding;
    193       if (solution == null) throw new InvalidOperationException("Encoding is not of type PRVEncoding");
    194       return DecodeSchedule(solution, jobData);
    195     }
    196 
    197     public static Schedule DecodeSchedule(PRVEncoding solution, ItemList<Job> jobData) {
     189    public override Schedule DecodeSchedule(PRVEncoding encoding, ItemList<Job> jobData) {
     190      return Decode(encoding, jobData);
     191    }
     192
     193    public static Schedule Decode(PRVEncoding solution, ItemList<Job> jobData) {
    198194      var random = new FastRandom(solution.RandomSeed);
    199195      var jobs = (ItemList<Job>)jobData.Clone();
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs

    r13443 r13469  
    2929  [Item("PriorityRulesRandomCreator", "Creator class used to create PRV encoding objects for scheduling problems.")]
    3030  [StorableClass]
    31   public class PRVRandomCreator : ScheduleCreator, IStochasticOperator {
     31  public class PRVRandomCreator : ScheduleCreator<PRVEncoding>, IStochasticOperator {
    3232
    3333    [Storable]
     
    5858    }
    5959
    60     protected override ISchedule CreateSolution() {
     60    protected override PRVEncoding CreateSolution() {
    6161      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules);
    6262    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCreator.cs

    r13437 r13469  
    3030  [Item("ScheduleCreator", "Represents the generalized form of creators for Scheduling Problems.")]
    3131  [StorableClass]
    32   public abstract class ScheduleCreator : InstrumentedOperator, IScheduleCreator {
     32  public abstract class ScheduleCreator<TSchedule> : InstrumentedOperator, IScheduleCreator<TSchedule>
     33  where TSchedule : class,ISchedule {
    3334
    34     public ILookupParameter<ISchedule> ScheduleParameter {
    35       get { return (ILookupParameter<ISchedule>)Parameters["Schedule"]; }
     35    public ILookupParameter<TSchedule> ScheduleParameter {
     36      get { return (ILookupParameter<TSchedule>)Parameters["Schedule"]; }
    3637    }
    3738    public IValueLookupParameter<IntValue> JobsParameter {
     
    4445    [StorableConstructor]
    4546    protected ScheduleCreator(bool deserializing) : base(deserializing) { }
    46     protected ScheduleCreator(ScheduleCreator original, Cloner cloner) : base(original, cloner) { }
     47    protected ScheduleCreator(ScheduleCreator<TSchedule> original, Cloner cloner) : base(original, cloner) { }
    4748    public ScheduleCreator()
    4849      : base() {
    49       Parameters.Add(new LookupParameter<ISchedule>("Schedule", "The new scheduling solution candidate."));
     50      Parameters.Add(new LookupParameter<TSchedule>("Schedule", "The new scheduling solution candidate."));
    5051      Parameters.Add(new ValueLookupParameter<IntValue>("Jobs", "The number of jobs handled in this problem instance."));
    5152      Parameters.Add(new ValueLookupParameter<IntValue>("Resources", "The number of resources used in this problem instance."));
     
    5758    }
    5859
    59     protected abstract ISchedule CreateSolution();
     60    protected abstract TSchedule CreateSolution();
    6061  }
    6162}
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleDecoder.cs

    r13443 r13469  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2930  [Item("ScheduleDecoder", "A schedule decoder translates a respresentation into an actual schedule.")]
    3031  [StorableClass]
    31   public abstract class ScheduleDecoder : SingleSuccessorOperator, IScheduleDecoder {
     32  public abstract class ScheduleDecoder<TSchedule> : SingleSuccessorOperator, IScheduleDecoder<TSchedule>
     33  where TSchedule : class, ISchedule {
    3234
    3335    public ILookupParameter<ISchedule> ScheduleEncodingParameter {
     
    4345    [StorableConstructor]
    4446    protected ScheduleDecoder(bool deserializing) : base(deserializing) { }
    45     protected ScheduleDecoder(ScheduleDecoder original, Cloner cloner) : base(original, cloner) { }
     47    protected ScheduleDecoder(ScheduleDecoder<TSchedule> original, Cloner cloner) : base(original, cloner) { }
    4648    public ScheduleDecoder()
    4749      : base() {
     
    5153    }
    5254
    53     public abstract Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData);
     55    public Schedule DecodeSchedule(ISchedule schedule, ItemList<Job> jobData) {
     56      TSchedule solution = schedule as TSchedule;
     57      if (solution == null) throw new InvalidOperationException("Encoding is not of type " + typeof(TSchedule).GetPrettyName());
     58      return DecodeSchedule(solution, jobData);
     59    }
     60    public abstract Schedule DecodeSchedule(TSchedule schedule, ItemList<Job> jobData);
    5461
    5562    public override IOperation Apply() {
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding.cs

    r13443 r13469  
    3434namespace HeuristicLab.Encodings.ScheduleEncoding {
    3535  [StorableClass]
    36   public abstract class ScheduleEncoding<TSchedule> : Encoding<ISchedule>, IScheduleEncoding
     36  public abstract class ScheduleEncoding<TSchedule> : Encoding<TSchedule>, IScheduleEncoding
    3737  where TSchedule : class, ISchedule {
    3838    #region Encoding Parameters
     
    8585
    8686    [Storable]
    87     private IValueParameter<IScheduleDecoder> decoderParameter;
    88 
    89     public IValueParameter<IScheduleDecoder> DecoderParameter {
     87    private IValueParameter<IScheduleDecoder<TSchedule>> decoderParameter;
     88    public IValueParameter<IScheduleDecoder<TSchedule>> DecoderParameter {
    9089      get { return decoderParameter; }
    9190      set {
     
    114113    }
    115114
    116     public IScheduleDecoder Decoder {
     115    public IScheduleDecoder<TSchedule> Decoder {
    117116      get { return DecoderParameter.Value; }
    118117      set { DecoderParameter.Value = value; }
     
    123122    protected ScheduleEncoding(ScheduleEncoding<TSchedule> original, Cloner cloner)
    124123      : base(original, cloner) {
     124      jobDataParameter = cloner.Clone(original.JobDataParameter);
     125      jobsParameter = cloner.Clone(original.JobsParameter);
     126      resourcesParameter = cloner.Clone(original.ResourcesParameter);
     127      decoderParameter = cloner.Clone(original.DecoderParameter);
    125128    }
    126129
     
    135138      jobsParameter = new FixedValueParameter<IntValue>(Name + ".Jobs", new IntValue(jobs));
    136139      resourcesParameter = new FixedValueParameter<IntValue>(Name + ".Resources", new IntValue(resources));
    137       decoderParameter = new ValueParameter<IScheduleDecoder>(Name + ".Decoder");
     140      decoderParameter = new ValueParameter<IScheduleDecoder<TSchedule>>(Name + ".Decoder");
    138141
    139142      Parameters.Add(jobDataParameter);
     
    163166
    164167    public override void ConfigureOperators(IEnumerable<IItem> operators) {
    165       ConfigureCreators(operators.OfType<IScheduleCreator>());
     168      ConfigureCreators(operators.OfType<IScheduleCreator<TSchedule>>());
    166169      ConfigureCrossovers(operators.OfType<IScheduleCrossover>());
    167170      ConfigureManipulators(operators.OfType<IScheduleManipulator>());
    168171    }
    169172
    170     private void ConfigureCreators(IEnumerable<IScheduleCreator> creators) {
     173    private void ConfigureCreators(IEnumerable<IScheduleCreator<TSchedule>> creators) {
    171174      foreach (var creator in creators) {
    172175        creator.ScheduleParameter.ActualName = Name;
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Decoder/DirectScheduleDecoder.cs

    r13443 r13469  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2827  [Item("DirectScheduleDecoder", "An item used to convert a direct schedule into a generalized schedule.")]
    2928  [StorableClass]
    30   public class DirectScheduleDecoder : ScheduleDecoder {
     29  public class DirectScheduleDecoder : ScheduleDecoder<Schedule> {
    3130    [StorableConstructor]
    3231    protected DirectScheduleDecoder(bool deserializing) : base(deserializing) { }
     
    3837    }
    3938
    40     public override Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData) {
    41       var schedule = solution as Schedule;
    42       if (schedule == null) throw new InvalidOperationException("Encoding is not of type PWREncoding");
    43       return DecodeSchedule(schedule, jobData);
     39    public override Schedule DecodeSchedule(Schedule solution, ItemList<Job> jobData) {
     40      return Decode(solution, jobData);
    4441    }
    4542
    46     public static Schedule DecodeSchedule(Schedule solution, ItemList<Job> jobData) {
     43    public static Schedule Decode(Schedule solution, ItemList<Job> jobData) {
    4744      return solution;
    4845    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs

    r13443 r13469  
    3030  [Item("DirectScheduleRandomCreator", "Creator class used to create schedule encoding objects.")]
    3131  [StorableClass]
    32   public class DirectScheduleRandomCreator : ScheduleCreator, IStochasticOperator, IDirectScheduleOperator {
     32  public class DirectScheduleRandomCreator : ScheduleCreator<Schedule>, IStochasticOperator, IDirectScheduleOperator {
    3333
    3434    public ILookupParameter<IRandom> RandomParameter {
     
    6868
    6969
    70 
    71     protected override ISchedule CreateSolution() {
     70    protected override Schedule CreateSolution() {
    7271      var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
    7372      var pwrEncoding = new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Encoding.cs

    r13396 r13469  
    5353        foreach (var op in value) encodingOperators.Add(op);
    5454
    55         ISolutionCreator<TSolution> newSolutionCreator = (ISolutionCreator<TSolution>)encodingOperators.FirstOrDefault(o => o.GetType() == solutionCreator.GetType()) ??
     55        ISolutionCreator<TSolution> newSolutionCreator = (ISolutionCreator<TSolution>)encodingOperators.FirstOrDefault(o => o.GetType() == SolutionCreator.GetType()) ??
    5656                               encodingOperators.OfType<ISolutionCreator<TSolution>>().First();
    5757        SolutionCreator = newSolutionCreator;
     
    6060    }
    6161
    62     ISolutionCreator IEncoding.SolutionCreator {
    63       get { return solutionCreator; }
     62    public IValueParameter SolutionCreatorParameter {
     63      get { return (IValueParameter)Parameters[Name + ".SolutionCreator"]; }
    6464    }
    6565
    66     [Storable]
    67     private ISolutionCreator<TSolution> solutionCreator;
     66    ISolutionCreator IEncoding.SolutionCreator {
     67      get { return SolutionCreator; }
     68    }
    6869    public ISolutionCreator<TSolution> SolutionCreator {
    69       get {
    70         return solutionCreator;
    71       }
     70      get { return (ISolutionCreator<TSolution>)SolutionCreatorParameter.Value; }
    7271      set {
    7372        if (value == null) throw new ArgumentNullException("SolutionCreator must not be null.");
    74         if (solutionCreator == value) return;
    75         encodingOperators.Remove(solutionCreator);
     73        encodingOperators.Remove(SolutionCreator);
    7674        encodingOperators.Add(value);
    77         solutionCreator = value;
     75        SolutionCreatorParameter.Value = value;
    7876        OnSolutionCreatorChanged();
    7977      }
    8078    }
    8179
     80
    8281    [StorableConstructor]
    8382    protected Encoding(bool deserializing) : base(deserializing) { }
     83    [StorableHook(HookType.AfterDeserialization)]
     84    private void AfterDeserialization() {
     85      RegisterEventHandlers();
     86    }
     87
    8488    protected Encoding(Encoding<TSolution> original, Cloner cloner)
    8589      : base(original, cloner) {
    8690      encodingOperators = cloner.Clone(original.encodingOperators);
    87       solutionCreator = cloner.Clone(original.solutionCreator);
     91
     92      RegisterEventHandlers();
    8893    }
     94
    8995    protected Encoding(string name)
    9096      : base(name) {
     97      Parameters.Add(new ValueParameter<ISolutionCreator<TSolution>>(name + ".SolutionCreator", "The operator to create a solution."));
    9198      Parameters.Add(new FixedValueParameter<ReadOnlyItemSet<IOperator>>(name + ".Operators", "The operators that the encoding specifies.", encodingOperators.AsReadOnly()));
     99
     100      RegisterEventHandlers();
     101    }
     102
     103    private void RegisterEventHandlers() {
     104      SolutionCreatorParameter.ValueChanged += (o, e) => OnSolutionCreatorChanged();
    92105    }
    93106
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Interfaces/IEncoding.cs

    r13396 r13469  
    2626namespace HeuristicLab.Optimization {
    2727  public interface IEncoding : IParameterizedNamedItem {
     28    IValueParameter SolutionCreatorParameter { get; }
    2829    ISolutionCreator SolutionCreator { get; }
     30
    2931    IEnumerable<IOperator> Operators { get; set; }
    3032
     
    3234    void ConfigureOperators(IEnumerable<IItem> operators);
    3335
     36    event EventHandler OperatorsChanged;
    3437    event EventHandler SolutionCreatorChanged;
    35     event EventHandler OperatorsChanged;
    3638  }
    3739
    3840  public interface IEncoding<TSolution> : IEncoding
    3941    where TSolution : class, ISolution {
    40     new ISolutionCreator<TSolution> SolutionCreator { get; set; }
     42    //new ISolutionCreator<TSolution> SolutionCreator { get; }
    4143  }
    4244}
  • branches/ProblemRefactoring/HeuristicLab.Optimization/3.3/BasicProblems/Problem.cs

    r13396 r13469  
    3030namespace HeuristicLab.Optimization {
    3131  [StorableClass]
    32   public abstract class Problem<TEncoding, TSolution, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator<TSolution>>, IProblemDefinition<TEncoding, TSolution>, IStorableContent
     32  public abstract class Problem<TEncoding, TSolution, TEvaluator> : Problem,
     33    IHeuristicOptimizationProblem, IProblemDefinition<TEncoding, TSolution>, IStorableContent
    3334    where TEncoding : class, IEncoding<TSolution>
    3435    where TSolution : class, ISolution
    3536    where TEvaluator : class, IEvaluator {
    3637
    37     public string Filename { get; set; } // TODO: Really okay here?
     38    public string Filename { get; set; } // TODO: Really okay here? should be in Problem (non-generic)
    3839
     40    //TODO remove parametr for encoding?
    3941    protected IValueParameter<TEncoding> EncodingParameter {
    4042      get { return (IValueParameter<TEncoding>)Parameters["Encoding"]; }
    4143    }
    42 
    4344    //mkommend necessary for reuse of operators if the encoding changes
    4445    private TEncoding oldEncoding;
    45 
    4646    public TEncoding Encoding {
    4747      get { return EncodingParameter.Value; }
     
    5151      }
    5252    }
     53
     54    ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator {
     55      get { return Encoding.SolutionCreator; }
     56    }
     57    IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter {
     58      get { return Encoding.SolutionCreatorParameter; }
     59    }
     60    event EventHandler IHeuristicOptimizationProblem.SolutionCreatorChanged {
     61      add { Encoding.SolutionCreatorChanged += value; }
     62      remove { Encoding.SolutionCreatorChanged -= value; }
     63    }
     64
     65    //TODO is a parameter for the evaluator really necessary, only single-objective or multi-objective evulators calling the func are possible
     66    public ValueParameter<TEvaluator> EvaluatorParameter {
     67      get { return (ValueParameter<TEvaluator>)Parameters["Evaluator"]; }
     68    }
     69    public TEvaluator Evaluator {
     70      get { return EvaluatorParameter.Value; }
     71      protected set { EvaluatorParameter.Value = value; }
     72    }
     73    IEvaluator IHeuristicOptimizationProblem.Evaluator { get { return Evaluator; } }
     74    IParameter IHeuristicOptimizationProblem.EvaluatorParameter { get { return EvaluatorParameter; } }
     75
     76    public event EventHandler EvaluatorChanged;
     77    protected virtual void OnEvaluatorChanged() {
     78      EventHandler handler = EvaluatorChanged;
     79      if (handler != null)
     80        handler(this, EventArgs.Empty);
     81    }
     82
    5383
    5484    protected override IEnumerable<IItem> GetOperators() {
     
    6696      : base() {
    6797      Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any."));
     98      Parameters.Add(new ValueParameter<TEvaluator>("Evaluator", "The operator used to evaluate a solution."));
     99
    68100      if (Encoding != null) {
    69101        oldEncoding = Encoding;
    70         SolutionCreator = Encoding.SolutionCreator;
    71102        Parameterize();
    72103      }
     
    76107      if (encoding == null) throw new ArgumentNullException("encoding");
    77108      Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any.", encoding));
     109      Parameters.Add(new ValueParameter<TEvaluator>("Evaluator", "The operator used to evaluate a solution."));
     110
    78111      oldEncoding = Encoding;
    79       SolutionCreator = Encoding.SolutionCreator;
    80112      Parameterize();
    81113
     
    99131    private void RegisterEvents() {
    100132      EncodingParameter.ValueChanged += (o, e) => OnEncodingChanged();
     133      EvaluatorParameter.ValueChanged += (o, e) => OnEvaluatorChanged();
    101134      //var multiEncoding = Encoding as MultiEncoding;
    102135      //if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged;
     
    122155        op.EncodingParameter.ActualName = EncodingParameter.Name;
    123156
    124       SolutionCreator = Encoding.SolutionCreator;
    125 
    126157      //var multiEncoding = Encoding as MultiEncoding;
    127158      //if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged;
    128159    }
    129160
    130     protected override void OnSolutionCreatorChanged() {
    131       base.OnSolutionCreatorChanged();
    132       Encoding.SolutionCreator = SolutionCreator;
    133     }
     161    //protected override void OnSolutionCreatorChanged() {
     162    //  base.OnSolutionCreatorChanged();
     163    //  Encoding.SolutionCreator = SolutionCreator;
     164    //}
    134165
    135166    private static void AdaptEncodingOperators(IEncoding oldEncoding, IEncoding newEncoding) {
    136167      if (oldEncoding.GetType() != newEncoding.GetType()) return;
    137168
    138       if (oldEncoding.GetType() == typeof(CombinedEncoding)) {
     169      if (oldEncoding is CombinedEncoding) {
    139170        var oldMultiEncoding = (CombinedEncoding)oldEncoding;
    140171        var newMultiEncoding = (CombinedEncoding)newEncoding;
  • branches/ProblemRefactoring/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs

    r13404 r13469  
    132132      Parameterize();
    133133    }
    134     protected override void OnSolutionCreatorChanged() {
    135       base.OnSolutionCreatorChanged();
    136       Parameterize();
    137     }
     134    //TODO check with abeham if this is really necessary
     135    //protected override void OnSolutionCreatorChanged() {
     136    //  base.OnSolutionCreatorChanged();
     137    //  Parameterize();
     138    //}
    138139    protected override void OnEvaluatorChanged() {
    139140      base.OnEvaluatorChanged();
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment.Algorithms/3.3/RobustTabooSearch.cs

    r13396 r13469  
    395395    private void ParameterizeOperators() {
    396396      if (Problem != null) {
    397         solutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     397        solutionsCreator.SolutionCreatorParameter.ActualName = base.Problem.SolutionCreatorParameter.Name;
    398398        solutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
    399399
  • branches/ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs

    r13396 r13469  
    169169
    170170    #region Events
    171     protected override void OnSolutionCreatorChanged() {
    172       Parameterize();
    173       base.OnSolutionCreatorChanged();
    174     }
     171    //TODO check with abhem if this is necessary
     172    //protected override void OnSolutionCreatorChanged() {
     173    //  Parameterize();
     174    //  base.OnSolutionCreatorChanged();
     175    //}
    175176    protected override void OnEvaluatorChanged() {
    176177      Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
  • branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/HeuristicLab.Problems.Scheduling-3.3.csproj

    r13443 r13469  
    158158      <Private>False</Private>
    159159    </ProjectReference>
    160     <ProjectReference Include="..\..\HeuristicLab.Encodings.IntegerVectorEncoding\3.3\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj">
    161       <Project>{DDFB14DD-2A85-493C-A52D-E69729BBAEB0}</Project>
    162       <Name>HeuristicLab.Encodings.IntegerVectorEncoding-3.3</Name>
    163       <Private>False</Private>
    164     </ProjectReference>
    165160    <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">
    166161      <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project>
     
    201196      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    202197      <Name>HeuristicLab.Problems.Instances-3.3</Name>
    203       <Private>False</Private>
    204     </ProjectReference>
    205     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    206       <Project>{f4539fb6-4708-40c9-be64-0a1390aea197}</Project>
    207       <Name>HeuristicLab.Random-3.3</Name>
    208198      <Private>False</Private>
    209199    </ProjectReference>
  • branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem new.cs

    r13449 r13469  
    9696
    9797    #region Properties
     98
    9899    public ItemList<Job> JobData {
    99100      get { return JobDataParameter.Value; }
     
    166167
    167168    #region Events
    168     protected override void OnSolutionCreatorChanged() {
    169       //SolutionCreator.ScheduleParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged;
    170       //InitializeOperators();
    171     }
     169    //protected override void OnSolutionCreatorChanged() {
     170    //SolutionCreator.ScheduleParameter.ActualNameChanged += SolutionCreator_SchedulingEncodingParameter_ActualNameChanged;
     171    //InitializeOperators();
     172    //}
    172173    protected override void OnEvaluatorChanged() {
    173174      base.OnEvaluatorChanged();
     
    196197    #region Helpers
    197198    private void InitializeOperators() {
    198       Operators.Clear();
    199       ApplyEncoding();
     199      //ApplyEncoding();
    200200      Operators.Add(new BestSchedulingSolutionAnalyzer());
    201201      ParameterizeOperators();
     
    289289          }
    290290        }
    291         BestKnownSolution = JSMDecoder.DecodeSchedule(enc, jobData, JSMDecodingErrorPolicy.RandomPolicy, JSMForcingStrategy.SwapForcing);
     291        BestKnownSolution = JSMDecoder.Decode(enc, jobData, JSMDecodingErrorPolicy.RandomPolicy, JSMForcingStrategy.SwapForcing);
    292292        //if (ScheduleEvaluator is MeanTardinessEvaluator)
    293293        //  BestKnownQuality = MeanTardinessEvaluator.GetMeanTardiness(BestKnownSolution, jobData);
  • branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/Plugin.cs.frame

    r13321 r13469  
    3030  [PluginDependency("HeuristicLab.Core", "3.3")]
    3131  [PluginDependency("HeuristicLab.Data", "3.3")]
    32   [PluginDependency("HeuristicLab.Encodings.IntegerVectorEncoding", "3.3")]
    3332  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
    3433  [PluginDependency("HeuristicLab.Encodings.ScheduleEncoding", "3.3")]
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/EsGriewankSampleTest.cs

    r13408 r13469  
    6464      problem.ProblemSize = 10;
    6565      problem.TestFunction = new Griewank();
    66       problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator();
     66      problem.Encoding.SolutionCreator = new UniformRandomRealVectorCreator();
    6767      problem.Bounds = new DoubleMatrix(new double[,] { { -600, 600 } });
    6868      problem.BestKnownQuality = 0;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/LocalSearchKnapsackSampleTest.cs

    r13408 r13469  
    6262      problem.BestKnownSolution = new HeuristicLab.Encodings.BinaryVectorEncoding.BinaryVector(new bool[] {
    6363       true , false, false, true , true , true , true , true , false, true , true , true , true , true , true , false, true , false, true , true , false, true , true , false, true , false, true , true , true , false, true , true , false, true , true , false, true , false, true , true , true , true , true , true , true , true , true , true , true , true , true , false, true , false, false, true , true , false, true , true , true , true , true , true , true , true , false, true , false, true , true , true , true , false, true , true , true , true , true , true , true , true});
    64       problem.SolutionCreatorParameter.Value = new RandomBinaryVectorCreator();
     64      problem.Encoding.SolutionCreator = new RandomBinaryVectorCreator();
    6565      problem.KnapsackCapacity = 297;
    6666      problem.Values = new IntArray(new int[] {
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/OSESGriewankSampleTest.cs

    r13408 r13469  
    6464      problem.ProblemSize = 10;
    6565      problem.TestFunction = new Griewank();
    66       problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator();
     66      problem.Encoding.SolutionCreator = new UniformRandomRealVectorCreator();
    6767      problem.Bounds = new DoubleMatrix(new double[,] { { -600, 600 } });
    6868      problem.BestKnownQuality = 0;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/PsoSchwefelSampleTest.cs

    r13408 r13469  
    7373      problem.TestFunction = new Schwefel();
    7474      problem.ProblemSize = 2;
    75       problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator();
     75      problem.Encoding.SolutionCreator = new UniformRandomRealVectorCreator();
    7676      #endregion
    7777      #region Algorithm Configuration
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/RAPGASchedulingSampleTest.cs

    r12012 r13469  
    2323using System.Linq;
    2424using HeuristicLab.Algorithms.RAPGA;
    25 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
     25using HeuristicLab.Encodings.ScheduleEncoding;
    2626using HeuristicLab.Persistence.Default.Xml;
    2727using HeuristicLab.Problems.Scheduling;
     
    5757    private RAPGA CreateRAPGASchedulingSample() {
    5858      #region Problem Configuration
    59       JobShopSchedulingProblem problem = new JobShopSchedulingProblem();
     59      var problem = new JobShopSchedulingProblemNew();
    6060      #endregion
    6161
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab-3.3/Samples/SimulatedAnnealingRastriginSampleTest.cs

    r13408 r13469  
    6262      problem.TestFunction= new Rastrigin();
    6363      problem.ProblemSize = 2;
    64       problem.SolutionCreatorParameter.Value = new UniformRandomRealVectorCreator();
     64      problem.Encoding.SolutionCreator = new UniformRandomRealVectorCreator();
    6565      #endregion
    6666      #region Algorithm Configuration
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/DirectScheduleGTCrossoverTest.cs

    r12012 r13469  
    2222using System.Linq;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
    25 using HeuristicLab.Encodings.ScheduleEncoding.ScheduleEncoding;
     24using HeuristicLab.Encodings.ScheduleEncoding;
    2625using HeuristicLab.Tests;
    2726using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    4847      Schedule actual;
    4948      actual = DirectScheduleGTCrossover.Apply(random, parent1, parent2, jobData, mutProp);
    50       Schedule expected = DirectScheduleRandomCreator.Apply(3, 3, new PWREncoding(3, 3, new TestRandom(new int[] { 0, 2, 1, 1, 0, 2, 1, 2, 0 }, null)), TestUtils.CreateJobData());
     49      Schedule expected = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 0, 2, 1, 1, 0, 2, 1, 2, 0 }, null)), TestUtils.CreateJobData());
    5150      Assert.IsTrue(TestUtils.ScheduleEquals(actual, expected));
    5251    }
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMJOXCrossoverTest.cs

    r12012 r13469  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
    2524using HeuristicLab.Tests;
    2625using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    4039    [TestProperty("Time", "short")]
    4140    public void ApplyTest() {
    42       IRandom random = new TestRandom(new int[] { 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1 }, null);
     41      IRandom random = new TestRandom(new int[] { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1 }, null);
    4342      JSMEncoding p1 = TestUtils.CreateTestJSM1();
    4443      JSMEncoding p2 = TestUtils.CreateTestJSM2();
    45       JSMEncoding expected = new JSMEncoding();
    46       ItemList<Permutation> jsm = new ItemList<Permutation>();
     44      JSMEncoding expected = new JSMEncoding(0);
     45      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4746      for (int i = 0; i < 6; i++) {
    4847        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 5, 4, 3, 0, 1, 2 }));
    4948      }
    50       expected.JobSequenceMatrix = jsm;
     49
    5150
    5251      JSMEncoding actual;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMSXXCrossoverTest.cs

    r12012 r13469  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
    2524using HeuristicLab.Tests;
    2625using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    4039    [TestProperty("Time", "short")]
    4140    public void ApplyTest() {
    42       IRandom random = new TestRandom(new int[] { 3 }, null);
     41      IRandom random = new TestRandom(new int[] { 0, 3 }, null);
    4342      JSMEncoding p1 = TestUtils.CreateTestJSM1();
    4443      JSMEncoding p2 = TestUtils.CreateTestJSM2();
    45       JSMEncoding expected = new JSMEncoding();
    46       ItemList<Permutation> jsm = new ItemList<Permutation>();
     44      JSMEncoding expected = new JSMEncoding(0);
     45      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4746      for (int i = 0; i < 6; i++) {
    4847        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 2, 1, 0, 3, 4, 5 }));
    4948      }
    50       expected.JobSequenceMatrix = jsm;
    5149
    5250      JSMEncoding actual;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/JSMShiftChangeManipulatorTest.cs

    r12012 r13469  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Encodings.PermutationEncoding;
    24 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
    2524using HeuristicLab.Tests;
    2625using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    4342      JSMEncoding individual = TestUtils.CreateTestJSM1();
    4443      JSMShiftChangeManipulator.Apply(random, individual);
    45       JSMEncoding expected = new JSMEncoding();
    46       ItemList<Permutation> jsm = new ItemList<Permutation>();
     44      JSMEncoding expected = new JSMEncoding(0);
     45      ItemList<Permutation> jsm = expected.JobSequenceMatrix;
    4746      for (int i = 0; i < 3; i++) {
    4847        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 0, 1, 3, 2, 4, 5 }));
    4948        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 0, 1, 3, 4, 2, 5 }));
    5049      }
    51       expected.JobSequenceMatrix = jsm;
    5250
    5351      Assert.IsTrue(TestUtils.JSMEncodingEquals(expected, individual));
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/PWRGOXCrossoverTest.cs

    r12012 r13469  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Encodings.IntegerVectorEncoding;
    24 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
    2524using HeuristicLab.Tests;
    2625using Microsoft.VisualStudio.TestTools.UnitTesting;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/PWRPPXCrossoverTest.cs

    r12012 r13469  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Encodings.IntegerVectorEncoding;
    24 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
    2524using HeuristicLab.Tests;
    2625using Microsoft.VisualStudio.TestTools.UnitTesting;
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3/TestUtils.cs

    r12012 r13469  
    2424using HeuristicLab.Encodings.IntegerVectorEncoding;
    2525using HeuristicLab.Encodings.PermutationEncoding;
    26 using HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix;
    27 using HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition;
     26
    2827using HeuristicLab.Tests;
    2928
     
    3130  public class TestUtils {
    3231    public static JSMEncoding CreateTestJSM1() {
    33       JSMEncoding result = new JSMEncoding();
    34       ItemList<Permutation> jsm = new ItemList<Permutation>();
     32      JSMEncoding result = new JSMEncoding(0);
     33      ItemList<Permutation> jsm = result.JobSequenceMatrix;
    3534      for (int i = 0; i < 6; i++)
    3635        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 0, 1, 2, 3, 4, 5 }));
    37       result.JobSequenceMatrix = jsm;
    3836      return result;
    3937    }
    4038
    4139    public static JSMEncoding CreateTestJSM2() {
    42       JSMEncoding result = new JSMEncoding();
    43       ItemList<Permutation> jsm = new ItemList<Permutation>();
     40      JSMEncoding result = new JSMEncoding(0);
     41      ItemList<Permutation> jsm = result.JobSequenceMatrix;
    4442      for (int i = 0; i < 6; i++)
    4543        jsm.Add(new Permutation(PermutationTypes.Absolute, new int[] { 5, 4, 3, 2, 1, 0 }));
    46       result.JobSequenceMatrix = jsm;
    4744      return result;
    4845    }
     
    6663    public static ItemList<Job> CreateJobData() {
    6764      Job j1 = new Job(0, 0);
    68       j1.Tasks = new ItemList<Task> {
     65      j1.Tasks.AddRange(new[]{
    6966        new Task (0, 0, j1.Index, 1),
    7067        new Task (1, 1, j1.Index, 2),
    7168        new Task (2, 2, j1.Index, 1)
    72       };
     69      });
    7370
    7471      Job j2 = new Job(1, 0);
    75       j2.Tasks = new ItemList<Task> {
     72      j2.Tasks.AddRange(new[]{
    7673        new Task (3, 2, j2.Index, 2),
    7774        new Task (4, 1, j2.Index, 1),
    7875        new Task (5, 0, j2.Index, 2)
    79       };
     76      });
    8077
    8178      Job j3 = new Job(2, 0);
    82       j3.Tasks = new ItemList<Task> {
     79      j3.Tasks.AddRange(new[]{
    8380        new Task (6, 0, j3.Index, 1),
    8481        new Task (7, 2, j3.Index, 2),
    8582        new Task (8, 1, j3.Index, 1)
    86       };
     83      });
    8784
    8885      return new ItemList<Job> { j1, j2, j3 };
     
    9087
    9188    public static Schedule CreateTestSchedule1() {
    92       Schedule result = DirectScheduleRandomCreator.Apply(3, 3, new PWREncoding(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData());
     89      Schedule result = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData());
    9390      return result;
    9491    }
    9592
    9693    public static Schedule CreateTestSchedule2() {
    97       Schedule result = DirectScheduleRandomCreator.Apply(3, 3, new PWREncoding(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData());
     94      Schedule result = DirectScheduleRandomCreator.Apply(new PWREncoding(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData());
    9895      return result;
    9996    }
  • branches/ProblemRefactoring/HeuristicLab.Tests/HeuristicLab.Problems.QuadraticAssignment-3.3/QAPLIBInstancesTest.cs

    r13408 r13469  
    202202        try {
    203203          qap.Load(provider.LoadData(instance));
    204         } catch (Exception ex) {
     204        }
     205        catch (Exception ex) {
    205206          failedInstances.AppendLine(instance + ": " + ex.Message);
    206207        }
     
    223224        qap.Load(provider.LoadData(instance));
    224225        if (qaplibInstances.ContainsKey(instance.Name)
    225           && qap.BestKnownQuality != null && qap.BestKnownQuality != qaplibInstances[instance.Name])
     226          && qap.BestKnownQuality != qaplibInstances[instance.Name])
    226227          failedInstances.AppendLine(instance.Name + ": " + qap.BestKnownQuality.ToString() + " vs " + qaplibInstances[instance.Name]);
    227228      }
Note: See TracChangeset for help on using the changeset viewer.