Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/15 15:16:24 (8 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/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    }
Note: See TracChangeset for help on using the changeset viewer.