- Timestamp:
- 03/29/11 15:40:01 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs
r4752 r5867 58 58 moveEvaluator.VRPMoveParameter.ActualName = VRPMoveParameter.Name; 59 59 IAtomicOperation op = this.ExecutionContext.CreateOperation(moveEvaluator); 60 op.Operator.Execute((IExecutionContext)op );60 op.Operator.Execute((IExecutionContext)op, CancellationToken); 61 61 } 62 62 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs
r4752 r5867 60 60 moveMaker.VRPMoveParameter.ActualName = VRPMoveParameter.Name; 61 61 IAtomicOperation op = this.ExecutionContext.CreateOperation(moveMaker); 62 op.Operator.Execute((IExecutionContext)op );62 op.Operator.Execute((IExecutionContext)op, CancellationToken); 63 63 } 64 64 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveEvaluator.cs
r5127 r5867 64 64 //helper method to evaluate an updated individual 65 65 protected void UpdateEvaluation(IVRPEncoding updatedTours) { 66 IVRPEvaluator evaluator = ProblemInstance.EvaluatorParameter.Value.Clone() as IVRPEvaluator; 67 68 Dictionary<IParameter, string> originalName = 69 new Dictionary<IParameter, string>(); 70 71 foreach (IParameter parameter in evaluator.Parameters) { 72 if (parameter is ILookupParameter 73 && parameter != evaluator.ProblemInstanceParameter 74 && parameter != evaluator.VRPToursParameter) { 75 originalName[parameter] = (parameter as ILookupParameter).ActualName; 76 77 (parameter as ILookupParameter).ActualName = 78 MovePrefix + 79 (parameter as ILookupParameter).ActualName; 80 } 81 } 66 IVRPEvaluator evaluator = ProblemInstance.MoveEvaluator; 82 67 83 68 try { … … 86 71 87 72 IAtomicOperation op = this.ExecutionContext.CreateChildOperation(evaluator); 88 op.Operator.Execute((IExecutionContext)op );73 op.Operator.Execute((IExecutionContext)op, CancellationToken); 89 74 } 90 75 finally { 91 foreach (IParameter parameter in originalName.Keys) {92 (parameter as ILookupParameter).ActualName = originalName[parameter];93 }94 95 76 this.ExecutionContext.Scope.Variables.Remove(evaluator.VRPToursParameter.ActualName); 96 77 }
Note: See TracChangeset
for help on using the changeset viewer.