Eclipse SUMO - Simulation of Urban MObility
FareModul Class Reference

#include <FareModul.h>

Inheritance diagram for FareModul:
Collaboration diagram for FareModul:

Public Member Functions

void addStop (const int stopEdge, const Parameterised &params) override
 
 FareModul ()
 
double getEffort (const int numericalID) const override
 
void init (const std::vector< std::string > &edges) override
 
void setInitialState (const int edge) override
 
void update (const int edge, const int prev, const double length) override
 

Private Member Functions

double computePrice (FareState const &fareState) const
 
std::string output (const int edge) const override
 
void updateFareState (FareState const &currentFareState, const int intermodalEdge)
 
void updateFareStateAccess (FareState const &currentFareState, const int accessEdge, const int prev)
 
void updateFareStatePedestrian (FareState const &currentFareState, const int pedestrianEdge)
 
void updateFareStatePublic (FareState const &currentFareState, const int publicTransportEdge, const double length)
 
void updateFareStateStop (FareState const &currentFareState, const int stopEdge)
 

Private Attributes

std::vector< std::string > myEdges
 
std::vector< FareStatemyFareStates
 
std::map< int, FareTokenmyStopFareToken
 
std::map< int, int > myStopFareZone
 
std::map< int, FareTokenmyStopStartToken
 
Prices prices
 

Detailed Description

The fare modul responsible for calculating prices

Definition at line 160 of file FareModul.h.

Constructor & Destructor Documentation

◆ FareModul()

FareModul::FareModul ( )
inline

Constructor

Definition at line 164 of file FareModul.h.

Member Function Documentation

◆ addStop()

void FareModul::addStop ( const int  stopEdge,
const Parameterised params 
)
inlineoverridevirtual

◆ computePrice()

◆ getEffort()

double FareModul::getEffort ( const int  numericalID) const
inlineoverridevirtual

Implementation of EffortCalculator

Implements EffortCalculator.

Definition at line 181 of file FareModul.h.

References FareState::isValid(), myFareStates, and FareState::myPriceDiff.

◆ init()

void FareModul::init ( const std::vector< std::string > &  edges)
inlineoverridevirtual

Implementation of EffortCalculator

Implements EffortCalculator.

Definition at line 169 of file FareModul.h.

References myEdges, and myFareStates.

◆ output()

std::string FareModul::output ( const int  edge) const
inlineoverrideprivatevirtual

basic output facility to inform about effort at this edge

Implements EffortCalculator.

Definition at line 297 of file FareModul.h.

References computePrice(), FareState::myCounter, myFareStates, FareState::myFareToken, ZoneCounter::numZones(), and FareUtil::tokenToTicket().

◆ setInitialState()

void FareModul::setInitialState ( const int  edge)
inlineoverridevirtual

Implementation of EffortCalculator _IntermodalEdge should be an Connector Edge

Implements EffortCalculator.

Definition at line 228 of file FareModul.h.

References myFareStates, and None.

◆ update()

void FareModul::update ( const int  edge,
const int  prev,
const double  length 
)
inlineoverridevirtual

◆ updateFareState()

void FareModul::updateFareState ( FareState const &  currentFareState,
const int  intermodalEdge 
)
inlineprivate

Definition at line 493 of file FareModul.h.

References myFareStates, FareState::myFareToken, and None.

Referenced by update().

◆ updateFareStateAccess()

void FareModul::updateFareStateAccess ( FareState const &  currentFareState,
const int  accessEdge,
const int  prev 
)
inlineprivate

Definition at line 509 of file FareModul.h.

References K, L, FareState::myCounter, myEdges, myFareStates, FareState::myFareToken, None, and ZoneCounter::numZones().

Referenced by update().

◆ updateFareStatePedestrian()

void FareModul::updateFareStatePedestrian ( FareState const &  currentFareState,
const int  pedestrianEdge 
)
inlineprivate

Definition at line 466 of file FareModul.h.

References myFareStates, FareState::myFareToken, and None.

Referenced by update().

◆ updateFareStatePublic()

void FareModul::updateFareStatePublic ( FareState const &  currentFareState,
const int  publicTransportEdge,
const double  length 
)
inlineprivate

Definition at line 480 of file FareModul.h.

References myFareStates, FareState::myFareToken, and FareState::myTravelledDistance.

Referenced by update().

◆ updateFareStateStop()

void FareModul::updateFareStateStop ( FareState const &  currentFareState,
const int  stopEdge 
)
inlineprivate

Field Documentation

◆ myEdges

std::vector<std::string> FareModul::myEdges
private

List of all edge line attributes

Definition at line 241 of file FareModul.h.

Referenced by init(), update(), and updateFareStateAccess().

◆ myFareStates

std::vector<FareState> FareModul::myFareStates
private

◆ myStopFareToken

std::map<int, FareToken> FareModul::myStopFareToken
private

the faretoken that can be collected at this station

Definition at line 247 of file FareModul.h.

Referenced by addStop(), and updateFareStateStop().

◆ myStopFareZone

std::map<int, int> FareModul::myStopFareZone
private

the fare zone this stop is a part of

Definition at line 244 of file FareModul.h.

Referenced by addStop(), and updateFareStateStop().

◆ myStopStartToken

std::map<int, FareToken> FareModul::myStopStartToken
private

the faretoken that is used when a trip is started at this station

Definition at line 250 of file FareModul.h.

Referenced by addStop(), and updateFareStateStop().

◆ prices

Prices FareModul::prices
private

List of the prices

Definition at line 253 of file FareModul.h.

Referenced by computePrice().


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