nrel.hive.model.base
Module Contents
Classes
Represents a base within the simulation. |
- class nrel.hive.model.base.Base[source]
Bases:
nrel.hive.model.entity.EntityRepresents a base within the simulation.
- Parameters:
id (str) – unique base id.
geoid (GeoId) – location of base.
total_stalls (int) – total number of parking stalls.
available_stalls (int) – number of available parking stalls.
station_id (Optional[StationId]) – Optional station that is located at the base.
- property geoid
returns the geoid of the entity
- Returns:
the geoid of the entity
- id: nrel.hive.util.typealiases.BaseId
- membership: nrel.hive.model.membership.Membership
- total_stalls: int
- available_stalls: int
- station_id: nrel.hive.util.typealiases.StationId | None
- classmethod build(id: nrel.hive.util.typealiases.BaseId, geoid: nrel.hive.util.typealiases.GeoId, road_network: nrel.hive.model.roadnetwork.roadnetwork.RoadNetwork, station_id: nrel.hive.util.typealiases.StationId | None, stall_count: int, membership: nrel.hive.model.membership.Membership = Membership())[source]
- classmethod from_row(row: Dict[str, str], road_network: nrel.hive.model.roadnetwork.roadnetwork.RoadNetwork) Base[source]
converts a csv row to a base
- Parameters:
row –
road_network –
- Returns:
- has_available_stall(membership: nrel.hive.model.membership.Membership) bool[source]
Does base have a stall or not.
- Returns:
Boolean
- checkout_stall() Base | None[source]
Checks out a stall and returns the updated base if there are enough stalls.
- Returns:
Updated Base or None
- return_stall() Tuple[Exception | None, Base | None][source]
Checks out a stall and returns the updated base.
- Returns:
Updated Base