Changeset 9321
- Timestamp:
- 03/20/13 10:34:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r8922 r9321 37 37 IVRPEvaluator moveEvaluator; 38 38 39 private object locker = new object(); 40 39 41 public IVRPEvaluator MoveEvaluator { 40 42 get { 41 if (evaluator == null) 42 return null; 43 else { 44 if (moveEvaluator == null) { 45 moveEvaluator = evaluator.Clone() as IVRPEvaluator; 46 47 foreach (IParameter parameter in moveEvaluator.Parameters) { 48 if (parameter is ILookupParameter 49 && parameter != moveEvaluator.ProblemInstanceParameter 50 && parameter != moveEvaluator.VRPToursParameter) { 51 (parameter as ILookupParameter).ActualName = 52 VRPMoveEvaluator.MovePrefix + 53 (parameter as ILookupParameter).ActualName; 43 lock (locker) { 44 if (evaluator == null) 45 return null; 46 else { 47 if (moveEvaluator == null) { 48 moveEvaluator = evaluator.Clone() as IVRPEvaluator; 49 50 foreach (IParameter parameter in moveEvaluator.Parameters) { 51 if (parameter is ILookupParameter 52 && parameter != moveEvaluator.ProblemInstanceParameter 53 && parameter != moveEvaluator.VRPToursParameter) { 54 (parameter as ILookupParameter).ActualName = 55 VRPMoveEvaluator.MovePrefix + 56 (parameter as ILookupParameter).ActualName; 57 } 54 58 } 55 59 } 60 61 return moveEvaluator; 56 62 } 57 58 return moveEvaluator;59 63 } 60 64 } … … 176 180 177 181 set { 178 moveEvaluator = null; 179 evaluator = value; 180 EvalBestKnownSolution(); 182 lock (locker) { 183 moveEvaluator = null; 184 evaluator = value; 185 EvalBestKnownSolution(); 186 } 181 187 } 182 188 }
Note: See TracChangeset
for help on using the changeset viewer.