CYapfCostRouteLinkT< Types > Class Template Reference

YAPF cost provider for route links. More...

Inheritance diagram for CYapfCostRouteLinkT< Types >:
CYapfT< CYapfRouteLink_TypesT< CYapfRouteLink > > CYapfRouteLink

Public Member Functions

bool PfCalcCost (Node &n, const Follower *follow)
 Called by YAPF to calculate the cost from the origin to the given node.

Private Types

typedef Types::Tpf Tpf
 The pathfinder class (derived from THIS class).
typedef Types::TrackFollower Follower
 The route follower.
typedef Types::NodeList::Titem Node
 This will be our node type.

Private Member Functions

FORCEINLINE TpfYapf ()
 To access inherited path finder.
FORCEINLINE const TpfYapf () const
FORCEINLINE bool ValidLink (Node &n, const RouteLink *link, const RouteLink *parent) const
 Check if this is a valid connection.
FORCEINLINE int RouteLinkCost (const RouteLink *link, const RouteLink *parent) const
 Cost of a single route link.

Static Private Attributes

static const int PENALTY_DIVISOR = 16
 Penalty factor divisor for fixed-point arithmetics.
static const int LOCAL_PENALTY_FACTOR = 16
 Penalty factor for source-local delivery.
static const int RF_DISTANCE_FACTOR = 2
 Vehicle modifier for "cheap" cargo packets.
static const int RF_TIME_FACTOR = 3
 Time modifier for "fast" cargo packets.

Detailed Description

template<class Types>
class CYapfCostRouteLinkT< Types >

YAPF cost provider for route links.

Definition at line 90 of file yapf_cargo.cpp.


Member Function Documentation

template<class Types >
bool CYapfCostRouteLinkT< Types >::PfCalcCost ( Node n,
const Follower follow 
) [inline]
template<class Types >
FORCEINLINE int CYapfCostRouteLinkT< Types >::RouteLinkCost ( const RouteLink link,
const RouteLink parent 
) const [inline, private]
template<class Types >
FORCEINLINE bool CYapfCostRouteLinkT< Types >::ValidLink ( Node n,
const RouteLink link,
const RouteLink parent 
) const [inline, private]
template<class Types >
FORCEINLINE Tpf& CYapfCostRouteLinkT< Types >::Yapf (  )  [inline, private]

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

Generated on Fri Jun 3 05:19:49 2011 for OpenTTD by  doxygen 1.6.1