Maven artifactId: rinsim-scenario-util

This module consists of a number of scenario related packages.

scenario.generator

Contains many utilities for drawing variables based on probability distributions that are useful for constructing scenarios. The ScenarioGenerator class allows to construct PDPTW datasets (multiple scenarios) based on specific properties.

Typical usage of the ScenarioGenerator may look something like this:

ScenarioGenerator generator = ScenarioGenerator.builder()
  .vehicles(vehicleGenerator)
  .parcels(parcelGenerator)
  .depots(depotGenerator)
  .addModel(..)
  .build();

List<Scenario> scenarios = new ArrayList<>();
for( int i = 0; i < numberOfDesiredScenarios; i++){
  scenarios.add(generator.generate(..,..));
}

For the methods in the example above, there are the following helper classes for supplying values:

  • Vehicles
  • Parcels
  • Depots

With Parcels it is for example possible to create a ParcelGenerator as follows:

Parcels.builder()
  // sets the pickup durations of all parcels to '10'
  .pickupDurations(StochasticSuppliers.constant(10L))
  // the delivery durations for each parcel will be drawn from a normal distribution N(10,3) (rounded to a long value)
  .deliveryDurations(
    StochasticSuppliers.normal()
      .mean(10)
      .std(3)
      .buildLong())
  // the pickup and delivery locations will both be draw uniformly in a plane
  .locations(
    Locations.builder()
      .min(new Point(0, 0))
      .max(new Point(10, 10))
      .buildUniform())
  // the announce times of the parcels will be based on a Poisson process
  .announceTimes(TimeSeries.homogenousPoisson(500, 20))
  // the time windows for each parcel are created using the TimeWindows helper class
  .timeWindows(
    TimeWindows.builder()
      .pickupUrgency(StochasticSuppliers.uniformLong(5, 10))
      .deliveryOpening(StochasticSuppliers.constant(10L))
      .build())
  .build(); // returns a ParcelGenerator instance

As can be seen from this example, this module contains several additional helper classes for constructing properties based on probability distributions such as TimeWindows, TimeSeries, and Locations. Each of these helper classes in turn usually accepts instances of type StochasticSupplier. Using the StochasticSuppliers utility class, it is possible to construct suppliers for constants, uniform random, and normal random.

scenario.measure

This package contains some utility methods for measuring scenarios. The most notable methods are in the Metrics class:

  • measureUrgency(Scenario)
  • measureDynamism(Scenario)

The concepts of urgency and dynamism were first introduced in the following paper:

scenario.vanlon15

This package contains the ProblemClass for the scenarios that were constructed for the following paper:

The dataset generator that is presented in this paper can be found here.

scenario.gendreau06

Contains code for parsing scenarios as used in this paper: