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.

File:
1 edited

Legend:

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

    r13443 r13469  
    3434namespace HeuristicLab.Encodings.ScheduleEncoding {
    3535  [StorableClass]
    36   public abstract class ScheduleEncoding<TSchedule> : Encoding<ISchedule>, IScheduleEncoding
     36  public abstract class ScheduleEncoding<TSchedule> : Encoding<TSchedule>, IScheduleEncoding
    3737  where TSchedule : class, ISchedule {
    3838    #region Encoding Parameters
     
    8585
    8686    [Storable]
    87     private IValueParameter<IScheduleDecoder> decoderParameter;
    88 
    89     public IValueParameter<IScheduleDecoder> DecoderParameter {
     87    private IValueParameter<IScheduleDecoder<TSchedule>> decoderParameter;
     88    public IValueParameter<IScheduleDecoder<TSchedule>> DecoderParameter {
    9089      get { return decoderParameter; }
    9190      set {
     
    114113    }
    115114
    116     public IScheduleDecoder Decoder {
     115    public IScheduleDecoder<TSchedule> Decoder {
    117116      get { return DecoderParameter.Value; }
    118117      set { DecoderParameter.Value = value; }
     
    123122    protected ScheduleEncoding(ScheduleEncoding<TSchedule> original, Cloner cloner)
    124123      : base(original, cloner) {
     124      jobDataParameter = cloner.Clone(original.JobDataParameter);
     125      jobsParameter = cloner.Clone(original.JobsParameter);
     126      resourcesParameter = cloner.Clone(original.ResourcesParameter);
     127      decoderParameter = cloner.Clone(original.DecoderParameter);
    125128    }
    126129
     
    135138      jobsParameter = new FixedValueParameter<IntValue>(Name + ".Jobs", new IntValue(jobs));
    136139      resourcesParameter = new FixedValueParameter<IntValue>(Name + ".Resources", new IntValue(resources));
    137       decoderParameter = new ValueParameter<IScheduleDecoder>(Name + ".Decoder");
     140      decoderParameter = new ValueParameter<IScheduleDecoder<TSchedule>>(Name + ".Decoder");
    138141
    139142      Parameters.Add(jobDataParameter);
     
    163166
    164167    public override void ConfigureOperators(IEnumerable<IItem> operators) {
    165       ConfigureCreators(operators.OfType<IScheduleCreator>());
     168      ConfigureCreators(operators.OfType<IScheduleCreator<TSchedule>>());
    166169      ConfigureCrossovers(operators.OfType<IScheduleCrossover>());
    167170      ConfigureManipulators(operators.OfType<IScheduleManipulator>());
    168171    }
    169172
    170     private void ConfigureCreators(IEnumerable<IScheduleCreator> creators) {
     173    private void ConfigureCreators(IEnumerable<IScheduleCreator<TSchedule>> creators) {
    171174      foreach (var creator in creators) {
    172175        creator.ScheduleParameter.ActualName = Name;
Note: See TracChangeset for help on using the changeset viewer.