pathfinding3d.core.heap module
Simple heap with ordering and removal. Inspired from https://github.com/brean/python-pathfinding/pull/54 Original author: https://github.com/peterchenadded
- class pathfinding3d.core.heap.SimpleHeap(node, grid)[source]
Bases:
object
A simple implementation of a heap data structure optimized for pathfinding. It maintains an open list of nodes, a status for each node, and a function to retrieve nodes.
- _determine_node_retrieval_function()[source]
Determines the node retrieval function based on the type of grid.
- Returns:
A function that takes a node tuple and returns the corresponding node.
- Return type:
function
- Raises:
ValueError – If the grid is not of type Grid or World.
- _determine_node_function()[source]
Determines the node function based on the type of grid.
- Returns:
A function that takes a node tuple and returns the corresponding node.
- Return type:
function
- Raises:
ValueError – If the grid is not of type Grid or World.
- pop_node()[source]
Pops the node with the lowest cost from the heap.
- Returns:
The node with the lowest cost.
- Return type: