nrel.hive.model.roadnetwork.haversine_roadnetwork

Module Contents

Classes

HaversineRoadNetwork

Implements a simple haversine road network where a unique node exists for each unique GeoId in the simulation.

class nrel.hive.model.roadnetwork.haversine_roadnetwork.HaversineRoadNetwork(geofence: nrel.hive.model.roadnetwork.geofence.GeoFence | None = None, sim_h3_resolution: nrel.hive.util.typealiases.H3Resolution = 15)[source]

Bases: nrel.hive.model.roadnetwork.roadnetwork.RoadNetwork

Implements a simple haversine road network where a unique node exists for each unique GeoId in the simulation. This assumes a fully connected graph between each node in which the shortest path is the link that connects any two nodes. LinkId is specified as a concatenation of the GeoId of its endpoints in which the order is given by origin and destination respectively.

Parameters:
  • AVG_SPEED – the average speed over the network

  • sim_h3_resolution – the h3 simulation level resolution. default 15

_AVG_SPEED_KMPH = 40
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.

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

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) nrel.hive.model.roadnetwork.roadnetwork.RoadNetwork[source]

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

Parameters:

sim_time

Returns: