Class RoutingPlan


  • public class RoutingPlan
    extends Object
    Route plan for the whole vehicle fleet.
    • Constructor Detail

      • RoutingPlan

        public RoutingPlan​(Distance distance,
                           List<Vehicle> vehicles,
                           Location depot,
                           List<Location> visits,
                           List<RouteWithTrack> routes)
        Create a routing plan.
        Parameters:
        distance - the overall travel distance
        vehicles - all available vehicles
        depot - the depot (may be null)
        visits - all visits
        routes - routes of all vehicles
    • Method Detail

      • empty

        public static RoutingPlan empty()
        Create an empty routing plan.
        Returns:
        empty routing plan
      • distance

        public Distance distance()
        Total distance traveled (sum of distances of all routes).
        Returns:
        travel distance
      • vehicles

        public List<Vehicle> vehicles()
        All available vehicles.
        Returns:
        all vehicles
      • routes

        public List<RouteWithTrack> routes()
        Routes of all vehicles in the depot. Includes empty routes of vehicles that stay in the depot.
        Returns:
        all routes (may be empty when there is no depot or no vehicles)
      • visits

        public List<Location> visits()
        All visits that are part of the routing problem.
        Returns:
        all visits
      • depot

        public Optional<Location> depot()
        The depot.
        Returns:
        depot (may be missing)
      • isEmpty

        public boolean isEmpty()
        Routing plan is empty when there is no depot, no vehicles and no routes.
        Returns:
        true if the plan is empty