Maven artifactId: rinsim-pdptw

The PDPTW module contains implementations that support the simulation of the pickup-and-delivery problem with time windows (PDPTW).

RouteFollowingVehicle

The RouteFollowingVehicle is a subclass of Vehicle with a very simple API. The behavior of this vehicle can be controlled via the setRoute(Iterable<Parcel>) method. The route consists of one or more parcels, each parcel can occur at maximum twice. The first occurence indicates a pickup, the second occurence indicates a delivery. In case this method is called at a time when the vehicle already has a parcel in cargo, the number of occurences for that parcel is limited to one and will be interpreted as a delivery. The behavior of the vehicle is implemented as a finite state machine, which is visualized below:

RouteFollowingVehicle statemachine

RouteFollowingVehicle statemachine. The diagram is obtained by running dot on the dot syntax that was exported from the RouteFollowingVehicle class.

As can be seen, there are four states: Wait, Goto, WaitAtService, and Service. There are six triggers (state events) which are documented here. The behavior of the vehicle can be overridden by changing the state machine.

PDPRoadModel

The PDPRoadModel is a convenience decorator of RoadModels. It simplifies the API for moving vehicles in the PDPTW case as it allows to always just call moveTo(vehicle,parcel), depending on the state of the parcel this will let the vehicle move to either the pickup site or the delivery site.

RoadModel decorator Underlying RoadModel
PDPRoadModel RoadModel
PDPGraphRoadModel GraphRoadModel
PDPDynamicGraphRoadModel DynamicGraphRoadModel
PDPCollisionGraphRoadModel CollisionGraphRoadModel

Events

This module provides several default implementations of TimedEvent (see scenario module) which are useful for PDPTWs:

Statistics

With StatsTracker it is possible to track a number of statistics relevant for PDPTWs.

StatsTracker  
Associated type: none
Provides: StatisticsProvider
Dependencies: ScenarioController, Clock, RoadModel, PDPModel

Via the StatisticsProvider instances of StatisticsDTO can be obtained which can be useful to analyse the result of a simulation. Additionally, these statistics can be used for custom stop conditions (see StatsStopConditions ) and for computing an objective value via implementations of ObjectiveFunction.

User interface

The module provides several UI extensions that visualize functionality from this module:

Renderer / Panel What is rendered Example usage
TimeLinePanel A timeline indicating for each parcel, the pickup timewindow and the delivery timewindow. Experiment example
RoutePanel Shows a table with a row per RouteFollowingVehicle detailing its route. Experiment example
StatsPanel Presents a live view on the stats in a side panel. Experiment example
RouteRenderer Renders the current route for each RouteFollowingVehicle. Experiment example