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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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  }
Note: See TracChangeset for help on using the changeset viewer.