- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting (added) merged: 8231,8246,8346,8455,8497,8600,8649,8651-8653,8720,8763,8894,8899,8905,8922,9010,9321
- Property svn:mergeinfo changed
-
branches/OaaS/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs
r8053 r9363 118 118 } 119 119 120 public VRPEvaluation Evaluate(IVRPProblemInstance instance, IVRPEncoding solution) {120 public virtual VRPEvaluation Evaluate(IVRPProblemInstance instance, IVRPEncoding solution) { 121 121 VRPEvaluation evaluation = CreateTourEvaluation(); 122 122 -
branches/OaaS/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r8053 r9363 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 } 183 189 184 190 public virtual double GetDistance(int start, int end, IVRPEncoding solution) { 185 double distance = 0.0;186 191 if (distanceMatrix == null && UseDistanceMatrix.Value) { 187 distanceMatrix = DistanceMatrix = CreateDistanceMatrix(); 188 } 189 190 if (distanceMatrix != null) 191 distance = distanceMatrix[start, end]; 192 else 193 distance = CalculateDistance(start, end); 194 195 return distance; 192 if (DistanceMatrix == null) DistanceMatrix = CreateDistanceMatrix(); 193 distanceMatrix = DistanceMatrix; 194 } 195 196 if (distanceMatrix != null) return distanceMatrix[start, end]; 197 return CalculateDistance(start, end); 196 198 } 197 199
Note: See TracChangeset
for help on using the changeset viewer.