libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::AbstractRoutingProfile Class Reference

Common base class for our concrete profile instantiations. More...

#include <RoutingProfile.h>

+ Inheritance diagram for osmscout::AbstractRoutingProfile:

Public Member Functions

 AbstractRoutingProfile (const TypeConfigRef &typeConfig)
void AddType (const TypeInfoRef &type, double speed)
bool CanUse (const RouteNode &currentNode, const std::vector< ObjectVariantData > &objectVariantData, size_t pathIndex) const
bool CanUse (const Area &area) const
bool CanUse (const Way &way) const
bool CanUseBackward (const Way &way) const
bool CanUseForward (const Way &way) const
double GetCostLimitDistance () const
double GetCostLimitFactor () const
double GetTime (const Area &area, double distance) const
double GetTime (const Way &way, double distance) const
Vehicle GetVehicle () const
void ParametrizeForBicycle (const TypeConfig &typeConfig, double maxSpeed)
bool ParametrizeForCar (const TypeConfig &typeConfig, const std::map< std::string, double > &speedMap, double maxSpeed)
void ParametrizeForFoot (const TypeConfig &typeConfig, double maxSpeed)
void SetCostLimitDistance (double costLimitDistance)
 seet SetCostLimitFactor() More...
void SetCostLimitFactor (double costLimitFactor)
 The router tries to minimize the actual costs of the route. More...
void SetVehicle (Vehicle vehicle)
void SetVehicleMaxSpeed (double maxSpeed)
- Public Member Functions inherited from osmscout::RoutingProfile
virtual double GetCosts (const RouteNode &currentNode, const std::vector< ObjectVariantData > &objectVariantData, size_t pathIndex) const =0
virtual double GetCosts (const Area &area, double distance) const =0
virtual double GetCosts (const Way &way, double distance) const =0
virtual double GetCosts (double distance) const =0
virtual ~RoutingProfile ()

Protected Attributes

AccessFeatureValueReader accessReader
double costLimitDistance
double costLimitFactor
double maxSpeed
MaxSpeedFeatureValueReader maxSpeedReader
double minSpeed
std::vector< double > speeds
TypeConfigRef typeConfig
Vehicle vehicle
double vehicleMaxSpeed
uint8_t vehicleRouteNodeBit

Detailed Description

Common base class for our concrete profile instantiations.

Offers a number of profile type independent interface implementations and helper methods.

Constructor & Destructor Documentation

osmscout::AbstractRoutingProfile::AbstractRoutingProfile ( const TypeConfigRef typeConfig)

Member Function Documentation

void osmscout::AbstractRoutingProfile::AddType ( const TypeInfoRef type,
double  speed 
bool osmscout::AbstractRoutingProfile::CanUse ( const RouteNode currentNode,
const std::vector< ObjectVariantData > &  objectVariantData,
size_t  pathIndex 
) const
bool osmscout::AbstractRoutingProfile::CanUse ( const Area &  area) const

Implements osmscout::RoutingProfile.

References speeds.

double osmscout::AbstractRoutingProfile::GetCostLimitDistance ( ) const
double osmscout::AbstractRoutingProfile::GetCostLimitFactor ( ) const
double osmscout::AbstractRoutingProfile::GetTime ( const Area &  area,
double  distance 
) const
double osmscout::AbstractRoutingProfile::GetTime ( const Way &  way,
double  distance 
) const
Vehicle osmscout::AbstractRoutingProfile::GetVehicle ( ) const
void osmscout::AbstractRoutingProfile::ParametrizeForBicycle ( const TypeConfig &  typeConfig,
double  maxSpeed 
bool osmscout::AbstractRoutingProfile::ParametrizeForCar ( const TypeConfig &  typeConfig,
const std::map< std::string, double > &  speedMap,
double  maxSpeed 
void osmscout::AbstractRoutingProfile::ParametrizeForFoot ( const TypeConfig &  typeConfig,
double  maxSpeed 
void osmscout::AbstractRoutingProfile::SetCostLimitDistance ( double  costLimitDistance)

seet SetCostLimitFactor()

costLimitDistancestatic distance value added to the maximum cost

References costLimitDistance.

void osmscout::AbstractRoutingProfile::SetCostLimitFactor ( double  costLimitFactor)

The router tries to minimize the actual costs of the route.

There is a lower limit defined by GetCosts(double distance). Applying the given factor to the minimal cost results in a upper limit for the costs.

Increasing the factor results in the router trying harder to find a route by looking for bigger and even bigger detours, decreasing the factor result in the router either finding a rather direct route or none. Setting the factor below 1.0 should result in the router not finding any route at all.

If there is a router the current router will find it and the router will look for the optimal route first. So, if there is a route the limit could be set to std::limits<double>::max(). If there is no route though the limit will stop the router to search for all possible detours, walking the whole graph in the end. Since this might take for ever the limit should be reasonable high.

The actual maximum cost limit is calculated based on a constant limit distance (default 10.0 Km) and a cost factor applied to the minimum costs 8default 5.0).

So the resulting maxium cost are profile.GetCosts(profile.GetCostLimitDistance())+ profile.GetCosts(distance)*profile.GetCostLimitFactor().

costLimitFactorThe new limit

References costLimitFactor.

void osmscout::AbstractRoutingProfile::SetVehicleMaxSpeed ( double  maxSpeed)

Member Data Documentation

AccessFeatureValueReader osmscout::AbstractRoutingProfile::accessReader
double osmscout::AbstractRoutingProfile::costLimitDistance

Referenced by SetCostLimitDistance().

double osmscout::AbstractRoutingProfile::costLimitFactor

Referenced by SetCostLimitFactor().

double osmscout::AbstractRoutingProfile::maxSpeed

Referenced by AddType(), and SetVehicleMaxSpeed().

MaxSpeedFeatureValueReader osmscout::AbstractRoutingProfile::maxSpeedReader
double osmscout::AbstractRoutingProfile::minSpeed

Referenced by AddType().

std::vector<double> osmscout::AbstractRoutingProfile::speeds
TypeConfigRef osmscout::AbstractRoutingProfile::typeConfig
Vehicle osmscout::AbstractRoutingProfile::vehicle
double osmscout::AbstractRoutingProfile::vehicleMaxSpeed

Referenced by SetVehicleMaxSpeed().

uint8_t osmscout::AbstractRoutingProfile::vehicleRouteNodeBit

Referenced by CanUse(), and SetVehicle().

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