Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector
- Files:
-
- 2 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(); -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs
r13443 r13469 29 29 [Item("PriorityRulesRandomCreator", "Creator class used to create PRV encoding objects for scheduling problems.")] 30 30 [StorableClass] 31 public class PRVRandomCreator : ScheduleCreator , IStochasticOperator {31 public class PRVRandomCreator : ScheduleCreator<PRVEncoding>, IStochasticOperator { 32 32 33 33 [Storable] … … 58 58 } 59 59 60 protected override IScheduleCreateSolution() {60 protected override PRVEncoding CreateSolution() { 61 61 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules); 62 62 }
Note: See TracChangeset
for help on using the changeset viewer.