Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Decoder/PRVDecoder.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/PriorityRulesVector/Decoder/PRVDecoder.cs
r13443 r13469 20 20 #endregion 21 21 22 using System;23 22 using System.Linq; 24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; 26 using HeuristicLab.Encodings.ScheduleEncoding;27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 26 using HeuristicLab.Random; … … 31 29 [Item("JobSequencingMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequencing Matrix.")] 32 30 [StorableClass] 33 public class PRVDecoder : ScheduleDecoder {31 public class PRVDecoder : ScheduleDecoder<PRVEncoding> { 34 32 #region Priority Rules 35 33 //smallest number of remaining tasks … … 189 187 } 190 188 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) { 198 194 var random = new FastRandom(solution.RandomSeed); 199 195 var jobs = (ItemList<Job>)jobData.Clone();
Note: See TracChangeset
for help on using the changeset viewer.