Changeset 8887 for trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators
- Timestamp:
- 11/11/12 22:57:09 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVManipulator.cs
r8603 r8887 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 27 28 [Item("PRVManipulator", "An operator which manipulates a PRV representation.")] 28 29 [StorableClass] 29 public abstract class PRVManipulator : ScheduleManipulator <PRVEncoding>, IPRVOperator {30 public abstract class PRVManipulator : ScheduleManipulator, IPRVOperator { 30 31 [StorableConstructor] 31 32 protected PRVManipulator(bool deserializing) : base(deserializing) { } … … 36 37 } 37 38 39 protected abstract void Manipulate(IRandom random, PRVEncoding individual); 38 40 39 protected abstract void Manipulate(IRandom random, PRVEncoding individual);40 41 public override IOperation Apply() { 41 PRVEncoding solution = ScheduleEncodingParameter.ActualValue; 42 var solution = ScheduleEncodingParameter.ActualValue as PRVEncoding; 43 if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PRVEncoding."); 42 44 Manipulate(RandomParameter.ActualValue, solution); 43 45 return base.Apply(); -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVUniformOnePositionManipulator.cs
r8882 r8887 27 27 28 28 namespace HeuristicLab.Encodings.ScheduleEncoding.PriorityRulesVector { 29 30 29 [Item("PRVUniformOnePositionManipulator", "Represents a manipulation operation inserting parts of the individual at another position.")] 31 30 [StorableClass] 32 31 public class PRVUniformOnePositionManipulator : PRVManipulator { 32 33 33 [StorableConstructor] 34 34 protected PRVUniformOnePositionManipulator(bool deserializing) : base(deserializing) { } 35 protected PRVUniformOnePositionManipulator(PRVUniformOnePositionManipulator original, Cloner cloner) 36 : base(original, cloner) {37 } 35 protected PRVUniformOnePositionManipulator(PRVUniformOnePositionManipulator original, Cloner cloner) : base(original, cloner) { } 36 public PRVUniformOnePositionManipulator() : base() { } 37 38 38 public override IDeepCloneable Clone(Cloner cloner) { 39 39 return new PRVUniformOnePositionManipulator(this, cloner); 40 40 } 41 public PRVUniformOnePositionManipulator() : base() { }42 43 41 44 42 public static void Apply(IRandom random, PRVEncoding individual) {
Note: See TracChangeset
for help on using the changeset viewer.