Class VehicleRoutingProblemSolution
java.lang.Object
com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution
Contains the solution of a vehicle routing problem and its corresponding costs.
- Author:
- stefan schroeder
-
Constructor Summary
ConstructorsConstructorDescriptionVehicleRoutingProblemSolution(Collection<VehicleRoute> routes, double cost) Constructs a solution with a number ofVehicleRoutes and their corresponding aggregate cost value.VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs, double cost) Constructs a solution with a number ofVehicleRoutes, bad jobs and their corresponding aggregate cost value. -
Method Summary
Modifier and TypeMethodDescriptioncopyOf(VehicleRoutingProblemSolution solution2copy) Makes a deep copy of the solution to be copied.doublegetCost()Returns cost of this solution.Returns a collection of vehicle-routes.Returns bad jobs, i.e.voidsetCost(double cost) Sets the costs of this solution.toString()
-
Constructor Details
-
VehicleRoutingProblemSolution
Constructs a solution with a number ofVehicleRoutes and their corresponding aggregate cost value.- Parameters:
routes- routes being part of the solutioncost- total costs of solution
-
VehicleRoutingProblemSolution
public VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs, double cost) Constructs a solution with a number ofVehicleRoutes, bad jobs and their corresponding aggregate cost value.- Parameters:
routes- routes being part of the solutionunassignedJobs- jobs that could not be assigned to any vehiclecost- total costs of solution
-
-
Method Details
-
copyOf
Makes a deep copy of the solution to be copied.- Parameters:
solution2copy- solution to be copied- Returns:
- solution
-
getRoutes
Returns a collection of vehicle-routes.- Returns:
- collection of vehicle-routes
-
getCost
public double getCost()Returns cost of this solution.- Returns:
- costs
-
setCost
public void setCost(double cost) Sets the costs of this solution.- Parameters:
cost- the cost to assigned to this solution
-
getUnassignedJobs
Returns bad jobs, i.e. jobs that are not assigned to any vehicle route.- Returns:
- bad jobs
-
toString
-