Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition
- Files:
-
- 2 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); -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs
r13437 r13469 29 29 [Item("PermutationWithRepetitionRandomCreator", "Creates PWR-individuals at random.")] 30 30 [StorableClass] 31 public class PWRRandomCreator : ScheduleCreator , IStochasticOperator {31 public class PWRRandomCreator : ScheduleCreator<PWREncoding>, IStochasticOperator { 32 32 33 33 public ILookupParameter<IRandom> RandomParameter { … … 51 51 } 52 52 53 protected override IScheduleCreateSolution() {53 protected override PWREncoding CreateSolution() { 54 54 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue); 55 55 }
Note: See TracChangeset
for help on using the changeset viewer.