- Timestamp:
- 07/07/17 12:51:24 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r15069 r15168 194 194 195 195 private void EvalBestKnownSolution() { 196 if (BestKnownSolution != null) { 196 if (BestKnownSolution == null) return; 197 try { 197 198 //call evaluator 198 199 BestKnownQuality = new DoubleValue(ProblemInstance.Evaluate(BestKnownSolution.Solution).Quality); 199 200 BestKnownSolution.Quality = BestKnownQuality; 201 } catch { 202 BestKnownQuality = null; 203 BestKnownSolution = null; 200 204 } 201 205 } … … 207 211 void ProblemInstance_EvaluationChanged(object sender, EventArgs e) { 208 212 BestKnownQuality = null; 209 EvalBestKnownSolution(); 213 if (BestKnownSolution != null) { 214 // the tour is not valid if there are more vehicles in it than allowed 215 if (ProblemInstance.Vehicles.Value < BestKnownSolution.Solution.GetTours().Count) { 216 BestKnownSolution = null; 217 } else EvalBestKnownSolution(); 218 } 210 219 } 211 220
Note: See TracChangeset
for help on using the changeset viewer.