Packt_CreatingGamesWithAI/Basics/Graph/AStar/Heuristics/AStarSearch.hpp
AStarSearch(const GraphType* pGraph, int pSourceIndex, int pTargetIndex)
        :   mGraph(pGraph), mShortestPathTree( pGraph->getNumberOfAllNodes() ), mSearchFrontier( pGraph->getNumberOfAllNodes() ),
            mGCosts(pGraph->getNumberOfAllNodes(), 0.f), mFCosts(pGraph->getNumberOfAllNodes(), 0.f),
            mSourceIndex(pSourceIndex), mTargetIndex(pTargetIndex)
    {
        getPreparedForSearch(mSourceIndex, mTargetIndex);
    }
// In case you want to use A* as a local variable
In case you want to use A* as a local variable
In case you want to use A * as a local variable
AStarSearch(const GraphType* pGraph, int pSourceIndex, int pTargetIndex)
        :   mGraph(pGraph), mShortestPathTree( pGraph->getNumberOfAllNodes() ), mSearchFrontier( pGraph->getNumberOfAllNodes() ),
            mGCosts(pGraph->getNumberOfAllNodes(), 0.f), mFCosts(pGraph->getNumberOfAllNodes(), 0.f),
            mSourceIndex(pSourceIndex), mTargetIndex(pTargetIndex)
    {
        getPreparedForSearch(mSourceIndex, mTargetIndex);
    }
AStarSearch ( const GraphType * pGraph , int pSourceIndex , int pTargetIndex ) : mGraph ( pGraph ) , mShortestPathTree ( pGraph -> getNumberOfAllNodes ( ) ) , mSearchFrontier ( pGraph -> getNumberOfAllNodes ( ) ) , mGCosts ( pGraph -> getNumberOfAllNodes ( ) , 0.f ) , mFCosts ( pGraph -> getNumberOfAllNodes ( ) , 0.f ) , mSourceIndex ( pSourceIndex ) , mTargetIndex ( pTargetIndex ) { getPreparedForSearch ( mSourceIndex , mTargetIndex ) ; }
In case you want to use A* as a local variable
In case you want to use A * as a local variable