nrel.hive.model.roadnetwork.link_id
Module Contents
Functions
|
creates a LinkId from its source and destination node ids |
|
expects the provided string is of the form {src_node_id}-{dst_node_id} |
|
node ids can be strings for the haversine case but for networkx graphs they must be |
|
attempts to reverse a link id by swapping the node ids. can be used to look up the |
Attributes
- nrel.hive.model.roadnetwork.link_id.NodeId
- nrel.hive.model.roadnetwork.link_id.create_link_id(src: int, dst: int) nrel.hive.util.typealiases.LinkId[source]
creates a LinkId from its source and destination node ids :param src: the source node id :param dst: the destination node id :return: a LinkId
- nrel.hive.model.roadnetwork.link_id.extract_node_ids(link_id: nrel.hive.util.typealiases.LinkId) Tuple[Exception | None, Tuple[NodeId, NodeId] | None][source]
expects the provided string is of the form {src_node_id}-{dst_node_id} :param link_id: a string that is a LinkId :return: an error, or, a tuple containing both node ids
- nrel.hive.model.roadnetwork.link_id.extract_node_ids_int(link_id: nrel.hive.util.typealiases.LinkId) Tuple[Exception | None, Tuple[int, int] | None][source]
node ids can be strings for the haversine case but for networkx graphs they must be integers as they are treated as indices.
- Parameters:
link_id (LinkId) – link id to read
- Returns:
_description_
- Return type:
Tuple[Optional[Exception], Optional[Tuple[int, int]]]
- nrel.hive.model.roadnetwork.link_id.reverse_link_id(link_id: nrel.hive.util.typealiases.LinkId) Tuple[Exception | None, nrel.hive.util.typealiases.LinkId | None][source]
attempts to reverse a link id by swapping the node ids. can be used to look up the “other side of the street” on 2-way streets. :param link_id: the link id to reverse :return: either an error or the reversed LinkId