Free cookie consent management tool by TermsFeed Policy Generator

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

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

File:
1 edited

Legend:

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