Changeset 13469 for branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding.cs
- Timestamp:
- 12/15/15 15:16:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding.cs
r13443 r13469 34 34 namespace HeuristicLab.Encodings.ScheduleEncoding { 35 35 [StorableClass] 36 public abstract class ScheduleEncoding<TSchedule> : Encoding< ISchedule>, IScheduleEncoding36 public abstract class ScheduleEncoding<TSchedule> : Encoding<TSchedule>, IScheduleEncoding 37 37 where TSchedule : class, ISchedule { 38 38 #region Encoding Parameters … … 85 85 86 86 [Storable] 87 private IValueParameter<IScheduleDecoder> decoderParameter; 88 89 public IValueParameter<IScheduleDecoder> DecoderParameter { 87 private IValueParameter<IScheduleDecoder<TSchedule>> decoderParameter; 88 public IValueParameter<IScheduleDecoder<TSchedule>> DecoderParameter { 90 89 get { return decoderParameter; } 91 90 set { … … 114 113 } 115 114 116 public IScheduleDecoder Decoder {115 public IScheduleDecoder<TSchedule> Decoder { 117 116 get { return DecoderParameter.Value; } 118 117 set { DecoderParameter.Value = value; } … … 123 122 protected ScheduleEncoding(ScheduleEncoding<TSchedule> original, Cloner cloner) 124 123 : 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); 125 128 } 126 129 … … 135 138 jobsParameter = new FixedValueParameter<IntValue>(Name + ".Jobs", new IntValue(jobs)); 136 139 resourcesParameter = new FixedValueParameter<IntValue>(Name + ".Resources", new IntValue(resources)); 137 decoderParameter = new ValueParameter<IScheduleDecoder >(Name + ".Decoder");140 decoderParameter = new ValueParameter<IScheduleDecoder<TSchedule>>(Name + ".Decoder"); 138 141 139 142 Parameters.Add(jobDataParameter); … … 163 166 164 167 public override void ConfigureOperators(IEnumerable<IItem> operators) { 165 ConfigureCreators(operators.OfType<IScheduleCreator >());168 ConfigureCreators(operators.OfType<IScheduleCreator<TSchedule>>()); 166 169 ConfigureCrossovers(operators.OfType<IScheduleCrossover>()); 167 170 ConfigureManipulators(operators.OfType<IScheduleManipulator>()); 168 171 } 169 172 170 private void ConfigureCreators(IEnumerable<IScheduleCreator > creators) {173 private void ConfigureCreators(IEnumerable<IScheduleCreator<TSchedule>> creators) { 171 174 foreach (var creator in creators) { 172 175 creator.ScheduleParameter.ActualName = Name;
Note: See TracChangeset
for help on using the changeset viewer.