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

Legend:

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

    r13443 r13469  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2827  [Item("DirectScheduleDecoder", "An item used to convert a direct schedule into a generalized schedule.")]
    2928  [StorableClass]
    30   public class DirectScheduleDecoder : ScheduleDecoder {
     29  public class DirectScheduleDecoder : ScheduleDecoder<Schedule> {
    3130    [StorableConstructor]
    3231    protected DirectScheduleDecoder(bool deserializing) : base(deserializing) { }
     
    3837    }
    3938
    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);
    4441    }
    4542
    46     public static Schedule DecodeSchedule(Schedule solution, ItemList<Job> jobData) {
     43    public static Schedule Decode(Schedule solution, ItemList<Job> jobData) {
    4744      return solution;
    4845    }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/DirectScheduleRandomCreator.cs

    r13443 r13469  
    3030  [Item("DirectScheduleRandomCreator", "Creator class used to create schedule encoding objects.")]
    3131  [StorableClass]
    32   public class DirectScheduleRandomCreator : ScheduleCreator, IStochasticOperator, IDirectScheduleOperator {
     32  public class DirectScheduleRandomCreator : ScheduleCreator<Schedule>, IStochasticOperator, IDirectScheduleOperator {
    3333
    3434    public ILookupParameter<IRandom> RandomParameter {
     
    6868
    6969
    70 
    71     protected override ISchedule CreateSolution() {
     70    protected override Schedule CreateSolution() {
    7271      var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
    7372      var pwrEncoding = new PWREncoding(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value,
Note: See TracChangeset for help on using the changeset viewer.