OpenTTD
Data Structures | Public Types | Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Protected Attributes
CYapfCostRailT< Types > Class Template Reference
Inheritance diagram for CYapfCostRailT< Types >:
CYapfCostBase CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnyDepotRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationAnyDepotRailT, CYapfFollowAnyDepotRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail1, CFollowTrackFreeRail, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfAnySafeTileRail2, CFollowTrackFreeRailNo90, CRailNodeListTrackDir, CYapfDestinationAnySafeTileRailT, CYapfFollowAnySafeTileRailT > > CYapfT< CYapfRail_TypesT< CYapfRail1, CFollowTrackRail, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfT< CYapfRail_TypesT< CYapfRail2, CFollowTrackRailNo90, CRailNodeListTrackDir, CYapfDestinationTileOrStationRailT, CYapfFollowRailT > > CYapfAnyDepotRail1 CYapfAnyDepotRail2 CYapfAnySafeTileRail1 CYapfAnySafeTileRail2 CYapfRail1 CYapfRail2

Data Structures

struct  TILE

Public Types

typedef Types::Tpf Tpf
 the pathfinder class (derived from THIS class)
typedef Types::TrackFollower TrackFollower
typedef Types::NodeList::Titem Node
 this will be our node type
typedef Node::Key Key
 key to hash tables
typedef Node::CachedData CachedData

Public Member Functions

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 m_stopped_on_first_two_way_signal

Protected Member Functions

TpfYapf ()
 to access inherited path finder

Protected Attributes

int m_max_cost
CBlobT< int > m_sig_look_ahead_costs
bool m_disable_cache

Static Protected Attributes

static const int s_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?

Detailed Description

template<class Types>
class CYapfCostRailT< Types >

Definition at line 18 of file yapf_costrail.hpp.

Member Function Documentation

template<class Types >
bool CYapfCostRailT< Types >::IsAnyStationTileReserved ( TileIndex  tile,
Trackdir  trackdir,
int  skipped 
)
inline

Check for a reserved station platform.

Definition at line 153 of file yapf_costrail.hpp.

References HasStationReservation(), ReverseTrackdir(), TileOffsByDiagDir(), and TrackdirToExitdir().

Referenced by CYapfCostRailT< Types >::ReservationCost().

template<class Types >
int CYapfCostRailT< Types >::OneTileCost ( TileIndex tile,
Trackdir  trackdir 
)
inline

Return one tile cost (base cost + level crossing penalty).

Definition at line 128 of file yapf_costrail.hpp.

References GetTileType(), IsDiagonalTrackdir(), IsLevelCrossing(), MP_ROAD, CYapfCostRailT< Types >::Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.

template<class Types >
bool CYapfCostRailT< Types >::PfCalcCost ( Node n,
const TrackFollower *  tf 
)
inline
template<class Types >
int CYapfCostRailT< Types >::ReservationCost ( Node n,
TileIndex  tile,
Trackdir  trackdir,
int  skipped 
)
inline

Field Documentation

template<class Types >
int CYapfCostRailT< Types >::m_max_cost
protected
Note
maximum cost doesn't work with caching enabled
Todo:
fix maximum cost failing with caching (e.g. FS#2900)

Definition at line 65 of file yapf_costrail.hpp.

Referenced by CYapfCostRailT< Types >::PfCalcCost().


The documentation for this class was generated from the following file: