Class VehicleRoutingProblemSolution

java.lang.Object
com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution

public class VehicleRoutingProblemSolution extends Object
Contains the solution of a vehicle routing problem and its corresponding costs.
Author:
stefan schroeder
  • Constructor Details

    • VehicleRoutingProblemSolution

      public VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, double cost)
      Constructs a solution with a number of VehicleRoutes and their corresponding aggregate cost value.
      Parameters:
      routes - routes being part of the solution
      cost - total costs of solution
    • VehicleRoutingProblemSolution

      public VehicleRoutingProblemSolution(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs, double cost)
      Constructs a solution with a number of VehicleRoutes, bad jobs and their corresponding aggregate cost value.
      Parameters:
      routes - routes being part of the solution
      unassignedJobs - jobs that could not be assigned to any vehicle
      cost - total costs of solution
  • Method Details

    • copyOf

      public static VehicleRoutingProblemSolution copyOf(VehicleRoutingProblemSolution solution2copy)
      Makes a deep copy of the solution to be copied.
      Parameters:
      solution2copy - solution to be copied
      Returns:
      solution
    • getRoutes

      public Collection<VehicleRoute> 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

      public Collection<Job> getUnassignedJobs()
      Returns bad jobs, i.e. jobs that are not assigned to any vehicle route.
      Returns:
      bad jobs
    • toString

      public String toString()
      Overrides:
      toString in class Object