Skip to content

Latest commit

 

History

History
79 lines (51 loc) · 2.38 KB

File metadata and controls

79 lines (51 loc) · 2.38 KB

Generator

A utility to generate configuration files used by the backend. For the schema of the file generated by this utility, refer to delivery configuration file in the backend documentation.

Prerequisites

  • Python 3.7 or above

Usage

$ python3 generator.py \
    --numTasks=10 \
    --epiLat=37.1 \
    --epiLng=-121.9 \
    --radius=0.1 \
    --taskTypes=PICKUP,DELIVERY \
    --numVehicles=3

creates a JSON delivery config file with definitions for 10 tasks located in a circle centred at (37.1, -121.9) with a radius of 0.1 degrees. The tasks are a mixture of pickup and delivery tasks, and 3 vehicles will be used to serve these tasks.

Use python3 generator.py --help to display detailed parameter information.

Parameters

  • --numVehicles NUM_VEHICLES, -v NUM_VEHICLES

    The number of vehicles to generate. (default: 3)

  • --numStopsPerVehicle NUM_STOPS, -s NUM_STOPS

    The number of stops to generate, per vehicle. (default: 5)

  • --numTasksPerStop NUM_TASKS, -t NUM_TASKS

    The number of tasks to generate, per stop. (default: 3)

  • --epiLat LAT, -lat LAT

    The latitude of the circle's center. (default: 37.8)

  • --epiLng LNG, -lng LNG

    The longitude of the circle's center. (default: -122.4)

  • --radius RADIUS, -r RADIUS

    The radius of the circle, in degrees lat/lng. (default: 0.05)

  • --stopRadius STOP_RADIUS, -sr STOP_RADIUS

    The radius for generating tasks around a stop, in degrees lat/lng. (default: 0.001)

  • --taskTypes {PICKUP,DELIVERY} [{PICKUP,DELIVERY} ...]

    Types of tasks to generate. (default: ['PICKUP', 'DELIVERY'])

    For other types of tasks (SCHEDULED_STOP, UNAVAILABLE), refer to the delivery configuration file documentation and the Delivery API user guide.

  • --planned_completion_time_range PLANNED_COMPLETION_TIME_RANGE

    The planned time window for completion, in seconds. (default: 3600)

    For details, refer to the delivery configuration file documentation.

  • --timezone TIMEZONE

    A timezone identifier for generated timestamps. (default: America/Los_Angeles)