Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Decoder/PWRDecoder.cs
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Decoder/PWRDecoder.cs
r13443 r13469 28 28 [Item("PWRDecoder", "An item used to convert a PWR-individual into a generalized schedule.")] 29 29 [StorableClass] 30 public class PWRDecoder : ScheduleDecoder {30 public class PWRDecoder : ScheduleDecoder<PWREncoding> { 31 31 [StorableConstructor] 32 32 protected PWRDecoder(bool deserializing) : base(deserializing) { } … … 38 38 } 39 39 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); 44 42 } 45 43 46 public static Schedule Decode Schedule(PWREncoding solution, ItemList<Job> jobData) {44 public static Schedule Decode(PWREncoding solution, ItemList<Job> jobData) { 47 45 var jobs = (ItemList<Job>)jobData.Clone(); 48 46 var resultingSchedule = new Schedule(jobs[0].Tasks.Count);
Note: See TracChangeset
for help on using the changeset viewer.