Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/03/11 16:19:17 (14 years ago)
Author:
svonolfe
Message:

Added usage of the TS memory in the customer relocation move (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs

    r4860 r5202  
    5858      get { return (LookupParameter<VRPSolution>)Parameters["BestSolution"]; }
    5959    }
     60    public LookupParameter<VRPSolution> BestValidSolutionParameter {
     61      get { return (LookupParameter<VRPSolution>)Parameters["BestValidSolution"]; }
     62    }
    6063    public ValueLookupParameter<ResultCollection> ResultsParameter {
    6164      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     
    8487        Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("VehiclesUtilized", "The utilized vehicles of the VRP solutions which should be analyzed."));
    8588
    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."));
    8791        Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
    8892    }
     
    140144      }
    141145
     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
    142163      if (bestKnownQuality == null ||
    143164          qualities[i].Value < bestKnownQuality.Value) {
Note: See TracChangeset for help on using the changeset viewer.