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