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/PermutationWithRepetition/Decoder/PWRDecoder.cs

    r13443 r13469  
    2828  [Item("PWRDecoder", "An item used to convert a PWR-individual into a generalized schedule.")]
    2929  [StorableClass]
    30   public class PWRDecoder : ScheduleDecoder {
     30  public class PWRDecoder : ScheduleDecoder<PWREncoding> {
    3131    [StorableConstructor]
    3232    protected PWRDecoder(bool deserializing) : base(deserializing) { }
     
    3838    }
    3939
    40     public override Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData) {
    41       var pwr = solution as PWREncoding;
    42       if (pwr == null) throw new InvalidOperationException("Encoding is not of type PWREncoding");
    43       return DecodeSchedule(pwr, jobData);
     40    public override Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     41      return Decode(solution, jobData);
    4442    }
    4543
    46     public static Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     44    public static Schedule Decode(PWREncoding solution, ItemList<Job> jobData) {
    4745      var jobs = (ItemList<Job>)jobData.Clone();
    4846      var resultingSchedule = new Schedule(jobs[0].Tasks.Count);
Note: See TracChangeset for help on using the changeset viewer.