Changeset 8887 for trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators
- Timestamp:
- 11/11/12 22:57:09 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators/DirectScheduleManipulator.cs
r8603 r8887 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 27 28 [Item("DirectScheduleManipulator", "An operator which manipulates a direct schedule representation.")] 28 29 [StorableClass] 29 public abstract class DirectScheduleManipulator : ScheduleManipulator<Schedule>, IDirectScheduleOperator { 30 public abstract class DirectScheduleManipulator : ScheduleManipulator, IDirectScheduleOperator { 31 30 32 [StorableConstructor] 31 33 protected DirectScheduleManipulator(bool deserializing) : base(deserializing) { } … … 36 38 } 37 39 40 protected abstract void Manipulate(IRandom random, Schedule individual); 38 41 39 protected abstract void Manipulate(IRandom random, Schedule individual);40 42 public override IOperation Apply() { 41 Schedule solution = ScheduleEncodingParameter.ActualValue; 42 Manipulate(RandomParameter.ActualValue, solution); 43 var schedule = ScheduleEncodingParameter.ActualValue as Schedule; 44 if (schedule == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type Schedule."); 45 Manipulate(RandomParameter.ActualValue, schedule); 43 46 return base.Apply(); 44 47 }
Note: See TracChangeset
for help on using the changeset viewer.