|
OpenTTD Source 20251104-master-g3befbdd52f
|
Water region based YAPF implementation for ships. More...
Public Member Functions | |
| YapfShipRegions (int max_nodes) | |
| void | AddOrigin (const WaterRegionPatchDesc &water_region_patch) |
| bool | HasOrigin (const WaterRegionPatchDesc &water_region_patch) |
| void | SetDestination (const WaterRegionPatchDesc &water_region_patch) |
| void | PfFollowNode (Node &old_node) |
| bool | PfDetectDestination (Node &n) const |
| bool | PfCalcCost (Node &n, const TrackFollower *) |
| bool | PfCalcEstimate (Node &n) |
| char | TransportTypeChar () const |
Public Member Functions inherited from CYapfBaseT< WaterRegionTypes > | |
| CYapfBaseT () | |
| default constructor | |
| ~CYapfBaseT () | |
| default destructor | |
| const YAPFSettings & | PfGetSettings () const |
| return current settings (can be custom - company based - but later) | |
| bool | FindPath (const VehicleType *v) |
| Main pathfinder routine: | |
| Node * | GetBestNode () |
| If path was found return the best node that has reached the destination. | |
| Node & | CreateNewNode () |
| Calls NodeList::CreateNewNode() - allocates new node that can be filled and used as argument for AddStartupNode() or AddNewNode() | |
| void | AddStartupNode (Node &n) |
| Add new node (created by CreateNewNode and filled with data) into open list. | |
| void | AddMultipleNodes (Node *parent, const TrackFollower &tf) |
| add multiple nodes - direct children of the given node | |
| void | AddNewNode (Node &n, const TrackFollower &follower) |
| AddNewNode() - called by Tderived::PfFollowNode() for each child node. | |
| const VehicleType * | GetVehicle () const |
| void | DumpBase (DumpTarget &dmp) const |
Public Member Functions inherited from CYapfSegmentCostCacheNoneT< WaterRegionTypes > | |
| bool | PfNodeCacheFetch (Node &) |
| Called by YAPF to attach cached or local segment cost data to the given node. | |
Static Public Member Functions | |
| static std::vector< WaterRegionPatchDesc > | FindWaterRegionPath (const Ship *v, TileIndex start_tile, int max_returned_path_length) |
Private Types | |
| using | Node = typename WaterRegionTypes::NodeList::Item |
Private Member Functions | |
| YapfShipRegions & | Yapf () |
Private Attributes | |
| std::vector< WaterRegionPatchKey > | origin_keys |
| WaterRegionPatchKey | dest |
Additional Inherited Members | |
Public Types inherited from CYapfBaseT< WaterRegionTypes > | |
| typedef Types::Tpf | Tpf |
| the pathfinder class (derived from THIS class) | |
| typedef Types::TrackFollower | TrackFollower |
| typedef Types::NodeList | NodeList |
| our node list | |
| typedef Types::VehicleType | VehicleType |
| the type of vehicle | |
| typedef NodeList::Item | Node |
| this will be our node type | |
| typedef Node::Key | Key |
| key to hash tables | |
Public Types inherited from CYapfSegmentCostCacheNoneT< WaterRegionTypes > | |
| typedef Types::Tpf | Tpf |
| the pathfinder class (derived from THIS class) | |
| typedef Types::NodeList::Item | Node |
| this will be our node type | |
Data Fields inherited from CYapfBaseT< WaterRegionTypes > | |
| NodeList | nodes |
| node list multi-container | |
| int | num_steps |
| this is there for debugging purposes (hope it doesn't hurt) | |
Protected Member Functions inherited from CYapfBaseT< WaterRegionTypes > | |
| Tpf & | Yapf () |
| to access inherited path finder | |
Protected Attributes inherited from CYapfBaseT< WaterRegionTypes > | |
| Node * | best_dest_node |
| pointer to the destination node found at last round | |
| Node * | best_intermediate_node |
| here should be node closest to the destination if path not found | |
| const YAPFSettings * | settings |
| current settings (_settings_game.yapf) | |
| int | max_search_nodes |
| maximum number of nodes we are allowed to visit before we give up | |
| const VehicleType * | vehicle |
| vehicle that we are trying to drive | |
| int | stats_cost_calcs |
| stats - how many node's costs were calculated | |
| int | stats_cache_hits |
| stats - how many node's costs were reused from cache | |
Water region based YAPF implementation for ships.
Definition at line 92 of file yapf_ship_regions.cpp.
|
private |
Definition at line 97 of file yapf_ship_regions.cpp.
|
inlineexplicit |
Definition at line 108 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 113 of file yapf_ship_regions.cpp.
|
inlinestatic |
Definition at line 177 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 124 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 149 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 163 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 144 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 134 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 129 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 175 of file yapf_ship_regions.cpp.
|
inlineprivate |
Definition at line 102 of file yapf_ship_regions.cpp.
|
private |
Definition at line 100 of file yapf_ship_regions.cpp.
|
private |
Definition at line 99 of file yapf_ship_regions.cpp.