- Timestamp:
- 12/28/10 01:44:33 (14 years ago)
- Location:
- branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestAverageWorstVRPToursCalculator.cs
r5177 r5178 243 243 } 244 244 245 public override IOperation Apply( IExecutionContext context) {245 public override IOperation Apply() { 246 246 UpdateOverloads(); 247 247 UpdateTardiness(); … … 250 250 UpdateVehiclesUtilized(); 251 251 252 return base.Apply( context);252 return base.Apply(); 253 253 } 254 254 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPSolutionAnalyzer.cs
r5177 r5178 132 132 } 133 133 134 public override IOperation Apply( IExecutionContext context) {134 public override IOperation Apply() { 135 135 DoubleMatrix coordinates = CoordinatesParameter.ActualValue; 136 136 ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue; … … 188 188 } 189 189 190 return base.Apply( context);190 return base.Apply(); 191 191 } 192 192 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPToursMemorizer.cs
r5177 r5178 89 89 } 90 90 91 public override IOperation Apply( IExecutionContext context) {91 public override IOperation Apply() { 92 92 int i = OverloadParameter.ActualValue.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index; 93 93 if (BestOverloadParameter.ActualValue == null) … … 120 120 BestVehiclesUtilizedParameter.ActualValue.Value = VehiclesUtilizedParameter.ActualValue[i].Value; 121 121 122 return base.Apply( context);122 return base.Apply(); 123 123 } 124 124 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaCrossover.cs
r5177 r5178 44 44 } 45 45 46 protected abstract AlbaEncoding Crossover(I ExecutionContext context, IRandom random, AlbaEncoding parent1, AlbaEncoding parent2);46 protected abstract AlbaEncoding Crossover(IRandom random, AlbaEncoding parent1, AlbaEncoding parent2); 47 47 48 public override IOperation Apply( IExecutionContext context) {48 public override IOperation Apply() { 49 49 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 50 50 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { … … 61 61 62 62 ChildParameter.ActualValue = 63 Crossover( context,RandomParameter.ActualValue, parents[0] as AlbaEncoding, parents[1] as AlbaEncoding);63 Crossover(RandomParameter.ActualValue, parents[0] as AlbaEncoding, parents[1] as AlbaEncoding); 64 64 65 return base.Apply( context);65 return base.Apply(); 66 66 } 67 67 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r5177 r5178 47 47 } 48 48 49 protected override AlbaEncoding Crossover(I ExecutionContext context, IRandom random, AlbaEncoding parent1, AlbaEncoding parent2) {49 protected override AlbaEncoding Crossover(IRandom random, AlbaEncoding parent1, AlbaEncoding parent2) { 50 50 //note - the inner crossover is called here and the result is converted to an alba representation 51 51 //some refactoring should be done here in the future - the crossover operation should be called directly 52 52 53 53 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 54 IAtomicOperation op = context.CreateOperation(55 InnerCrossoverParameter.ActualValue, context.Scope);54 IAtomicOperation op = this.ExecutionContext.CreateOperation( 55 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 56 56 op.Operator.Execute((IExecutionContext)op); 57 57 58 58 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 59 if ( context.Scope.Variables.ContainsKey(childName)) {60 Permutation permutation = context.Scope.Variables[childName].Value as Permutation;61 context.Scope.Variables.Remove(childName);59 if (ExecutionContext.Scope.Variables.ContainsKey(childName)) { 60 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation; 61 ExecutionContext.Scope.Variables.Remove(childName); 62 62 63 63 return new AlbaEncoding(permutation, Cities); -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaCustomerInsertionManipulator.cs
r5177 r5178 41 41 } 42 42 43 protected override void Manipulate(I ExecutionContext context, IRandom random, AlbaEncoding individual) {43 protected override void Manipulate(IRandom random, AlbaEncoding individual) { 44 44 AlbaEncoding original = (AlbaEncoding)individual.Clone(); 45 45 int cutIndex, insertIndex, number; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaCustomerInversionManipulator.cs
r5177 r5178 41 41 return new AlbaCustomerInversionManipulator(this, cloner); 42 42 } 43 protected override void Manipulate(I ExecutionContext context, IRandom random, AlbaEncoding individual) {43 protected override void Manipulate(IRandom random, AlbaEncoding individual) { 44 44 int breakPoint1, breakPoint2; 45 45 -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaCustomerSwapManipulator.cs
r5177 r5178 38 38 } 39 39 40 protected override void Manipulate(I ExecutionContext context, IRandom random, AlbaEncoding individual) {40 protected override void Manipulate(IRandom random, AlbaEncoding individual) { 41 41 int index1, index2, temp; 42 42 -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaIntraRouteInversionManipulator.cs
r5177 r5178 52 52 } 53 53 54 protected override void Manipulate(I ExecutionContext context, IRandom rand, AlbaEncoding individual) {54 protected override void Manipulate(IRandom rand, AlbaEncoding individual) { 55 55 int index1 = -1; 56 56 int index2 = -1; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaLambdaInterchangeManipulator.cs
r5177 r5178 102 102 } 103 103 104 protected override void Manipulate(I ExecutionContext context, IRandom rand, AlbaEncoding individual) {104 protected override void Manipulate(IRandom rand, AlbaEncoding individual) { 105 105 List<Tour> tours = individual.GetTours(); 106 106 int lambda = LambdaParameter.Value.Value; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaManipulator.cs
r5177 r5178 44 44 } 45 45 46 protected abstract void Manipulate(I ExecutionContext context, IRandom random, AlbaEncoding individual);46 protected abstract void Manipulate(IRandom random, AlbaEncoding individual); 47 47 48 48 protected int FindCustomerLocation(int customer, AlbaEncoding individual) { … … 58 58 } 59 59 60 public override IOperation Apply( IExecutionContext context) {60 public override IOperation Apply() { 61 61 IVRPEncoding solution = VRPToursParameter.ActualValue; 62 62 if (!(solution is AlbaEncoding)) { … … 64 64 } 65 65 66 Manipulate( context,RandomParameter.ActualValue, VRPToursParameter.ActualValue as AlbaEncoding);66 Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as AlbaEncoding); 67 67 68 return base.Apply( context);68 return base.Apply(); 69 69 } 70 70 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs
r5177 r5178 46 46 } 47 47 48 protected override void Manipulate(I ExecutionContext context, IRandom random, AlbaEncoding individual) {48 protected override void Manipulate(IRandom random, AlbaEncoding individual) { 49 49 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; 50 50 51 IAtomicOperation op = context.CreateOperation(52 InnerManipulatorParameter.ActualValue, context.Scope);51 IAtomicOperation op = this.ExecutionContext.CreateOperation( 52 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 53 53 op.Operator.Execute((IExecutionContext)op); 54 54 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveMaker.cs
r5177 r5178 80 80 } 81 81 82 public override IOperation Apply( IExecutionContext context) {83 IOperation successor = base.Apply( context);82 public override IOperation Apply() { 83 IOperation successor = base.Apply(); 84 84 85 85 VehcilesUtilizedParameter.ActualValue = MoveVehcilesUtilizedParameter.ActualValue; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaMoveOperator.cs
r5177 r5178 36 36 } 37 37 38 public override IOperation Apply( IExecutionContext context) {38 public override IOperation Apply() { 39 39 IVRPEncoding solution = VRPToursParameter.ActualValue; 40 40 if (!(solution is AlbaEncoding)) { … … 43 43 } 44 44 45 return base.Apply( context);45 return base.Apply(); 46 46 } 47 47 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/AlbaPermutationMoveOperator.cs
r5177 r5178 39 39 } 40 40 41 public override IOperation Apply( IExecutionContext context) {42 IOperation next = base.Apply( context);41 public override IOperation Apply() { 42 IOperation next = base.Apply(); 43 43 44 44 IVRPEncoding solution = VRPToursParameter.ActualValue; 45 45 46 46 PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName; 47 IAtomicOperation op = context.CreateChildOperation(PermutationMoveOperatorParameter);47 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter); 48 48 op.Operator.Execute((IExecutionContext)op); 49 49 -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveGenerator.cs
r5177 r5178 49 49 protected abstract AlbaIntraRouteInversionMove[] GenerateMoves(AlbaEncoding individual); 50 50 51 public override IOperation Apply( IExecutionContext context) {52 IOperation next = base.Apply( context);51 public override IOperation Apply() { 52 IOperation next = base.Apply(); 53 53 54 54 AlbaEncoding individual = VRPToursParameter.ActualValue as AlbaEncoding; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMoveMaker.cs
r5177 r5178 62 62 } 63 63 64 public override IOperation Apply( IExecutionContext context) {65 IOperation next = base.Apply( context);64 public override IOperation Apply() { 65 IOperation next = base.Apply(); 66 66 67 67 AlbaIntraRouteInversionMove move = IntraRouteInversionMoveParameter.ActualValue; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveGenerator.cs
r5177 r5178 61 61 protected abstract AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, int lambda); 62 62 63 public override IOperation Apply( IExecutionContext context) {64 IOperation next = base.Apply( context);63 public override IOperation Apply() { 64 IOperation next = base.Apply(); 65 65 66 66 AlbaEncoding individual = VRPToursParameter.ActualValue as AlbaEncoding; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaLambdaInterchangeMoveMaker.cs
r5177 r5178 67 67 } 68 68 69 public override IOperation Apply( IExecutionContext context) {70 IOperation next = base.Apply( context);69 public override IOperation Apply() { 70 IOperation next = base.Apply(); 71 71 72 72 AlbaLambdaInterchangeMove move = LambdaInterchangeMoveParameter.ActualValue; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r5177 r5178 84 84 } 85 85 86 public override IOperation Apply( IExecutionContext context) {87 IOperation successor = base.Apply( context);86 public override IOperation Apply() { 87 IOperation successor = base.Apply(); 88 88 89 89 Permutation permutation = VRPToursParameter.ActualValue as Permutation; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs
r5177 r5178 61 61 return new AlbaTranslocationMoveMaker(this, cloner); 62 62 } 63 public override IOperation Apply( IExecutionContext context) {64 IOperation next = base.Apply( context);63 public override IOperation Apply() { 64 IOperation next = base.Apply(); 65 65 66 66 IVRPEncoding solution = VRPToursParameter.ActualValue; 67 67 68 68 moveMaker.PermutationParameter.ActualName = VRPToursParameter.ActualName; 69 IAtomicOperation op = context.CreateChildOperation(moveMaker);69 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(moveMaker); 70 70 op.Operator.Execute((IExecutionContext)op); 71 71 -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Crossovers/GVRCrossover.cs
r5177 r5178 101 101 } 102 102 103 public override IOperation Apply( IExecutionContext context) {103 public override IOperation Apply() { 104 104 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 105 105 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { … … 116 116 ChildParameter.ActualValue = Crossover(RandomParameter.ActualValue, parents[0] as GVREncoding, parents[1] as GVREncoding); 117 117 118 return base.Apply( context);118 return base.Apply(); 119 119 } 120 120 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/GVR/Manipulators/GVRManipulator.cs
r5177 r5178 50 50 protected abstract void Manipulate(IRandom random, GVREncoding individual); 51 51 52 public override IOperation Apply( IExecutionContext context) {52 public override IOperation Apply() { 53 53 IVRPEncoding solution = VRPToursParameter.ActualValue; 54 54 if (!(solution is GVREncoding)) { … … 59 59 Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as GVREncoding); 60 60 61 return base.Apply( context);61 return base.Apply(); 62 62 } 63 63 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/DefaultRepresentationCreator.cs
r5177 r5178 38 38 public DefaultRepresentationCreator() : base() { } 39 39 40 public override IOperation Apply( IExecutionContext context) {40 public override IOperation Apply() { 41 41 //choose default encoding here 42 42 VRPToursParameter.ActualValue = PotvinEncoding.ConvertFrom(CreateSolution()); 43 43 44 return base.Apply( context);44 return base.Apply(); 45 45 } 46 46 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/MultiVRPSolutionCreator.cs
r5177 r5178 135 135 } 136 136 137 public override IOperation Apply( IExecutionContext context) {137 public override IOperation Apply() { 138 138 if (Operators.Count == 0) throw new InvalidOperationException(Name + ": Please add at least one VRP creator to choose from."); 139 return base.Apply( context);139 return base.Apply(); 140 140 } 141 141 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r5177 r5178 142 142 } 143 143 144 public override IOperation Apply( IExecutionContext context) {144 public override IOperation Apply() { 145 145 if (Operators.Count == 0) throw new InvalidOperationException(Name + ": Please add at least one permutation crossover to choose from."); 146 return base.Apply( context);146 return base.Apply(); 147 147 } 148 148 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Crossovers/RandomParentCloneCrossover.cs
r5177 r5178 57 57 } 58 58 59 public override IOperation Apply( IExecutionContext context) {59 public override IOperation Apply() { 60 60 if (RandomParameter.ActualValue.Next() < 0.5) 61 61 ChildParameter.ActualValue = ParentsParameter.ActualValue[0].Clone() as IVRPEncoding; … … 63 63 ChildParameter.ActualValue = ParentsParameter.ActualValue[1].Clone() as IVRPEncoding; 64 64 65 return base.Apply( context);65 return base.Apply(); 66 66 } 67 67 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r5177 r5178 140 140 } 141 141 142 public override IOperation Apply( IExecutionContext context) {142 public override IOperation Apply() { 143 143 if (Operators.Count == 0) throw new InvalidOperationException(Name + ": Please add at least one permutation manipulator to choose from."); 144 return base.Apply( context);144 return base.Apply(); 145 145 } 146 146 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveGenerator.cs
r5177 r5178 187 187 } 188 188 189 public override IOperation Apply( IExecutionContext context) {189 public override IOperation Apply() { 190 190 if (Operators.Count == 0) throw new InvalidOperationException(Name + ": Please add at least one VRP move generator choose from."); 191 OperationCollection next = new OperationCollection(base.Apply( context));191 OperationCollection next = new OperationCollection(base.Apply()); 192 192 193 193 for (int i = 0; i < SampleSizeParameter.ActualValue.Value; i++) { … … 215 215 216 216 if (successor != null) { 217 next.Insert(0, context.CreateChildOperation(successor));217 next.Insert(0, ExecutionContext.CreateChildOperation(successor)); 218 218 } 219 219 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r5177 r5178 107 107 } 108 108 109 public override IOperation Apply( IExecutionContext context) {110 IOperation next = base.Apply( context);109 public override IOperation Apply() { 110 IOperation next = base.Apply(); 111 111 112 112 IVRPEncoding solution = VRPToursParameter.ActualValue as IVRPEncoding; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinCrossover.cs
r5177 r5178 125 125 } 126 126 127 public override IOperation Apply( IExecutionContext context) {127 public override IOperation Apply() { 128 128 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 129 129 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { … … 140 140 ChildParameter.ActualValue = Crossover(RandomParameter.ActualValue, parents[0] as PotvinEncoding, parents[1] as PotvinEncoding); 141 141 142 return base.Apply( context);142 return base.Apply(); 143 143 } 144 144 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs
r5177 r5178 80 80 } 81 81 82 public override IOperation Apply( IExecutionContext context) {82 public override IOperation Apply() { 83 83 IVRPEncoding solution = VRPToursParameter.ActualValue; 84 84 if (!(solution is PotvinEncoding)) { … … 88 88 Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as PotvinEncoding); 89 89 90 return base.Apply( context);90 return base.Apply(); 91 91 } 92 92 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsCrossover.cs
r5177 r5178 65 65 } 66 66 67 protected abstract PrinsEncoding Crossover(I ExecutionContext context, IRandom random, PrinsEncoding parent1, PrinsEncoding parent2);67 protected abstract PrinsEncoding Crossover(IRandom random, PrinsEncoding parent1, PrinsEncoding parent2); 68 68 69 public override IOperation Apply( IExecutionContext context) {69 public override IOperation Apply() { 70 70 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 71 71 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { … … 95 95 96 96 ChildParameter.ActualValue = 97 Crossover( context,RandomParameter.ActualValue, parents[0] as PrinsEncoding, parents[1] as PrinsEncoding);97 Crossover(RandomParameter.ActualValue, parents[0] as PrinsEncoding, parents[1] as PrinsEncoding); 98 98 99 return base.Apply( context);99 return base.Apply(); 100 100 } 101 101 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r5177 r5178 45 45 } 46 46 47 protected override PrinsEncoding Crossover(I ExecutionContext context, IRandom random, PrinsEncoding parent1, PrinsEncoding parent2) {47 protected override PrinsEncoding Crossover(IRandom random, PrinsEncoding parent1, PrinsEncoding parent2) { 48 48 //note - the inner crossover is called here and the result is converted to a prins representation 49 49 //some refactoring should be done here in the future - the crossover operation should be called directly 50 50 51 51 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 52 IAtomicOperation op = context.CreateOperation(53 InnerCrossoverParameter.ActualValue, context.Scope);52 IAtomicOperation op = this.ExecutionContext.CreateOperation( 53 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 54 54 op.Operator.Execute((IExecutionContext)op); 55 55 56 56 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 57 if ( context.Scope.Variables.ContainsKey(childName)) {58 Permutation permutation = context.Scope.Variables[childName].Value as Permutation;59 context.Scope.Variables.Remove(childName);57 if (ExecutionContext.Scope.Variables.ContainsKey(childName)) { 58 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation; 59 ExecutionContext.Scope.Variables.Remove(childName); 60 60 61 61 return new PrinsEncoding(permutation, Cities, -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsExhaustiveLSManipulator.cs
r5177 r5178 39 39 } 40 40 41 protected override void Manipulate(I ExecutionContext context, IRandom random, PrinsEncoding individual) {41 protected override void Manipulate(IRandom random, PrinsEncoding individual) { 42 42 List<Tour> tours = individual.GetTours(DistanceMatrixParameter); 43 43 bool improvement = false; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsManipulator.cs
r5177 r5178 64 64 } 65 65 66 protected abstract void Manipulate(I ExecutionContext context, IRandom random, PrinsEncoding individual);66 protected abstract void Manipulate(IRandom random, PrinsEncoding individual); 67 67 68 public override IOperation Apply( IExecutionContext context) {68 public override IOperation Apply() { 69 69 IVRPEncoding solution = VRPToursParameter.ActualValue; 70 70 if (!(solution is PrinsEncoding)) { … … 86 86 } 87 87 88 Manipulate( context,RandomParameter.ActualValue, VRPToursParameter.ActualValue as PrinsEncoding);88 Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as PrinsEncoding); 89 89 90 return base.Apply( context);90 return base.Apply(); 91 91 } 92 92 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs
r5177 r5178 45 45 } 46 46 47 protected override void Manipulate(I ExecutionContext context, IRandom random, PrinsEncoding individual) {47 protected override void Manipulate(IRandom random, PrinsEncoding individual) { 48 48 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; 49 49 50 IAtomicOperation op = context.CreateOperation(51 InnerManipulatorParameter.ActualValue, context.Scope);50 IAtomicOperation op = this.ExecutionContext.CreateOperation( 51 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 52 52 op.Operator.Execute((IExecutionContext)op); 53 53 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs
r5177 r5178 46 46 } 47 47 48 protected override void Manipulate(I ExecutionContext context, IRandom random, PrinsEncoding individual) {48 protected override void Manipulate(IRandom random, PrinsEncoding individual) { 49 49 List<Tour> tours = individual.GetTours(DistanceMatrixParameter); 50 50 bool improvement = false; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuCrossover.cs
r5177 r5178 45 45 } 46 46 47 protected abstract ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2);47 protected abstract ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2); 48 48 49 public override IOperation Apply( IExecutionContext context) {49 public override IOperation Apply() { 50 50 ItemArray<IVRPEncoding> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length); 51 51 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { … … 70 70 71 71 ChildParameter.ActualValue = 72 Crossover( context,RandomParameter.ActualValue, parents[0] as ZhuEncoding, parents[1] as ZhuEncoding);72 Crossover(RandomParameter.ActualValue, parents[0] as ZhuEncoding, parents[1] as ZhuEncoding); 73 73 74 return base.Apply( context);74 return base.Apply(); 75 75 } 76 76 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover1.cs
r5177 r5178 49 49 } 50 50 51 protected override ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) {51 protected override ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) { 52 52 parent1 = parent1.Clone() as ZhuEncoding; 53 53 parent2 = parent2.Clone() as ZhuEncoding; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuHeuristicCrossover2.cs
r5177 r5178 41 41 } 42 42 43 protected override ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) {43 protected override ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) { 44 44 List<int> p1 = new List<int>(parent1); 45 45 List<int> p2 = new List<int>(parent2); -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuMergeCrossover1.cs
r5177 r5178 49 49 } 50 50 51 protected override ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) {51 protected override ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) { 52 52 parent1 = parent1.Clone() as ZhuEncoding; 53 53 parent2 = parent2.Clone() as ZhuEncoding; -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuMergeCrossover2.cs
r5177 r5178 41 41 } 42 42 43 protected override ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) {43 protected override ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) { 44 44 List<int> p1 = new List<int>(parent1); 45 45 List<int> p2 = new List<int>(parent2); -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Crossovers/ZhuPermutationCrossover.cs
r5177 r5178 47 47 } 48 48 49 protected override ZhuEncoding Crossover(I ExecutionContext context, IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) {49 protected override ZhuEncoding Crossover(IRandom random, ZhuEncoding parent1, ZhuEncoding parent2) { 50 50 //note - the inner crossover is called here and the result is converted to a prins representation 51 51 //some refactoring should be done here in the future - the crossover operation should be called directly 52 52 53 53 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 54 IAtomicOperation op = context.CreateOperation(55 InnerCrossoverParameter.ActualValue, context.Scope);54 IAtomicOperation op = this.ExecutionContext.CreateOperation( 55 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 56 56 op.Operator.Execute((IExecutionContext)op); 57 57 58 58 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 59 if ( context.Scope.Variables.ContainsKey(childName)) {60 Permutation permutation = context.Scope.Variables[childName].Value as Permutation;61 context.Scope.Variables.Remove(childName);59 if (ExecutionContext.Scope.Variables.ContainsKey(childName)) { 60 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation; 61 ExecutionContext.Scope.Variables.Remove(childName); 62 62 63 63 return new ZhuEncoding(permutation, Cities, -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Manipulators/ZhuManipulator.cs
r5177 r5178 45 45 } 46 46 47 protected abstract void Manipulate(I ExecutionContext context, IRandom random, ZhuEncoding individual);47 protected abstract void Manipulate(IRandom random, ZhuEncoding individual); 48 48 49 public override IOperation Apply( IExecutionContext context) {49 public override IOperation Apply() { 50 50 IVRPEncoding solution = VRPToursParameter.ActualValue; 51 51 if (!(solution is ZhuEncoding)) { … … 62 62 } 63 63 64 Manipulate( context,RandomParameter.ActualValue, VRPToursParameter.ActualValue as ZhuEncoding);64 Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as ZhuEncoding); 65 65 66 return base.Apply( context);66 return base.Apply(); 67 67 } 68 68 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Zhu/Manipulators/ZhuPermutationManipulator.cs
r5177 r5178 47 47 } 48 48 49 protected override void Manipulate(I ExecutionContext context, IRandom random, ZhuEncoding individual) {49 protected override void Manipulate(IRandom random, ZhuEncoding individual) { 50 50 InnerManipulatorParameter.ActualValue.PermutationParameter.ActualName = VRPToursParameter.ActualName; 51 51 52 IAtomicOperation op = context.CreateOperation(53 InnerManipulatorParameter.ActualValue, context.Scope);52 IAtomicOperation op = this.ExecutionContext.CreateOperation( 53 InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope); 54 54 op.Operator.Execute((IExecutionContext)op); 55 55 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Evaluators/VRPEvaluator.cs
r5177 r5178 214 214 } 215 215 216 public sealed override IOperation Apply( IExecutionContext context) {216 public sealed override IOperation Apply() { 217 217 IVRPEncoding solution = VRPToursParameter.ActualValue; 218 218 … … 229 229 TardinessParameter.ActualValue = new DoubleValue(sumEval.Tardiness); 230 230 231 return base.Apply( context);231 return base.Apply(); 232 232 } 233 233 } -
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/MoveEvaluators/VRPMoveEvaluator.cs
r5177 r5178 99 99 protected abstract TourEvaluation GetMoveQuality(); 100 100 101 public override IOperation Apply( IExecutionContext context) {101 public override IOperation Apply() { 102 102 TourEvaluation tourEval = GetMoveQuality(); 103 103 … … 109 109 MoveTravelTimeParameter.ActualValue = new DoubleValue(tourEval.TravelTime); 110 110 111 return base.Apply( context);111 return base.Apply(); 112 112 } 113 113 }
Note: See TracChangeset
for help on using the changeset viewer.