Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/15 15:16:24 (9 years ago)
Author:
mkommend
Message:

#2521: Refactored problem base classes and adapted scheduling encoding, scheduling problem and unit tests.

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  
    3434  [Item("JobSequenceMatrixDecoder", "Applies the GifflerThompson algorithm to create an active schedule from a JobSequence Matrix.")]
    3535  [StorableClass]
    36   public class JSMDecoder : ScheduleDecoder {
     36  public class JSMDecoder : ScheduleDecoder<JSMEncoding> {
    3737
    3838    public IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>> DecodingErrorPolicyParameter {
     
    130130    }
    131131
    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);
    136134    }
    137135
    138     public static Schedule DecodeSchedule(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
     136    public static Schedule Decode(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) {
    139137      var random = new FastRandom(solution.RandomSeed);
    140138      var jobs = (ItemList<Job>)jobData.Clone();
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs

    r13443 r13469  
    3030  [Item("JobSequenceMatrixCreator", "Creator class used to create Job Sequence Matrix solutions for standard JobShop scheduling problems.")]
    3131  [StorableClass]
    32   public class JSMRandomCreator : ScheduleCreator, IStochasticOperator {
     32  public class JSMRandomCreator : ScheduleCreator<JSMEncoding>, IStochasticOperator {
    3333
    3434    public ILookupParameter<IRandom> RandomParameter {
     
    5656    }
    5757
    58     protected override ISchedule CreateSolution() {
     58    protected override JSMEncoding CreateSolution() {
    5959      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    6060    }
Note: See TracChangeset for help on using the changeset viewer.