Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMDecoder.cs
r13449 r13469 34 34 [Item("JobSequenceMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequence Matrix.")] 35 35 [StorableClass] 36 public class JSMDecoder : ScheduleDecoder {36 public class JSMDecoder : ScheduleDecoder<JSMEncoding> { 37 37 38 38 public IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>> DecodingErrorPolicyParameter { … … 130 130 } 131 131 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); 136 134 } 137 135 138 public static Schedule Decode Schedule(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {136 public static Schedule Decode(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) { 139 137 var random = new FastRandom(solution.RandomSeed); 140 138 var jobs = (ItemList<Job>)jobData.Clone(); -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs
r13443 r13469 30 30 [Item("JobSequenceMatrixCreator", "Creator class used to create Job Sequence Matrix solutions for standard JobShop scheduling problems.")] 31 31 [StorableClass] 32 public class JSMRandomCreator : ScheduleCreator , IStochasticOperator {32 public class JSMRandomCreator : ScheduleCreator<JSMEncoding>, IStochasticOperator { 33 33 34 34 public ILookupParameter<IRandom> RandomParameter { … … 56 56 } 57 57 58 protected override IScheduleCreateSolution() {58 protected override JSMEncoding CreateSolution() { 59 59 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue); 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.