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/PermutationWithRepetition
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Decoder/PWRDecoder.cs

    r13443 r13469  
    2828  [Item("PWRDecoder", "An item used to convert a PWR-individual into a generalized schedule.")]
    2929  [StorableClass]
    30   public class PWRDecoder : ScheduleDecoder {
     30  public class PWRDecoder : ScheduleDecoder<PWREncoding> {
    3131    [StorableConstructor]
    3232    protected PWRDecoder(bool deserializing) : base(deserializing) { }
     
    3838    }
    3939
    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);
    4442    }
    4543
    46     public static Schedule DecodeSchedule(PWREncoding solution, ItemList<Job> jobData) {
     44    public static Schedule Decode(PWREncoding solution, ItemList<Job> jobData) {
    4745      var jobs = (ItemList<Job>)jobData.Clone();
    4846      var resultingSchedule = new Schedule(jobs[0].Tasks.Count);
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs

    r13437 r13469  
    2929  [Item("PermutationWithRepetitionRandomCreator", "Creates PWR-individuals at random.")]
    3030  [StorableClass]
    31   public class PWRRandomCreator : ScheduleCreator, IStochasticOperator {
     31  public class PWRRandomCreator : ScheduleCreator<PWREncoding>, IStochasticOperator {
    3232
    3333    public ILookupParameter<IRandom> RandomParameter {
     
    5151    }
    5252
    53     protected override ISchedule CreateSolution() {
     53    protected override PWREncoding CreateSolution() {
    5454      return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue);
    5555    }
Note: See TracChangeset for help on using the changeset viewer.