- Timestamp:
- 01/03/11 16:19:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs
r4860 r5202 58 58 get { return (LookupParameter<VRPSolution>)Parameters["BestSolution"]; } 59 59 } 60 public LookupParameter<VRPSolution> BestValidSolutionParameter { 61 get { return (LookupParameter<VRPSolution>)Parameters["BestValidSolution"]; } 62 } 60 63 public ValueLookupParameter<ResultCollection> ResultsParameter { 61 64 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } … … 84 87 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("VehiclesUtilized", "The utilized vehicles of the VRP solutions which should be analyzed.")); 85 88 86 Parameters.Add(new LookupParameter<VRPSolution>("BestSolution", "The best TSP solution.")); 89 Parameters.Add(new LookupParameter<VRPSolution>("BestSolution", "The best VRP solution.")); 90 Parameters.Add(new LookupParameter<VRPSolution>("BestValidSolution", "The best valid VRP solution.")); 87 91 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored.")); 88 92 } … … 140 144 } 141 145 146 VRPSolution validSolution = BestValidSolutionParameter.ActualValue; 147 if (validSolution == null) { 148 if (ProblemInstanceParameter.ActualValue.Feasible(best)) { 149 validSolution = new VRPSolution(problemInstance, best.Clone() as IVRPEncoding, new DoubleValue(qualities[i].Value)); 150 BestValidSolutionParameter.ActualValue = validSolution; 151 results.Add(new Result("Best valid VRP Solution", validSolution)); 152 } 153 } else { 154 if (qualities[i].Value <= validSolution.Quality.Value) { 155 if (ProblemInstanceParameter.ActualValue.Feasible(best)) { 156 validSolution.ProblemInstance = problemInstance; 157 validSolution.Solution = best.Clone() as IVRPEncoding; 158 validSolution.Quality.Value = qualities[i].Value; 159 } 160 } 161 } 162 142 163 if (bestKnownQuality == null || 143 164 qualities[i].Value < bestKnownQuality.Value) {
Note: See TracChangeset
for help on using the changeset viewer.