_Users

Module Contents

Classes

Users

class _Users.Users

Bases: trasmapy._SimUpdatable.SimUpdatable

property vehicles: list[trasmapy.users._Vehicle.Vehicle]

Retrieves an object for each vehicle currently in the simulation. The API doesn’t keep track of the liveness of the references returned from this method. As such, the values returned from this method should only be kept for one tick of the simulation (e.g., for querries).

property pendingVehicles: list[trasmapy.users._Vehicle.Vehicle]

Retrieves an object for each pending vehicle currently in the simulation. The API doesn’t keep track of the liveness of the references returned from this method. As such, the values returned from this method should only be kept for one tick of the simulation (e.g., for querries).

property vehicleTypes: list[trasmapy.users._VehicleType.VehicleType]
getAllVehicleIds() list[str]
getAllPendingVehicleIds() list[str]
getAllVehicleTypeIds() list[str]
getVehicleType(vehicleTypeId: str) trasmapy.users._VehicleType.VehicleType

Retrieves an object for each vehicle type currently in the simulation.

getVehicle(vehicleId: str) trasmapy.users._Vehicle.Vehicle

Retrieve a registered vehicle reference to a vehicle in the network. See createVehicle.

createVehicle(vehicleId: str, route: Union[trasmapy.users._Route.Route, None] = None, vehicleType: trasmapy.users._VehicleType.VehicleType = VehicleType('DEFAULT_VEHTYPE'), personNumber: int = 0, personCapacity: int = 0, departTime: Union[str, float] = 'now') trasmapy.users._Vehicle.Vehicle

Creates a registered vehicle and adds it to the network. Registered vehicles are vehicle objects whose liveness is checked (safe). If the route is None, the vehicle will be added to a random network edge. If the route consists of two disconnected edges, the vehicle will be treated like a <trip> and use the fastest route between the two edges. If depart time is the string ‘now’, the depart time is the same as the vehicle spawn. Negative values for depart time have special meanings:

-1: ‘triggered’ -2: ‘containerTriggered’

getRoute(routeId: str) trasmapy.users._Route.Route
createRouteFromIds(routeId: str, edgesIds: list[str]) trasmapy.users._Route.Route
createRouteFromEdges(routeId: str, edges: list[trasmapy.network._Edge.Edge]) trasmapy.users._Route.Route
_registerVehicle(vehicleId) trasmapy.users._Vehicle.Vehicle
_doSimulationStep(*args, step: int, time: float) None