Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/08/15 14:31:05 (9 years ago)
Author:
mkommend
Message:

#2521: Adapted decoders for SchedulingProblem.

Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleCrossover.cs

    r13437 r13443  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Encodings.ScheduleEncoding.ScheduleEncoding {
     27namespace HeuristicLab.Encodings.ScheduleEncoding {
    2828  [Item("DirectScheduleCrossover", "An operator which crosses two schedule representations.")]
    2929  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleGTCrossover.cs

    r13437 r13443  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.ScheduleEncoding {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("DirectScheduleGTCrossover", "Represents a crossover using the GT-Algorithm to cross two direct schedule representations.")]
    3030  [StorableClass]
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleEncoding.cs

    r13437 r13443  
    2727using HeuristicLab.Common;
    2828using HeuristicLab.Core;
    29 using HeuristicLab.Encodings.ScheduleEncoding;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3130using HeuristicLab.PluginInfrastructure;
    3231
    33 namespace HeuristicLab.Encodings.Schedule {
     32namespace HeuristicLab.Encodings.ScheduleEncoding {
    3433  [StorableClass]
    35   public sealed class DirectScheduleEncoding : ScheduleEncoding {
     34  public sealed class DirectScheduleEncoding : ScheduleEncoding<Schedule> {
    3635    [StorableConstructor]
    3736    private DirectScheduleEncoding(bool deserializing) : base(deserializing) { }
     
    4443      : base() {
    4544      SolutionCreator = new DirectScheduleRandomCreator();
     45      Decoder = new DirectScheduleDecoder();
    4646      DiscoverOperators();
    4747    }
     48
    4849
    4950    #region Operator Discovery
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs

    r13437 r13443  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    5554
    5655
    57     public static Schedule Apply(int jobs, int resources, PWREncoding pwr, ItemList<Job> jobData) {
     56    public static Schedule Apply(PWREncoding pwr, ItemList<Job> jobData) {
    5857      var resultingSchedule = new Schedule(jobData[0].Tasks.Count);
    5958      foreach (int jobNr in pwr.PermutationWithRepetition) {
     
    7170
    7271    protected override ISchedule CreateSolution() {
    73       try {
    74         var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
    75         return Apply(JobsParameter.ActualValue.Value,
    76           ResourcesParameter.ActualValue.Value,
    77           new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue),
    78           jobData);
    79       }
    80       catch {
    81         throw new Exception("ScheduleRandomCreator needs JobData parameter from a JSSP-Instance to create Schedule-Instances!");
    82       }
     72      var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
     73      var pwrEncoding = new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
     74        RandomParameter.ActualValue);
     75      return Apply(pwrEncoding, jobData);
    8376    }
    8477  }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators/DirectScheduleManipulator.cs

    r13437 r13443  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727
    28 namespace HeuristicLab.Encodings.ScheduleEncoding.ScheduleEncoding {
     28namespace HeuristicLab.Encodings.ScheduleEncoding {
    2929  [Item("DirectScheduleManipulator", "An operator which manipulates a direct schedule representation.")]
    3030  [StorableClass]
Note: See TracChangeset for help on using the changeset viewer.