Packt_CreatingGamesWithAI/Basics/Graph/AStar/Heuristics/AStarSearch.hpp
AStarSearch(const GraphType* pGraph)
    : mGraph(pGraph), mShortestPathTree( pGraph->getNumberOfAllNodes() ), mSearchFrontier( pGraph->getNumberOfAllNodes() ),
    mGCosts(pGraph->getNumberOfAllNodes(), 0.f), mFCosts(pGraph->getNumberOfAllNodes(), 0.f),
    mSourceIndex(GraphCommons::INVALID_NODE_INDEX), mTargetIndex(GraphCommons::INVALID_NODE_INDEX)
    { }
// In case you want to use A* as a class member
In case you want to use A* as a class member
In case you want to use A * as a class member
AStarSearch(const GraphType* pGraph)
    : mGraph(pGraph), mShortestPathTree( pGraph->getNumberOfAllNodes() ), mSearchFrontier( pGraph->getNumberOfAllNodes() ),
    mGCosts(pGraph->getNumberOfAllNodes(), 0.f), mFCosts(pGraph->getNumberOfAllNodes(), 0.f),
    mSourceIndex(GraphCommons::INVALID_NODE_INDEX), mTargetIndex(GraphCommons::INVALID_NODE_INDEX)
    { }
AStarSearch ( const GraphType * pGraph ) : mGraph ( pGraph ) , mShortestPathTree ( pGraph -> getNumberOfAllNodes ( ) ) , mSearchFrontier ( pGraph -> getNumberOfAllNodes ( ) ) , mGCosts ( pGraph -> getNumberOfAllNodes ( ) , 0.f ) , mFCosts ( pGraph -> getNumberOfAllNodes ( ) , 0.f ) , mSourceIndex ( GraphCommons :: INVALID_NODE_INDEX ) , mTargetIndex ( GraphCommons :: INVALID_NODE_INDEX ) { }
In case you want to use A* as a class member
In case you want to use A * as a class member