nrel.hive.model.base

Module Contents

Classes

Base

Represents a base within the simulation.

class nrel.hive.model.base.Base[source]

Bases: nrel.hive.model.entity.Entity

Represents 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
position: nrel.hive.model.entity_position.EntityPosition
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

set_membership(member_ids: Tuple[str, Ellipsis]) Base[source]

sets the membership(s) of the base

Parameters:

member_ids – a Tuple containing updated membership(s) of the base

Returns:

add_membership(membership_id: nrel.hive.util.typealiases.MembershipId) Base[source]

adds the membership to the base

Parameters:

membership_id – a membership for the base

Returns:

updated base