- Timestamp:
- 08/04/10 17:34:02 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaCrossover.cs
r4150 r4154 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 29 29 [StorableClass] 30 public abstract class AlbaCrossover : VRPCrossover { 31 public ILookupParameter<IntValue> VehiclesParameter { 32 get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; } 33 } 34 35 public AlbaCrossover() 36 : base() { 37 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The vehicles count.")); 38 } 39 30 public abstract class AlbaCrossover : VRPCrossover { 40 31 protected virtual void Crossover() { 41 32 } 42 33 43 34 public override IOperation Apply() { 44 int cities = 0;45 46 35 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 47 36 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { 48 37 IVRPEncoding solution = ParentsParameter.ActualValue[i]; 49 cities = solution.Cities; 38 50 39 if (!(solution is AlbaEncoding)) { 51 40 parents[i] = AlbaEncoding.ConvertFrom(solution, VehiclesParameter.ActualValue.Value); -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r4150 r4154 39 39 40 40 protected override void Crossover() { 41 int cities = ParentsParameter.ActualValue[0].Cities;42 43 41 PermutationCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 44 42 IAtomicOperation op = this.ExecutionContext.CreateOperation( … … 51 49 ExecutionContext.Scope.Variables.Remove(childName); 52 50 53 ChildParameter.ActualValue = new AlbaEncoding(permutation, cities);51 ChildParameter.ActualValue = new AlbaEncoding(permutation, Cities); 54 52 } else 55 53 ChildParameter.ActualValue = null;
Note: See TracChangeset
for help on using the changeset viewer.