uxsim.Route¶
- class uxsim.Route(W, links, name='', trust_input=False)[source]¶
Class for a route that store concective links.
Define a route.
- links¶
List of links. The contents are Link objects.
- Type:
list
- links_name¶
List of name of links. The contents are str.
- Type:
list
- trust_input¶
True if you trust the links in order to reduce the computation cost by omitting verification.
- Type:
bool
Examples
>>> route = Route(W, ["l1", "l2", "l3"]) ... vehicle_object.links_prefer = route This will enforce the vehicle to travel the route if the route covers the entire links between the OD nodes of the vehicle.
>>> route = Route(W, ["l1", "l2", "l3"]) ... for link in route: ... print(link) This will print the links in the route.
- __init__(W, links, name='', trust_input=False)[source]¶
Define a route.
- links¶
List of links. The contents are Link objects.
- Type:
list
- links_name¶
List of name of links. The contents are str.
- Type:
list
- trust_input¶
True if you trust the links in order to reduce the computation cost by omitting verification.
- Type:
bool
Examples
>>> route = Route(W, ["l1", "l2", "l3"]) ... vehicle_object.links_prefer = route This will enforce the vehicle to travel the route if the route covers the entire links between the OD nodes of the vehicle.
>>> route = Route(W, ["l1", "l2", "l3"]) ... for link in route: ... print(link) This will print the links in the route.
Methods
__init__
(W, links[, name, trust_input])Define a route.
actual_travel_time
(t[, return_details])Actual travel time for a (hypothetical) vehicle who start traveling this route on time t.
- actual_travel_time(t, return_details=False)[source]¶
Actual travel time for a (hypothetical) vehicle who start traveling this route on time t.
- Parameters:
t (float) – Time in seconds.
return_details (bool) – True if you want travel time per link.
- Returns:
float – The actual travel time.
list (if return_details is True) – List of travel time per link.