Class RouteChangedEvent

  • All Implemented Interfaces:
    Serializable

    public class RouteChangedEvent
    extends org.springframework.context.ApplicationEvent
    Event published when the routing plan has been updated either by discovering a better route or by a change in the problem specification (vehicles, visits).
    See Also:
    Serialized Form
    • Constructor Detail

      • RouteChangedEvent

        public RouteChangedEvent​(Object source,
                                 Distance distance,
                                 List<Long> vehicleIds,
                                 Long depotId,
                                 List<Long> visitIds,
                                 Collection<ShallowRoute> routes)
        Create a new ApplicationEvent.
        Parameters:
        source - the object on which the event initially occurred (never null)
        distance - total distance of all vehicle routes
        vehicleIds - vehicle IDs
        depotId - depot ID (may be null if there are no locations)
        visitIds - IDs of visits
        routes - vehicle routes
    • Method Detail

      • vehicleIds

        public List<Long> vehicleIds()
        IDs of all vehicles.
        Returns:
        vehicle IDs
      • distance

        public Distance distance()
        Routing plan distance.
        Returns:
        distance (never null)
      • depotId

        public Optional<Long> depotId()
        The depot ID.
        Returns:
        depot ID
      • visitIds

        public List<Long> visitIds()