- Timestamp:
- 08/04/10 17:34:02 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Creators/AlbaPushForwardInsertionCreator.cs
r4150 r4154 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.VehicleRouting.Encodings.General; 30 31 31 32 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { -
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; -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaManipulator.cs
r4150 r4154 28 28 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 29 29 [StorableClass] 30 public abstract class AlbaManipulator : VRPManipulator { 31 public ILookupParameter<IntValue> VehiclesParameter { 32 get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; } 33 } 34 35 public AlbaManipulator() 36 : base() { 37 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The vehicles count.")); 38 } 39 30 public abstract class AlbaManipulator : VRPManipulator { 40 31 protected virtual void Manipulate() { 41 32 } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveOperator.cs
r4150 r4154 29 29 [Item("AlbaMoveOperator", "A move operator for an alba VRP representation.")] 30 30 [StorableClass] 31 public abstract class AlbaMoveOperator : VRPMoveOperator { 32 public ILookupParameter<IntValue> VehiclesParameter { 33 get { return (ILookupParameter<IntValue>)Parameters["Vehicles"]; } 34 } 35 36 public AlbaMoveOperator() 37 : base() { 38 Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The vehicles count.")); 39 } 40 31 public abstract class AlbaMoveOperator : VRPMoveOperator { 41 32 [Storable] 42 33 protected abstract IPermutationMoveOperator PermutationMoveOperatorParameter { get; set; } -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r4068 r4154 82 82 Permutation permutation = VRPSolutionParameter.ActualValue as Permutation; 83 83 string moveName = TranslocationMoveGeneratorParameter.ActualValue.TranslocationMoveParameter.Name; 84 int cities = VRPSolutionParameter.ActualValue.Cities;85 84 86 85 List<Scope> toBeDeleted = new List<Scope>(); … … 93 92 if (move.Index1 - 1 >= 0 && 94 93 move.Index3 - 1 >= 0) 95 criteria1 = (permutation[move.Index1] >= cities &&96 permutation[move.Index1 - 1] >= cities &&97 permutation[move.Index3 - 1] >= cities);94 criteria1 = (permutation[move.Index1] >= Cities && 95 permutation[move.Index1 - 1] >= Cities && 96 permutation[move.Index3 - 1] >= Cities); 98 97 99 98 int index3 = move.Index3 + (move.Index2 - move.Index1) + 1; … … 101 100 if (move.Index2 + 1 < permutation.Length && 102 101 index3 < permutation.Length) 103 criteria2 = (permutation[move.Index2] >= cities &&104 permutation[move.Index2 + 1] >= cities &&105 permutation[index3] >= cities);102 criteria2 = (permutation[move.Index2] >= Cities && 103 permutation[move.Index2 + 1] >= Cities && 104 permutation[index3] >= Cities); 106 105 107 106 if (criteria1 && criteria2)
Note: See TracChangeset
for help on using the changeset viewer.