Class Route

  • Direct Known Subclasses:
    RouteWithTrack

    public class Route
    extends Object
    Vehicle's itinerary (sequence of visits) and its depot. This entity cannot exist without the vehicle and the depot but it's allowed to have no visits when the vehicle hasn't been assigned any (it's idle).

    This entity describes part of a solution of the vehicle routing problem (assignment of a subset of visits to one of the vehicles). It doesn't carry the data about physical tracks between adjacent visits. Geographical data is held by RouteWithTrack.

    • Constructor Detail

      • Route

        public Route​(Vehicle vehicle,
                     Location depot,
                     List<Location> visits)
        Create a vehicle route.
        Parameters:
        vehicle - the vehicle assigned to this route (not null)
        depot - vehicle's depot (not null)
        visits - list of visits (not null)
    • Method Detail

      • vehicle

        public Vehicle vehicle()
        The vehicle assigned to this route.
        Returns:
        route's vehicle (never null)
      • depot

        public Location depot()
        Depot in which the route starts and ends.
        Returns:
        route's depot (never null)
      • visits

        public List<Location> visits()
        List of vehicle's visits (not including the depot).
        Returns:
        list of visits