 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
16 #ifndef SUMO_FAREMODUL_H
17 #define SUMO_FAREMODUL_H
45 if (zoneNumber == 0) {
63 inline int bitcount(
long long int intVal)
const {
65 long long int counter = intVal;
67 while (counter != 0) {
68 counter = counter & (counter - 1);
94 myCounter(std::numeric_limits<int>::max()),
144 std::vector<double>
zonePrices = std::vector<double> {1.9, 3.4, 4.9, 6.2, 7.7, 9.2};
169 void init(
const std::vector<std::string>& edges)
override {
181 double getEffort(
const int numericalID)
const override {
187 effort = std::numeric_limits<double>::max();
193 void update(
const int edge,
const int prev,
const double length)
override {
195 std::string
const& edgeType =
myEdges[edge];
207 if (edgeType.c_str()[0] !=
'!') {
209 }
else if (edgeType ==
"!stop") {
211 }
else if (edgeType ==
"!ped") {
213 }
else if (edgeType ==
"!access") {
276 case FareToken ::KLZ:
277 case FareToken ::KLU:
280 case FareToken ::KHU:
281 case FareToken ::KHZ:
285 case FareToken ::START:
292 return std::numeric_limits<double>::max();
297 std::string
output(
const int edge)
const override {
300 std::stringstream msg;
332 std::cout <<
"Progagating fare state for stop w/o a price!" << std::endl;
340 stateAtE = currentFareState;
347 case FareToken ::Free:
460 std::cout <<
"Reached invalid position in fareToken selection!" << std::endl;
471 stateAtE = currentFareState;
489 stateAtE = currentFareState;
501 stateAtE = currentFareState;
515 stateAtE = currentFareState;
560 #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