/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmSDKAPI.h"
#include "glmAbstractPathPlanner.h"

//golaem core includes
#include <glmAStar.h>
#include <glmPODArray.h>

namespace glm
{
/**
* \brief Shortest path implementation of AbstractPathPlanner using the A* algorithm.
*
* \ingroup PathLib
*
* \author Golaem <dev@golaem.com> 
*
* \see <a href="http://en.wikipedia.org/AStar">A* algorithm description on wikipedia</a>
*/
class GLM_SDK_API PathPlanner : public AbstractPathPlanner
{
  public:
    GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation)

    /**
	* \brief Constructor from a spatial environment
	*/
    PathPlanner(const SpatialEnvironment& spatialEnvironment);

    /**
	* \brief Constructor from a spatial environment and a navigation path
	*/
    PathPlanner(const SpatialEnvironment& spatialEnvironment, NavigationPath& path);

    /**
	* \copycomment AbstractPathPlanner::~AbstractPathPlanner
	*/
    virtual ~PathPlanner();

    virtual void setCosts(IRoadmapCosts& costs, bool transferCostOwnership = false);

  protected:
    /**
	* \see AbstractPathPlanner::planPath
	*/
    virtual bool planPath(NavigationPath& path);

  private:
    /**
	* \brief Forbidden copy constructor.
	*/
    PathPlanner(const PathPlanner&);

    /**
	* \brief Forbidden asignment operator.
	*/
    PathPlanner& operator=(const PathPlanner&);

    /// The A* algorithm
    AStar _aStar;

    glm::PODArray<RoadmapArcId> _aStarResult;
};
} // namespace glm
