src/NodeHeap.cpp
// Adds an element to the heap - allocates an index to the element
// and then sorts the element based on the inputted fcost. 
Adds an element to the heap - allocates an index to the element
and then sorts the element based on the inputted fcost.
Adds an element to the heap - allocates an index to the element and then sorts the element based on the inputted fcost .
void addElement(NodeHeap& heap,int fcost, Coordinates coordinate) {
        heap.fCosts.emplace_back(fcost);
        heap.coordinates.emplace_back(coordinate);
        heap.indices[coordinate.x][coordinate.y] = heap.coordinates.size() - 1;
        sortUp(heap);
    }
void addElement ( NodeHeap & heap , int fcost , Coordinates coordinate ) { heap . fCosts . emplace_back ( fcost ) ; heap . coordinates . emplace_back ( coordinate ) ; heap . indices [ coordinate . x ] [ coordinate . y ] = heap . coordinates . size ( ) - 1 ; sortUp ( heap ) ; }
Adds an element to the heap - allocates an index to the element
and then sorts the element based on the inputted fcost.
Adds an element to the heap - allocates an index to the element and then sorts the element based on the inputted fcost .
// Add the node to the end of the heap.  //std::cout << "Added new element to heap! Heap is now size: " << heap.fCosts.size()  //        << std::endl; // Sort the heap from the bottom. 