nrel.hive.model.roadnetwork.roadnetwork

Module Contents

Classes

RoadNetwork

a class that contains an updated model of the road network state and

class nrel.hive.model.roadnetwork.roadnetwork.RoadNetwork[source]

Bases: abc.ABC

a class that contains an updated model of the road network state and is used to compute routes for agents in the simulation

sim_h3_resolution: nrel.hive.util.typealiases.H3Resolution
abstract route(origin: nrel.hive.model.entity_position.EntityPosition, destination: nrel.hive.model.entity_position.EntityPosition) nrel.hive.model.roadnetwork.route.Route[source]

Returns a route between two road network property links

Parameters:
  • origin – Link of the origin

  • destination – Link of the destination

Returns:

A route.

abstract distance_by_geoid_km(origin: nrel.hive.util.typealiases.GeoId, destination: nrel.hive.util.typealiases.GeoId) nrel.hive.util.units.Kilometers[source]

Returns the road network distance between two geoids

Parameters:
  • origin – Link of the origin

  • destination – Link of the destination

Returns:

the distance in kilometers.

returns the Link with the corresponding LinkId :param link_id: the LinkId to look up :return: the Link with matching LinkId, or None if not valid/found

finds the nearest link to a given GeoId

Parameters:

geoid – a physical location

Returns:

The nearest road network link to the provided GeoId

position_from_geoid(geoid: nrel.hive.util.typealiases.GeoId) nrel.hive.model.entity_position.EntityPosition | None[source]

returns a position from a GeoId. if the provided GeoId does not exist on the line of GeoIds coincident with the Link, then the nearest one is selected

Parameters:

geoid – the location for the stationary entity

Returns:

the position on the link nearest to the GeoId

abstract geoid_within_geofence(geoid: nrel.hive.util.typealiases.GeoId) bool[source]

confirms that the coordinate exists within the bounding polygon of this road network instance

Parameters:

geoid – an h3 geoid

Returns:

True/False

abstract update(sim_time: nrel.hive.model.sim_time.SimTime) RoadNetwork[source]

requests an update to the road network state to refect the provided simulation time

Parameters:

sim_time

Returns: