Changeset 8887 for trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers
- Timestamp:
- 11/11/12 22:57:09 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVCrossover.cs
r8603 r8887 27 27 [Item("PRVCrossover", "An operator which crosses two PRV representations.")] 28 28 [StorableClass] 29 public abstract class PRVCrossover : ScheduleCrossover<PRVEncoding>, IPRVOperator { 29 public abstract class PRVCrossover : ScheduleCrossover, IPRVOperator { 30 30 31 [StorableConstructor] 31 32 protected PRVCrossover(bool deserializing) : base(deserializing) { } … … 37 38 } 38 39 39 40 40 public abstract PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2); 41 41 42 42 public override IOperation Apply() { 43 ItemArray<PRVEncoding>parents = ParentsParameter.ActualValue;43 var parents = ParentsParameter.ActualValue; 44 44 ChildParameter.ActualValue = 45 45 Cross(RandomParameter.ActualValue, parents[0] as PRVEncoding, parents[1] as PRVEncoding); -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVDiscreteCrossover.cs
r8603 r8887 29 29 [StorableClass] 30 30 public class PRVDiscreteCrossover : PRVCrossover { 31 31 32 [StorableConstructor] 32 33 protected PRVDiscreteCrossover(bool deserializing) : base(deserializing) { } 33 protected PRVDiscreteCrossover(PRVDiscreteCrossover original, Cloner cloner) 34 : base(original, cloner) {35 } 34 protected PRVDiscreteCrossover(PRVDiscreteCrossover original, Cloner cloner) : base(original, cloner) { } 35 public PRVDiscreteCrossover() : base() { } 36 36 37 public override IDeepCloneable Clone(Cloner cloner) { 37 38 return new PRVDiscreteCrossover(this, cloner); 38 39 } 39 public PRVDiscreteCrossover() : base() { }40 41 40 42 41 public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) { 43 42 return new PRVEncoding(DiscreteCrossover.Apply(random, new ItemArray<IntegerVector>(new IntegerVector[] { parent1.PriorityRulesVector, parent2.PriorityRulesVector })), parent1.NrOfRules); 44 43 } 44 45 45 public override PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2) { 46 46 return Apply(random, parent1, parent2); -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVSinglePointCrossover.cs
r8603 r8887 29 29 [StorableClass] 30 30 public class PRVSinglePointCrossover : PRVCrossover { 31 31 32 [StorableConstructor] 32 33 protected PRVSinglePointCrossover(bool deserializing) : base(deserializing) { } 33 protected PRVSinglePointCrossover(PRVSinglePointCrossover original, Cloner cloner) 34 : base(original, cloner) {35 } 34 protected PRVSinglePointCrossover(PRVSinglePointCrossover original, Cloner cloner) : base(original, cloner) { } 35 public PRVSinglePointCrossover() : base() { } 36 36 37 public override IDeepCloneable Clone(Cloner cloner) { 37 38 return new PRVSinglePointCrossover(this, cloner); 38 39 } 39 public PRVSinglePointCrossover() : base() { }40 40 41 41 public static PRVEncoding Apply(IRandom random, PRVEncoding parent1, PRVEncoding parent2) {
Note: See TracChangeset
for help on using the changeset viewer.