OpenTTD Source 20250205-master-gfd85ab1e2c
|
Data Structures | |
struct | TILE |
Public Types | |
typedef Types::Tpf | Tpf |
the pathfinder class (derived from THIS class) | |
typedef Types::TrackFollower | TrackFollower |
typedef Types::NodeList::Item | Node |
this will be our node type | |
typedef Node::Key | Key |
key to hash tables | |
typedef Node::CachedData | CachedData |
Public Member Functions | |
void | SetTreatFirstRedTwoWaySignalAsEOL (bool enabled) |
Sets whether the first two-way signal should be treated as a dead end. | |
bool | TreatFirstRedTwoWaySignalAsEOL () |
Returns whether the first two-way signal should be treated as a dead end. | |
int | SlopeCost (TileIndex tile, Trackdir td) |
int | CurveCost (Trackdir td1, Trackdir td2) |
int | SwitchCost (TileIndex tile1, TileIndex tile2, DiagDirection exitdir) |
int | OneTileCost (TileIndex &tile, Trackdir trackdir) |
Return one tile cost (base cost + level crossing penalty). | |
bool | IsAnyStationTileReserved (TileIndex tile, Trackdir trackdir, int skipped) |
Check for a reserved station platform. | |
int | ReservationCost (Node &n, TileIndex tile, Trackdir trackdir, int skipped) |
The cost for reserved tiles, including skipped ones. | |
int | SignalCost (Node &n, TileIndex tile, Trackdir trackdir) |
int | PlatformLengthPenalty (int platform_length) |
void | SetMaxCost (int max_cost) |
bool | PfCalcCost (Node &n, const TrackFollower *tf) |
Called by YAPF to calculate the cost from the origin to the given node. | |
bool | CanUseGlobalCache (Node &n) const |
void | ConnectNodeToCachedData (Node &n, CachedData &ci) |
void | DisableCache (bool disable) |
Data Fields | |
bool | stopped_on_first_two_way_signal = false |
Protected Member Functions | |
Tpf & | Yapf () |
to access inherited path finder | |
Protected Attributes | |
int | max_cost = 0 |
bool | disable_cache = false |
std::vector< int > | sig_look_ahead_costs = {} |
bool | treat_first_red_two_way_signal_as_eol = false |
Static Protected Attributes | |
static constexpr int | MAX_SEGMENT_COST = 10000 |
Additional Inherited Members | |
Static Public Member Functions inherited from CYapfCostBase | |
static bool | stSlopeCost (TileIndex tile, Trackdir td) |
Does the given track direction on the given tile yield an uphill penalty? | |
Definition at line 21 of file yapf_costrail.hpp.
typedef Node::CachedData CYapfCostRailT< Types >::CachedData |
Definition at line 27 of file yapf_costrail.hpp.
typedef Node::Key CYapfCostRailT< Types >::Key |
key to hash tables
Definition at line 26 of file yapf_costrail.hpp.
typedef Types::NodeList::Item CYapfCostRailT< Types >::Node |
this will be our node type
Definition at line 25 of file yapf_costrail.hpp.
typedef Types::Tpf CYapfCostRailT< Types >::Tpf |
the pathfinder class (derived from THIS class)
Definition at line 23 of file yapf_costrail.hpp.
typedef Types::TrackFollower CYapfCostRailT< Types >::TrackFollower |
Definition at line 24 of file yapf_costrail.hpp.
|
inlineprotected |
Definition at line 59 of file yapf_costrail.hpp.
|
inline |
Definition at line 617 of file yapf_costrail.hpp.
|
inline |
Definition at line 624 of file yapf_costrail.hpp.
|
inline |
Definition at line 97 of file yapf_costrail.hpp.
|
inline |
Definition at line 633 of file yapf_costrail.hpp.
|
inline |
Check for a reserved station platform.
Definition at line 149 of file yapf_costrail.hpp.
References HasStationReservation(), ReverseTrackdir(), TileOffsByDiagDir(), and TrackdirToExitdir().
Referenced by CYapfCostRailT< Types >::ReservationCost().
|
inline |
Return one tile cost (base cost + level crossing penalty).
Definition at line 124 of file yapf_costrail.hpp.
References GetTileType(), IsDiagonalTrackdir(), IsLevelCrossing(), MP_ROAD, CYapfCostRailT< Types >::Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.
|
inline |
Called by YAPF to calculate the cost from the origin to the given node.
Calculates only the cost of given node, adds it to the parent node cost and stores the result into Node::cost member
Definition at line 274 of file yapf_costrail.hpp.
References _settings_game, Vehicle::current_order, FindFirstBit(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::Follow(), PathfinderSettings::forbid_90_deg, SpecializedStation< Waypoint, true >::Get(), BaseStation::GetByTile(), Order::GetDestination(), Train::GetDisplayMaxSpeed(), Order::GetMaxSpeed(), BaseStation::GetPlatformLength(), GetSignalStateByTrackdir(), GetStationIndex(), HasOnewaySignalBlockingTrackdir(), HasSignalOnTrackdir(), HasTrackdir(), INVALID_TILE, INVALID_TRACKDIR, IsRailDepot(), IsRailDepotTile(), IsRailWaypoint(), IsSafeWaitingPosition(), Waypoint::IsSingleTile(), IsTileType(), Order::IsType(), IsWaitingPositionFree(), KillFirstBit(), CYapfCostRailT< Types >::max_cost, MP_RAILWAY, MP_STATION, CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::new_td_bits, CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::new_tile, GameSettings::pf, RemoveFirstTrackdir(), ReverseDiagDir(), ReverseTrackdir(), SIGNAL_STATE_RED, SIGTYPE_EXIT, SIGTYPE_PBS_ONEWAY, TRACKDIR_BIT_NONE, TrackdirToExitdir(), TrackdirToTrack(), CYapfCostRailT< Types >::Yapf(), and YAPF_TILE_LENGTH.
|
inline |
Definition at line 245 of file yapf_costrail.hpp.
|
inline |
The cost for reserved tiles, including skipped ones.
Definition at line 159 of file yapf_costrail.hpp.
References GetReservedTrackbits(), CYapfCostRailT< Types >::IsAnyStationTileReserved(), IsDiagonalTrackdir(), IsRailStationTile(), TrackdirToTrack(), TrackOverlapsTracks(), CYapfCostRailT< Types >::Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.
|
inline |
Definition at line 264 of file yapf_costrail.hpp.
|
inline |
Sets whether the first two-way signal should be treated as a dead end.
Definition at line 80 of file yapf_costrail.hpp.
|
inline |
Definition at line 174 of file yapf_costrail.hpp.
|
inline |
Definition at line 91 of file yapf_costrail.hpp.
|
inline |
Definition at line 113 of file yapf_costrail.hpp.
|
inline |
Returns whether the first two-way signal should be treated as a dead end.
Definition at line 86 of file yapf_costrail.hpp.
References CYapfCostRailT< Types >::Yapf().
|
inlineprotected |
to access inherited path finder
Definition at line 73 of file yapf_costrail.hpp.
Referenced by CYapfCostRailT< Types >::OneTileCost(), CYapfCostRailT< Types >::PfCalcCost(), CYapfCostRailT< Types >::ReservationCost(), and CYapfCostRailT< Types >::TreatFirstRedTwoWaySignalAsEOL().
|
protected |
Definition at line 49 of file yapf_costrail.hpp.
|
protected |
Definition at line 48 of file yapf_costrail.hpp.
Referenced by CYapfCostRailT< Types >::PfCalcCost().
|
staticconstexprprotected |
Definition at line 57 of file yapf_costrail.hpp.
|
protected |
Definition at line 50 of file yapf_costrail.hpp.
bool CYapfCostRailT< Types >::stopped_on_first_two_way_signal = false |
Definition at line 54 of file yapf_costrail.hpp.
|
protected |
Definition at line 51 of file yapf_costrail.hpp.