Changeset 8887 for trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMSwapManipulator.cs
- Timestamp:
- 11/11/12 22:57:09 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMSwapManipulator.cs
r8603 r8887 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 27 28 namespace HeuristicLab.Encodings.ScheduleEncoding.JobSequenceMatrix { 28 29 29 [Item("JSMSwapManipulator", "Represents a manipulation operation swapping parts of the individual.")] 30 30 [StorableClass] 31 31 public class JSMSwapManipulator : JSMManipulator { 32 32 33 [StorableConstructor] 33 34 protected JSMSwapManipulator(bool deserializing) : base(deserializing) { } 34 protected JSMSwapManipulator(JSMSwapManipulator original, Cloner cloner) 35 : base(original, cloner) {36 } 35 protected JSMSwapManipulator(JSMSwapManipulator original, Cloner cloner) : base(original, cloner) { } 36 public JSMSwapManipulator() : base() { } 37 37 38 public override IDeepCloneable Clone(Cloner cloner) { 38 39 return new JSMSwapManipulator(this, cloner); 39 40 } 40 41 public JSMSwapManipulator() : base() { }42 43 41 44 42 public static void Apply(IRandom random, JSMEncoding individual) { … … 52 50 } 53 51 54 protected override void Manipulate(IRandom random, JSMEncoding individual) { 55 Apply(random, individual); 52 protected override void Manipulate(IRandom random, IScheduleEncoding individual) { 53 var solution = individual as JSMEncoding; 54 if (solution == null) throw new InvalidOperationException("Encoding is not of type JSMEncoding"); 55 Apply(random, solution); 56 56 } 57 57 }
Note: See TracChangeset
for help on using the changeset viewer.