- Timestamp:
- 09/08/10 11:37:00 (14 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings
- Files:
-
- 29 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs
r4369 r4370 35 35 } 36 36 37 public override ILookupParameter VRPMoveParameter { 38 get { return TranslocationMoveParameter; } 39 } 40 37 41 [StorableConstructor] 38 42 private AlbaTranslocationMoveEvaluator(bool deserializing) : base(deserializing) { } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r4369 r4370 56 56 } 57 57 58 public override ILookupParameter VRPMoveParameter { 59 get { return TranslocationMoveParameter; } 60 } 61 58 62 public ILookupParameter<Permutation> PermutationParameter { 59 63 get { -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs
r4369 r4370 37 37 } 38 38 39 public override ILookupParameter VRPMoveParameter { 40 get { return TranslocationMoveParameter; } 41 } 42 39 43 public ILookupParameter<Permutation> PermutationParameter { 40 44 get { return moveMaker.PermutationParameter; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveMaker.cs
r4369 r4370 55 55 private void UpdateMoveEvaluation() { 56 56 IVRPEvaluator evaluator = ProblemInstance.EvaluatorParameter.Value; 57 foreach (IParameter parameter in evaluator.Parameters) { 58 if (parameter is ILookupParameter 59 && parameter != evaluator.VRPToursParameter 60 && parameter != evaluator.ProblemInstanceParameter) { 61 ILookupParameter evaluatorParameter = parameter as ILookupParameter; 57 ICollection<IParameter> addedParameters = new List<IParameter>(); 58 59 try { 60 foreach (IParameter parameter in evaluator.Parameters) { 61 if (parameter is ILookupParameter 62 && parameter != evaluator.VRPToursParameter 63 && parameter != evaluator.ProblemInstanceParameter) { 64 ILookupParameter evaluatorParameter = parameter as ILookupParameter; 62 65 63 string resultName = evaluatorParameter.ActualName; 64 if (!this.Parameters.Exists(p => p.Name == resultName)) { 65 ILookupParameter resultParameter = new LookupParameter<IItem>(resultName); 66 resultParameter.ExecutionContext = ExecutionContext; 67 this.Parameters.Add(resultParameter); 66 string resultName = evaluatorParameter.ActualName; 67 if (!this.Parameters.Exists(p => p.Name == resultName)) { 68 ILookupParameter resultParameter = new LookupParameter<IItem>(resultName); 69 resultParameter.ExecutionContext = ExecutionContext; 70 this.Parameters.Add(resultParameter); 71 addedParameters.Add(resultParameter); 72 } 73 74 string moveResultName = VRPMoveEvaluator.MovePrefix + resultName; 75 if (!this.Parameters.Exists(p => p.Name == moveResultName)) { 76 ILookupParameter moveResultParameter = new LookupParameter<IItem>(moveResultName); 77 moveResultParameter.ExecutionContext = ExecutionContext; 78 this.Parameters.Add(moveResultParameter); 79 addedParameters.Add(moveResultParameter); 80 } 81 82 ILookupParameter result = Parameters[resultName] as ILookupParameter; 83 ILookupParameter moveResult = Parameters[moveResultName] as ILookupParameter; 84 result.ActualValue = moveResult.ActualValue.Clone() as IItem; 68 85 } 69 70 string moveResultName = VRPMoveEvaluator.MovePrefix + resultName; 71 if (!this.Parameters.Exists(p => p.Name == moveResultName)) { 72 ILookupParameter moveResultParameter = new LookupParameter<IItem>(moveResultName); 73 moveResultParameter.ExecutionContext = ExecutionContext; 74 this.Parameters.Add(moveResultParameter); 75 } 76 77 ILookupParameter result = Parameters[resultName] as ILookupParameter; 78 ILookupParameter moveResult = Parameters[moveResultName] as ILookupParameter; 79 result.ActualValue = moveResult.ActualValue.Clone() as IItem; 86 } 87 } 88 finally { 89 foreach(IParameter parameter in addedParameters) { 90 this.Parameters.Remove(parameter); 80 91 } 81 92 } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveOperator.cs
r4369 r4370 37 37 } 38 38 39 public abstract ILookupParameter VRPMoveParameter { get; } 40 39 41 [StorableConstructor] 40 42 protected VRPMoveOperator(bool deserializing) : base(deserializing) { }
Note: See TracChangeset
for help on using the changeset viewer.