dhart.pathfinding.ConvertNodesToIds

dhart.pathfinding.ConvertNodesToIds(graph: Graph, nodes: List[Tuple | int]) List[int]

Get ids for nodes in graph. Raises exception if nodes can’t be found

If integers are encountered, ignore them. If scalars are given, ignore them.

Parameters:
  • Graph – Graph to use for getting IDs from nodes

  • nodes – Nodes to get the ids of. If any node in nodes already is an ID, then it’s ignored.

Returns:

A list of ids for every node in nodes

Raises:

OutOfRangeException – One or more of the nodes in nodes did not match a valid node in Graph.