|
WSF
|
#include <WsfPathFinder.hpp>


Classes | |
| class | pf_cost_func |
Public Types | |
| using | PFGraph = UtGraphT<WsfPFNode, WsfPFEdge, false, double> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Public Member Functions | |
| WsfPathFinder (WsfScenario *aScenarioPtr, WsfGeoPoint &aUpperLeftPtr, WsfGeoPoint &aLowerRightPtr, double aGridSizeDegrees) | |
| WsfPathFinder (WsfScenario *aScenarioPtr) | |
| ~WsfPathFinder () override | |
| virtual bool | Initialize (WsfSimulation *aSimulationPtr) |
| bool | ProcessInput (UtInput &aInput) override |
| const char * | GetScriptClassName () const override |
| void | AddZone (WsfZone *aZonePtr, double aWeight) |
| void | RemoveZone (WsfZone *aZonePtr) |
| void | RecalculateWeights () |
| virtual bool | FindPath (const WsfGeoPoint &aStartPtr, WsfGeoPoint &aEndPtr, WsfRoute &aRoute, double &aCost) |
| virtual const WsfPFNode * | GetClosestNode (const WsfGeoPoint &aPointPtr) |
| void | print () const |
| node_iterator | GetGrid (long aX, long aY) |
| node_iterator | GetGridAbsolute (unsigned long idx) |
| void | SetGrid (unsigned long aX, unsigned long aY, node_iterator aIterPtr) |
| void | SetGridAbsolute (unsigned long aX, node_iterator aIterPtr) |
| void | DebugDrawGrid () |
| virtual void | DebugDrawZones () |
| WsfGeoPoint | GetNodeLocation (int nodeIndex) |
| long | GetXSize () |
| long | GetYSize () |
| bool | GetConsiderNode (const WsfPFNode &aNode) |
| bool | GetConsiderNode (const WsfGeoPoint &aGeoPoint) |
| int | GetNumberOfZones () |
| double | GetGridSizeDegrees () |
| WsfGeoPoint | GetUpperLeft () |
| WsfGeoPoint | GetLowerRight () |
| WsfGeoPoint * | FindClosestPointOnEdge (double aSimTime, const WsfGeoPoint &aGeoPoint) |
| virtual WsfGeoPoint * | FindClosestValidPoint (double aSimTime, const WsfGeoPoint &aGeoPoint) |
| WsfGeoPoint * | FindClosestPointInQuadrant (const WsfGeoPoint &aGeoPoint, int aQuadrant) |
| WsfZone * | GetZoneByName (const std::string &aZoneName) |
| bool | ComputeFindPath (WsfMover &aMover, WsfRoute &aRoute) override |
| bool | ComputeSetRoute (WsfMover &aMover, WsfRoute &aRoute, int &aInitialPointIndex) override |
| bool | ComputeUpdateRoute (WsfMover &aMover, WsfRoute &aRoute) override |
| bool | ComputeExtrapolate (WsfMover &aMover, WsfRoute &aRoute) override |
| bool | ReturnToRoute (WsfMover &aMover, WsfRoute &aRoute) override |
| virtual WsfGeoPoint | GetRandomLocation () |
| virtual void | SetDebugEnabled (bool aDebugEnabled) |
| bool | DebugEnabled () const |
| WsfSimulation * | GetSimulation () const |
| Public Member Functions inherited from WsfUncloneableObject | |
| WsfUncloneableObject () | |
| WsfObject * | Clone () const override |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
| Public Member Functions inherited from WsfRouteComputer | |
| virtual | ~WsfRouteComputer () |
| virtual bool | IsNavMesh () |
| virtual bool | GetEnabled () |
Protected Member Functions | |
| bool | ContainsZone (WsfZone *aZonePtr) |
| bool | ContainsZone (const std::string &aZoneName) |
| bool | PointIsInGridBounds (int x, int y) |
| bool | IsDuplicateEdge (node_iterator nodeIter, const WsfPFNode &aNode2, const WsfPFEdge &tmpEdge) |
| bool | shortest_path (const_node_iterator aSrcNodeIter, const_node_iterator aDstNodeIter, NodeList &aPath, double &aCost, const cost_func *aCostFuncPtr=nullptr) const override |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
Protected Attributes | |
| WsfScenario * | mScenarioPtr |
| WsfSimulation * | mSimulationPtr |
| std::list< WsfZone * > | mZones |
| std::map< WsfZone *, double > | mZoneWeights |
| WsfGeoPoint | mUpperLeft |
| WsfGeoPoint | mLowerRight |
| double | mGridSizeDegrees |
| long | mXSize |
| long | mYSize |
| std::vector< node_iterator > | mGrid |
| bool | mInitialized |
| WsfDraw * | mDebugDrawObjPtr |
| bool | mDebugEnabled |
| using WsfPathFinder::PFGraph = UtGraphT<WsfPFNode, WsfPFEdge, false, double> |
| WsfPathFinder::WsfPathFinder | ( | WsfScenario * | aScenarioPtr, |
| WsfGeoPoint & | aUpperLeftPtr, | ||
| WsfGeoPoint & | aLowerRightPtr, | ||
| double | aGridSizeDegrees ) |
References mDebugDrawObjPtr, mDebugEnabled, mGrid, mGridSizeDegrees, mInitialized, mLowerRight, mScenarioPtr, mSimulationPtr, mUpperLeft, mXSize, mYSize, mZones, and mZoneWeights.
Referenced by WsfNavigationMesh::WsfNavigationMesh(), and WsfTerrainPathFinder::WsfTerrainPathFinder().
| WsfPathFinder::WsfPathFinder | ( | WsfScenario * | aScenarioPtr | ) |
References mDebugDrawObjPtr, mDebugEnabled, mGrid, mGridSizeDegrees, mInitialized, mLowerRight, mScenarioPtr, mSimulationPtr, mUpperLeft, mXSize, mYSize, mZones, and mZoneWeights.
|
override |
| void WsfPathFinder::AddZone | ( | WsfZone * | aZonePtr, |
| double | aWeight ) |
References ContainsZone(), mZones, and mZoneWeights.
Referenced by WsfNavigationMesh::ProcessInput(), ProcessInput(), and WsfTerrainPathFinder::ProcessInput().
Called when a mover begins extrapolating at the end of a route.
| aMover | The mover that is performing the movement. |
| aRoute | A route which will replace extrapolation behavior if 'true' is returned. Returns 'true' if aRoute was modified. |
Reimplemented from WsfRouteComputer.
References WsfRoute::Append(), WsfRoute::Clear(), FindPath(), WsfMover::GetDefaultRoute(), WsfWaypoint::GetLocationLLA(), WsfPlatformPart::GetPlatform(), WsfRoute::GetSize(), WsfRoute::GetWaypointAt(), and WsfObject::SetName().
Called when FindAndSetPath is called on a mover
| aMover | The mover that is performing the movement. |
| aRoute | The route to be transformed. Returns 'true' if aRoute was modified. |
Reimplemented from WsfRouteComputer.
References ComputeSetRoute().
|
overridevirtual |
Called when a mover is given an initial route.
| aMover | The mover that is performing the movement. |
| aRoute | The route to be transformed. |
| aInitialPointIndex | The index of the point within the route where movement is to start. Returns 'true' if aRoute was modified. |
Reimplemented from WsfRouteComputer.
References WsfRoute::Append(), FindPath(), WsfWaypoint::GetAlt(), WsfWaypoint::GetLat(), WsfWaypoint::GetLon(), WsfRoute::GetSize(), WsfRoute::GetWaypointAt(), WsfRoute::SetSpeed(), and success.
Referenced by ComputeFindPath(), and ComputeUpdateRoute().
Called when a mover is given an updated route.
| aMover | The mover that is performing the movement. |
| aRoute | The route to be transformed. Returns 'true' if aRoute was modified. |
Reimplemented from WsfRouteComputer.
References ComputeSetRoute().
|
protected |
References mZones.
|
protected |
| void WsfPathFinder::DebugDrawGrid | ( | ) |
References begin(), end(), WsfGeoPoint::GetLocationLLA(), mDebugDrawObjPtr, and WsfPFNode::mLoc.
|
virtual |
Reimplemented in WsfNavigationMesh.
References WsfZoneDefinition::GetPoints(), mDebugDrawObjPtr, WsfZone::Point::mX, WsfZone::Point::mY, and mZones.
|
inline |
References mDebugEnabled.
Referenced by FindClosestValidPoint().
| WsfGeoPoint * WsfPathFinder::FindClosestPointInQuadrant | ( | const WsfGeoPoint & | aGeoPoint, |
| int | aQuadrant ) |
References FindPath(), WsfGeoPoint::GetAlt(), WsfWaypoint::GetAlt(), WsfGeoPoint::GetDistanceFrom(), GetGrid(), WsfGeoPoint::GetLat(), WsfWaypoint::GetLat(), WsfGeoPoint::GetLon(), WsfWaypoint::GetLon(), WsfRoute::GetSize(), WsfRoute::GetWaypointAt(), GetXSize(), GetYSize(), WsfPFNode::mLoc, and WsfPFNode::mWeight.
Referenced by FindClosestPointOnEdge().
| WsfGeoPoint * WsfPathFinder::FindClosestPointOnEdge | ( | double | aSimTime, |
| const WsfGeoPoint & | aGeoPoint ) |
|
virtual |
Reimplemented in WsfNavigationMesh.
References DebugEnabled(), WsfGeoPoint::GetAlt(), GetClosestNode(), WsfGeoPoint::GetDistanceFrom(), GetGrid(), WsfGeoPoint::GetLat(), WsfGeoPoint::GetLocationWCS(), WsfGeoPoint::GetLon(), WsfZoneDefinition::GetPoints(), GetSimulation(), mDebugDrawObjPtr, WsfPFNode::mLoc, WsfPFNode::mX, WsfPFNode::mY, mZones, WsfZoneDefinition::PointIsInside(), WsfGeoPoint::SetLocationLLA(), and WsfGeoPoint::SetLocationWCS().
|
virtual |
Reimplemented in WsfNavigationMesh.
References WsfRoute::Append(), WsfPath::cDOUBLE_NOT_SET, WsfRoute::Clear(), WsfGeoPoint::GetAlt(), GetClosestNode(), WsfGeoPoint::GetLat(), WsfGeoPoint::GetLocationLLA(), WsfGeoPoint::GetLon(), mInitialized, mUpperLeft, mXSize, WsfGeoPoint::SetLocationLLA(), and shortest_path().
Referenced by ComputeExtrapolate(), ComputeSetRoute(), FindClosestPointInQuadrant(), and ReturnToRoute().
|
virtual |
Reimplemented in WsfNavigationMesh, and WsfTerrainPathFinder.
References GetGrid(), WsfGeoPoint::GetLat(), WsfGeoPoint::GetLon(), mGridSizeDegrees, mInitialized, mLowerRight, and mUpperLeft.
Referenced by FindClosestValidPoint(), FindPath(), and GetConsiderNode().
| bool WsfPathFinder::GetConsiderNode | ( | const WsfGeoPoint & | aGeoPoint | ) |
References WsfPathFinder::pf_cost_func::consider_node(), and GetClosestNode().
| bool WsfPathFinder::GetConsiderNode | ( | const WsfPFNode & | aNode | ) |
References WsfPathFinder::pf_cost_func::consider_node().
| WsfPathFinder::node_iterator WsfPathFinder::GetGrid | ( | long | aX, |
| long | aY ) |
| WsfPathFinder::node_iterator WsfPathFinder::GetGridAbsolute | ( | unsigned long | idx | ) |
References mGrid.
Referenced by WsfTerrainPathFinder::GetClosestNodePos(), and GetNodeLocation().
|
inline |
References mGridSizeDegrees.
|
inline |
References mLowerRight.
| WsfGeoPoint WsfPathFinder::GetNodeLocation | ( | int | nodeIndex | ) |
References GetGridAbsolute(), and WsfGeoPoint::SetLocationLLA().
| int WsfPathFinder::GetNumberOfZones | ( | ) |
References mZones.
|
virtual |
Reimplemented in WsfNavigationMesh.
References GetGrid(), WsfSimulation::GetRandom(), GetSimulation(), WsfPFNode::mLoc, mXSize, and mYSize.
|
override |
|
inline |
|
inline |
References mUpperLeft.
|
inline |
References mXSize.
Referenced by FindClosestPointInQuadrant(), and FindClosestPointOnEdge().
|
inline |
References mYSize.
Referenced by FindClosestPointInQuadrant(), and FindClosestPointOnEdge().
|
virtual |
Reimplemented in WsfNavigationMesh, and WsfTerrainPathFinder.
References GetGrid(), mDebugDrawObjPtr, mGrid, mGridSizeDegrees, mInitialized, mLowerRight, mUpperLeft, mXSize, mYSize, RecalculateWeights(), and SetGrid().
|
protected |
References WsfPFNode::mX, and WsfPFNode::mY.
| void WsfPathFinder::print | ( | ) | const |
References begin(), end(), and mInitialized.
|
overridevirtual |
Process input from a generic source.
Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
Reimplemented from WsfObject.
Reimplemented in WsfTerrainPathFinder.
References AddZone(), WsfZoneDefinition::cPOLYGONAL, WsfObjectTypeList< T >::Find(), WsfScenario::FindType(), WsfScenario::FromInput(), WsfZoneTypes::Get(), WsfGeoPoint::GetLocationWCS(), WsfZoneSet::GetNumZones(), WsfZoneDefinition::GetPoints(), GetSimulation(), WsfZoneSet::GetZoneAtIndex(), mGridSizeDegrees, mLowerRight, mUpperLeft, WsfZone::Point::mX, WsfZone::Point::mY, mZones, mZoneWeights, and WsfGeoPoint::ProcessInput().
Referenced by WsfPathFinderTypes::ProcessBlock().
| void WsfPathFinder::RecalculateWeights | ( | ) |
References begin(), end(), GetSimulation(), mInitialized, mZones, and mZoneWeights.
Referenced by Initialize(), and WsfTerrainPathFinder::Initialize().
| void WsfPathFinder::RemoveZone | ( | WsfZone * | aZonePtr | ) |
References mZones, and mZoneWeights.
Reimplemented from WsfRouteComputer.
References FindPath(), WsfWaypoint::GetAlt(), WsfRouteMover::GetCurrentIndex(), WsfMover::GetDefaultRoute(), WsfWaypoint::GetLat(), WsfWaypoint::GetLon(), WsfRoute::GetWaypointAt(), and success.
|
inlinevirtual |
References mDebugEnabled.
| void WsfPathFinder::SetGrid | ( | unsigned long | aX, |
| unsigned long | aY, | ||
| node_iterator | aIterPtr ) |
Referenced by Initialize(), and WsfTerrainPathFinder::Initialize().
| void WsfPathFinder::SetGridAbsolute | ( | unsigned long | aX, |
| node_iterator | aIterPtr ) |
References mGrid.
Referenced by WsfNavigationMesh::InsertCellIntoGrid().
|
overrideprotected |
References mInitialized.
Referenced by FindPath().
|
protected |
|
protected |
Referenced by DebugEnabled(), SetDebugEnabled(), WsfPathFinder(), and WsfPathFinder().
|
protected |
|
protected |
Referenced by WsfNavigationMesh::CreateNavigationMesh(), GetClosestNode(), GetGridSizeDegrees(), WsfNavigationMesh::Initialize(), Initialize(), WsfTerrainPathFinder::Initialize(), WsfNavigationMesh::ProcessInput(), ProcessInput(), WsfTerrainPathFinder::ProcessInput(), WsfPathFinder(), and WsfPathFinder().
|
protected |
Referenced by WsfNavigationMesh::FindPath(), FindPath(), WsfNavigationMesh::GetClosestNode(), GetClosestNode(), WsfTerrainPathFinder::GetClosestNode(), WsfNavigationMesh::Initialize(), Initialize(), WsfTerrainPathFinder::Initialize(), print(), RecalculateWeights(), WsfNavigationMesh::shortest_path(), shortest_path(), WsfPathFinder(), and WsfPathFinder().
|
protected |
|
protected |
Referenced by WsfPathFinder(), and WsfPathFinder().
|
protected |
|
protected |
Referenced by WsfNavigationMesh::CreateNavigationMesh(), WsfNavigationMesh::FindPath(), FindPath(), GetClosestNode(), GetUpperLeft(), WsfNavigationMesh::Initialize(), Initialize(), WsfTerrainPathFinder::Initialize(), WsfNavigationMesh::ProcessInput(), ProcessInput(), WsfTerrainPathFinder::ProcessInput(), WsfPathFinder(), and WsfPathFinder().
|
protected |
|
protected |
|
protected |
Referenced by AddZone(), ContainsZone(), ContainsZone(), WsfNavigationMesh::CreateNavigationMesh(), WsfNavigationMesh::DebugDrawZones(), DebugDrawZones(), FindClosestValidPoint(), GetNumberOfZones(), GetZoneByName(), WsfNavigationMesh::ProcessInput(), ProcessInput(), RecalculateWeights(), RemoveZone(), WsfPathFinder(), and WsfPathFinder().
|
protected |
Referenced by AddZone(), WsfNavigationMesh::ProcessInput(), ProcessInput(), RecalculateWeights(), RemoveZone(), WsfPathFinder(), and WsfPathFinder().