-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2252a45
commit 03569cf
Showing
4 changed files
with
103 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""Defines the input class""" | ||
|
||
from dataclasses import dataclass | ||
from typing import Any | ||
|
||
from .stop import AlternateStop, Stop, StopDefaults | ||
from .vehicle import Vehicle, VehicleDefaults | ||
|
||
|
||
@dataclass | ||
class Defaults: | ||
"""Default values for vehicles and stops.""" | ||
|
||
stops: StopDefaults | None | ||
"""Default values for stops.""" | ||
vehicles: VehicleDefaults | None | ||
"""Default values for vehicles.""" | ||
|
||
|
||
@dataclass | ||
class DurationGroup: | ||
"""Represents a group of stops that get additional duration whenever a stop | ||
of the group is approached for the first time.""" | ||
|
||
group: list[str] | None | ||
"""Stop IDs contained in the group.""" | ||
duration: int | None | ||
"""Duration to add when visiting the group.""" | ||
|
||
|
||
@dataclass | ||
class Input: | ||
"""Input schema for Nextroute.""" | ||
|
||
alternate_stops: list[AlternateStop] | None | ||
"""A set of alternate stops for the vehicles.""" | ||
custom_data: Any | None | ||
"""Arbitrary data associated with the input.""" | ||
defaults: Defaults | None | ||
"""Default values for vehicles and stops.""" | ||
distance_matrix: list[list[float]] | None | ||
"""Matrix of travel distances in meters between stops.""" | ||
duratrion_groups: list[DurationGroup] | None | ||
"""Duration in seconds added when approaching the group.""" | ||
duration_matrix: list[list[float]] | None | ||
"""Matrix of travel durations in seconds between stops.""" | ||
options: Any | None | ||
"""Arbitrary options.""" | ||
stop_groups: list[list[str]] | None | ||
"""Groups of stops that must be part of the same route.""" | ||
stops: list[Stop] | None | ||
"""Stops that must be visited by the vehicles.""" | ||
vehicles: list[Vehicle] | None | ||
"""Vehicles that service the stops.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Defines the Location class.""" | ||
"""Defines the location class.""" | ||
|
||
|
||
from dataclasses import dataclass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters