nrel.hive
latest
  • Quick Start
  • Example
  • Inputs
  • Outputs
  • Customize
  • Developer Docs
  • API Reference
    • nrel
      • Subpackages
        • nrel.hive
nrel.hive
  • API Reference
  • nrel
  • nrel.hive
  • nrel.hive.model
  • nrel.hive.model.roadnetwork
  • nrel.hive.model.roadnetwork.link
  • Edit on GitHub

nrel.hive.model.roadnetwork.link

Module Contents

Classes

Link

a directed edge on the road network from node a -> node b

Functions

interpolate_between_geoids(...)

Interpolate between two geoids given a ratio from a->b

class nrel.hive.model.roadnetwork.link.Link[source]

Bases: NamedTuple

a directed edge on the road network from node a -> node b the LinkId is used for lookup of link attributes the o/d pair of GeoIds is the start and end locations along this link. in the case of the RoadNetwork, these are (strictly) members of the vertex set. an agent route may also use a Link to represent a partial link traversal, using an o/d pair which is within the link but not necessarily the end-points.

Parameters:
  • link_id (LinkId) – The unique link id.

  • start (GeoId) – The starting endpoint of the link

  • end (GeoId) – The ending endpoint of the link

property travel_time_seconds: nrel.hive.util.units.Seconds
link_id: nrel.hive.util.typealiases.LinkId
start: nrel.hive.util.typealiases.GeoId
end: nrel.hive.util.typealiases.GeoId
distance_km: nrel.hive.util.units.Kilometers
speed_kmph: nrel.hive.util.units.Kmph
classmethod build(link_id: nrel.hive.util.typealiases.LinkId, start: nrel.hive.util.typealiases.GeoId, end: nrel.hive.util.typealiases.GeoId, speed_kmph: nrel.hive.util.units.Kmph, distance_km: nrel.hive.util.units.Kilometers | None = None) → Link[source]
update_speed(speed_kmph: nrel.hive.util.units.Kmph) → Link[source]

Update the speed of the property link

Parameters:

speed_kmph – speed to update to

Returns:

an updated PropertyLink

to_link_traversal() → nrel.hive.model.roadnetwork.linktraversal.LinkTraversal[source]

convert to a link traversal

Returns:

the new link traversal

nrel.hive.model.roadnetwork.link.interpolate_between_geoids(a: nrel.hive.util.typealiases.GeoId, b: nrel.hive.util.typealiases.GeoId, ratio: nrel.hive.util.units.Ratio) → nrel.hive.util.typealiases.GeoId[source]

Interpolate between two geoids given a ratio from a->b

Parameters:
  • a – The starting point

  • b – The ending point

  • ratio – The ratio from a->b

Returns:

An interpolated GeoId

Previous Next

© Copyright 2022, NREL. Revision 224263b8.

Built with Sphinx using a theme provided by Read the Docs.