Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Decoder/DirectScheduleDecoder.cs
r13443 r13469 20 20 #endregion 21 21 22 using System;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 28 27 [Item("DirectScheduleDecoder", "An item used to convert a direct schedule into a generalized schedule.")] 29 28 [StorableClass] 30 public class DirectScheduleDecoder : ScheduleDecoder {29 public class DirectScheduleDecoder : ScheduleDecoder<Schedule> { 31 30 [StorableConstructor] 32 31 protected DirectScheduleDecoder(bool deserializing) : base(deserializing) { } … … 38 37 } 39 38 40 public override Schedule DecodeSchedule(ISchedule solution, ItemList<Job> jobData) { 41 var schedule = solution as Schedule; 42 if (schedule == null) throw new InvalidOperationException("Encoding is not of type PWREncoding"); 43 return DecodeSchedule(schedule, jobData); 39 public override Schedule DecodeSchedule(Schedule solution, ItemList<Job> jobData) { 40 return Decode(solution, jobData); 44 41 } 45 42 46 public static Schedule Decode Schedule(Schedule solution, ItemList<Job> jobData) {43 public static Schedule Decode(Schedule solution, ItemList<Job> jobData) { 47 44 return solution; 48 45 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs
r13443 r13469 30 30 [Item("DirectScheduleRandomCreator", "Creator class used to create schedule encoding objects.")] 31 31 [StorableClass] 32 public class DirectScheduleRandomCreator : ScheduleCreator , IStochasticOperator, IDirectScheduleOperator {32 public class DirectScheduleRandomCreator : ScheduleCreator<Schedule>, IStochasticOperator, IDirectScheduleOperator { 33 33 34 34 public ILookupParameter<IRandom> RandomParameter { … … 68 68 69 69 70 71 protected override ISchedule CreateSolution() { 70 protected override Schedule CreateSolution() { 72 71 var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone(); 73 72 var pwrEncoding = new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
Note: See TracChangeset
for help on using the changeset viewer.