Skip to content

Input module

Reference to the schema.input.py module.

input

Defines the input class.

Defaults

Bases: BaseModel

Default values for vehicles and stops.

stops class-attribute instance-attribute

stops: StopDefaults | None = None

Default values for stops.

vehicles class-attribute instance-attribute

vehicles: VehicleDefaults | None = None

Default values for vehicles.

DurationGroup

Bases: BaseModel

Represents a group of stops that get additional duration whenever a stop of the group is approached for the first time.

duration instance-attribute

duration: int

Duration to add when visiting the group.

group instance-attribute

group: list[str]

Stop IDs contained in the group.

MatrixTimeFrame

Bases: BaseModel

Represents a time-dependent duration matrix or scaling factor.

start_time instance-attribute

start_time: datetime

Start time of the time frame.

end_time instance-attribute

end_time: datetime

End time of the time frame.

matrix class-attribute instance-attribute

matrix: list[list[float]] | None = None

Duration matrix for the time frame.

scaling_factor class-attribute instance-attribute

scaling_factor: float | None = None

Scaling factor for the time frame.

TimeDependentMatrix

Bases: BaseModel

Represents time-dependent duration matrices.

vehicle_ids class-attribute instance-attribute

vehicle_ids: list[str] | None = None

Vehicle IDs for which the duration matrix is defined.

default_matrix instance-attribute

default_matrix: list[list[float]]

Default duration matrix.

matrix_time_frames class-attribute instance-attribute

matrix_time_frames: list[MatrixTimeFrame] | None = None

Time-dependent duration matrices.

Input

Bases: BaseModel

Input schema for Nextroute.

stops instance-attribute

stops: list[Stop]

Stops that must be visited by the vehicles.

vehicles instance-attribute

vehicles: list[Vehicle]

Vehicles that service the stops.

alternate_stops class-attribute instance-attribute

alternate_stops: list[AlternateStop] | None = None

A set of alternate stops for the vehicles.

custom_data class-attribute instance-attribute

custom_data: Any | None = None

Arbitrary data associated with the input.

defaults class-attribute instance-attribute

defaults: Defaults | None = None

Default values for vehicles and stops.

distance_matrix class-attribute instance-attribute

distance_matrix: list[list[float]] | None = None

Matrix of travel distances in meters between stops.

duration_groups class-attribute instance-attribute

duration_groups: list[DurationGroup] | None = None

Duration in seconds added when approaching the group.

duration_matrix class-attribute instance-attribute

duration_matrix: (
    list[list[float]]
    | TimeDependentMatrix
    | list[TimeDependentMatrix]
    | None
) = None

Matrix of travel durations in seconds between stops as a single matrix or duration matrices.

options class-attribute instance-attribute

options: Any | None = None

Arbitrary options.

stop_groups class-attribute instance-attribute

stop_groups: list[list[str]] | None = None

Groups of stops that must be part of the same route.