 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
17 #ifndef SUMO_FAREMODUL_H
18 #define SUMO_FAREMODUL_H
46 if (zoneNumber == 0) {
64 inline int bitcount(
long long int intVal)
const {
66 long long int counter = intVal;
68 while (counter != 0) {
69 counter = counter & (counter - 1);
95 myCounter(std::numeric_limits<int>::max()),
145 std::vector<double>
zonePrices = std::vector<double> {1.9, 3.4, 4.9, 6.2, 7.7, 9.2};
170 void init(
const std::vector<std::string>& edges)
override {
182 double getEffort(
const int numericalID)
const override {
188 effort = std::numeric_limits<double>::max();
194 void update(
const int edge,
const int prev,
const double length)
override {
196 std::string
const& edgeType =
myEdges[edge];
208 if (edgeType.c_str()[0] !=
'!') {
210 }
else if (edgeType ==
"!stop") {
212 }
else if (edgeType ==
"!ped") {
214 }
else if (edgeType ==
"!access") {
277 case FareToken ::KLZ:
278 case FareToken ::KLU:
281 case FareToken ::KHU:
282 case FareToken ::KHZ:
286 case FareToken ::START:
293 return std::numeric_limits<double>::max();
298 std::string
output(
const int edge)
const override {
301 std::stringstream msg;
333 std::cout <<
"Progagating fare state for stop w/o a price!" << std::endl;
341 stateAtE = currentFareState;
348 case FareToken ::Free:
461 std::cout <<
"Reached invalid position in fareToken selection!" << std::endl;
472 stateAtE = currentFareState;
490 stateAtE = currentFareState;
502 stateAtE = currentFareState;
516 stateAtE = currentFareState;
561 #endif //SUMO_FAREMODUL_H
void updateFareStatePedestrian(FareState const ¤tFareState, const int pedestrianEdge)
An upper class for objects with additional parameters.
void update(const int edge, const int prev, const double length) override
ZoneCounter(unsigned int ct)
void addStop(const int stopEdge, const Parameterised ¶ms) override
std::map< int, int > myStopFareZone
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
void setInitialState(const int edge) override
static std::unordered_map< int, long long int > fareZoneToRep
int getOverlayZone(int zoneNumber)
FareToken stringToToken(std::string str)
FareState(FareToken token)
std::string output(const int edge) const override
void addZone(int zoneNumber)
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
double computePrice(FareState const &fareState) const
std::vector< double > zonePrices
int bitcount(long long int intVal) const
void updateFareState(FareState const ¤tFareState, const int intermodalEdge)
void updateFareStatePublic(FareState const ¤tFareState, const int publicTransportEdge, const double length)
void updateFareStateAccess(FareState const ¤tFareState, const int accessEdge, const int prev)
void init(const std::vector< std::string > &edges) override
the effort calculator interface
void updateFareStateStop(FareState const ¤tFareState, const int stopEdge)
double getEffort(const int numericalID) const override
std::vector< std::string > myEdges
std::vector< FareState > myFareStates
double myTravelledDistance
std::map< int, FareToken > myStopStartToken
std::string tokenToTicket(FareToken const &token)
std::map< int, FareToken > myStopFareToken