SUMO - Simulation of Urban MObility
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 >:
Inheritance graph
Collaboration diagram for LogitCalculator< R, E, V >:
Collaboration graph

Public Member Functions

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

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 More...
 
double getThetaForCLogit (const std::vector< R *> alternatives) const
 calculate the scaling factor in the logit model More...
 
LogitCalculatoroperator= (const LogitCalculator &s)
 invalidated assignment operator More...
 

Private Attributes

const double myBeta
 logit beta - value More...
 
std::map< const R *, double > myCommonalities
 The route commonality factors for c-logit. More...
 
const double myGamma
 logit gamma - value More...
 
const double myTheta
 logit theta - value More...
 

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 47 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 50 of file LogitCalculator.h.

◆ ~LogitCalculator()

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

Destructor.

Definition at line 54 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

◆ cleanup()

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

◆ 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 105 of file LogitCalculator.h.

References max, and min.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().

◆ getCalculator()

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

◆ getMaxRouteNumber()

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

◆ 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 117 of file LogitCalculator.h.

References max, and min.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().

◆ keepRoutes()

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

◆ operator=()

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

invalidated assignment operator

◆ 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 56 of file LogitCalculator.h.

◆ skipRouteCalculation()

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

Field Documentation

◆ myBeta

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

logit beta - value

Definition at line 144 of file LogitCalculator.h.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().

◆ 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 153 of file LogitCalculator.h.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().

◆ myGamma

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

logit gamma - value

Definition at line 147 of file LogitCalculator.h.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().

◆ myTheta

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

logit theta - value

Definition at line 150 of file LogitCalculator.h.

Referenced by LogitCalculator< R, E, V >::calculateProbabilities().


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