Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
LogitCalculator< R, E, V > Class Template Reference

Cost calculation with c-logit or logit method. More...

#include <LogitCalculator.h>

Inheritance diagram for LogitCalculator< R, E, V >:
[legend]
Collaboration diagram for LogitCalculator< R, E, V >:
[legend]

Public Member Functions

void calculateProbabilities (std::vector< R * > alternatives, const V *const veh, const SUMOTime time)
 calculate the probabilities in the logit model
int getMaxRouteNumber () const
bool keepAllRoutes () const
bool keepRoute () const
 LogitCalculator (const double beta, const double gamma, const double theta)
 Constructor.
void setCosts (R *route, const double costs, const bool) const
bool skipRouteCalculation () const
virtual ~LogitCalculator ()
 Destructor.

Static Public Member Functions

static void cleanup ()
static RouteCostCalculator< R, E, V > & getCalculator ()

Private Member Functions

double getBetaForCLogit (const std::vector< R * > alternatives) const
 calculate the scaling factor in the logit model
double getThetaForCLogit (const std::vector< R * > alternatives) const
 calculate the scaling factor in the logit model
LogitCalculatoroperator= (const LogitCalculator &s)
 invalidated assignment operator

Private Attributes

const double myBeta
 logit beta - value
std::map< const R *, double > myCommonalities
 The route commonality factors for c-logit.
const double myGamma
 logit gamma - value
double myKeepRouteProb
 Information whether the old route shall be kept.
bool myKeepRoutes
 Information whether all routes should be saved.
int myMaxRouteNumber
 The maximum route alternatives number.
bool mySkipNewRoutes
 Information whether new routes shall be computed.
const double myTheta
 logit theta - value

Static Private Attributes

static RouteCostCalculatormyInstance

Detailed Description

template<class R, class E, class V>
class LogitCalculator< R, E, V >

Cost calculation with c-logit or logit method.

Definition at line 37 of file LogitCalculator.h.

Constructor & Destructor Documentation

◆ LogitCalculator()

template<class R, class E, class V>
LogitCalculator< R, E, V >::LogitCalculator ( const double beta,
const double gamma,
const double theta )
inline

Constructor.

Definition at line 40 of file LogitCalculator.h.

References myBeta, myGamma, and myTheta.

Referenced by operator=().

Here is the caller graph for this function:

◆ ~LogitCalculator()

template<class R, class E, class V>
virtual LogitCalculator< R, E, V >::~LogitCalculator ( )
inlinevirtual

Destructor.

Definition at line 44 of file LogitCalculator.h.

Member Function Documentation

◆ calculateProbabilities()

template<class R, class E, class V>
void LogitCalculator< R, E, V >::calculateProbabilities ( std::vector< R * > alternatives,
const V *const veh,
const SUMOTime time )
inlinevirtual

calculate the probabilities in the logit model

Implements RouteCostCalculator< R, E, V >.

Definition at line 51 of file LogitCalculator.h.

References getBetaForCLogit(), getThetaForCLogit(), myBeta, myCommonalities, myGamma, myTheta, and STEPS2TIME.

◆ cleanup()

template<class R, class E, class V>
void RouteCostCalculator< R, E, V >::cleanup ( )
inlinestaticinherited

Definition at line 46 of file RouteCostCalculator.h.

References myInstance.

Referenced by RONet::cleanup().

Here is the caller graph for this function:

◆ getBetaForCLogit()

template<class R, class E, class V>
double LogitCalculator< R, E, V >::getBetaForCLogit ( const std::vector< R * > alternatives) const
inlineprivate

calculate the scaling factor in the logit model

Definition at line 91 of file LogitCalculator.h.

Referenced by calculateProbabilities().

Here is the caller graph for this function:

◆ getCalculator()

template<class R, class E, class V>
RouteCostCalculator< R, E, V > & RouteCostCalculator< R, E, V >::getCalculator ( )
staticinherited

Definition at line 120 of file RouteCostCalculator.h.

References OptionsCont::getFloat(), OptionsCont::getOptions(), OptionsCont::getString(), myInstance, and RouteCostCalculator().

Referenced by RORouteDef::addAlternative(), RORouteDef::preComputeCurrentRoute(), and ROMAAssignments::sue().

Here is the caller graph for this function:

◆ getMaxRouteNumber()

template<class R, class E, class V>
int RouteCostCalculator< R, E, V >::getMaxRouteNumber ( ) const
inlineinherited

Definition at line 56 of file RouteCostCalculator.h.

References myMaxRouteNumber.

◆ getThetaForCLogit()

template<class R, class E, class V>
double LogitCalculator< R, E, V >::getThetaForCLogit ( const std::vector< R * > alternatives) const
inlineprivate

calculate the scaling factor in the logit model

Definition at line 103 of file LogitCalculator.h.

Referenced by calculateProbabilities().

Here is the caller graph for this function:

◆ keepAllRoutes()

template<class R, class E, class V>
bool RouteCostCalculator< R, E, V >::keepAllRoutes ( ) const
inlineinherited

Definition at line 60 of file RouteCostCalculator.h.

References myKeepRoutes.

◆ keepRoute()

template<class R, class E, class V>
bool RouteCostCalculator< R, E, V >::keepRoute ( ) const
inlineinherited

Definition at line 68 of file RouteCostCalculator.h.

References myKeepRouteProb, and RandHelper::rand().

◆ operator=()

template<class R, class E, class V>
LogitCalculator & LogitCalculator< R, E, V >::operator= ( const LogitCalculator< R, E, V > & s)
private

invalidated assignment operator

References LogitCalculator().

◆ setCosts()

template<class R, class E, class V>
void LogitCalculator< R, E, V >::setCosts ( R * route,
const double costs,
const bool  ) const
inlinevirtual

Implements RouteCostCalculator< R, E, V >.

Definition at line 46 of file LogitCalculator.h.

◆ skipRouteCalculation()

template<class R, class E, class V>
bool RouteCostCalculator< R, E, V >::skipRouteCalculation ( ) const
inlineinherited

Definition at line 64 of file RouteCostCalculator.h.

References mySkipNewRoutes.

Field Documentation

◆ myBeta

template<class R, class E, class V>
const double LogitCalculator< R, E, V >::myBeta
private

logit beta - value

Definition at line 130 of file LogitCalculator.h.

Referenced by calculateProbabilities(), and LogitCalculator().

◆ myCommonalities

template<class R, class E, class V>
std::map<const R*, double> LogitCalculator< R, E, V >::myCommonalities
private

The route commonality factors for c-logit.

Definition at line 139 of file LogitCalculator.h.

Referenced by calculateProbabilities().

◆ myGamma

template<class R, class E, class V>
const double LogitCalculator< R, E, V >::myGamma
private

logit gamma - value

Definition at line 133 of file LogitCalculator.h.

Referenced by calculateProbabilities(), and LogitCalculator().

◆ myInstance

template<class R, class E, class V>
RouteCostCalculator* RouteCostCalculator< R, E, V >::myInstance
staticprivateinherited

Definition at line 92 of file RouteCostCalculator.h.

Referenced by cleanup(), and getCalculator().

◆ myKeepRouteProb

template<class R, class E, class V>
double RouteCostCalculator< R, E, V >::myKeepRouteProb
privateinherited

Information whether the old route shall be kept.

Definition at line 104 of file RouteCostCalculator.h.

Referenced by keepRoute(), and RouteCostCalculator().

◆ myKeepRoutes

template<class R, class E, class V>
bool RouteCostCalculator< R, E, V >::myKeepRoutes
privateinherited

Information whether all routes should be saved.

Definition at line 98 of file RouteCostCalculator.h.

Referenced by keepAllRoutes(), and RouteCostCalculator().

◆ myMaxRouteNumber

template<class R, class E, class V>
int RouteCostCalculator< R, E, V >::myMaxRouteNumber
privateinherited

The maximum route alternatives number.

Definition at line 95 of file RouteCostCalculator.h.

Referenced by getMaxRouteNumber(), and RouteCostCalculator().

◆ mySkipNewRoutes

template<class R, class E, class V>
bool RouteCostCalculator< R, E, V >::mySkipNewRoutes
privateinherited

Information whether new routes shall be computed.

Definition at line 101 of file RouteCostCalculator.h.

Referenced by RouteCostCalculator(), and skipRouteCalculation().

◆ myTheta

template<class R, class E, class V>
const double LogitCalculator< R, E, V >::myTheta
private

logit theta - value

Definition at line 136 of file LogitCalculator.h.

Referenced by calculateProbabilities(), and LogitCalculator().


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