44 if (zoneNumber == 0) {
62 inline int bitcount(
long long int intVal)
const {
64 long long int counter = intVal;
66 while (counter != 0) {
67 counter = counter & (counter - 1);
143 std::vector<double>
zonePrices = std::vector<double> {1.9, 3.4, 4.9, 6.2, 7.7, 9.2};
168 void init(
const std::vector<std::string>& edges)
override {
180 double getEffort(
const int numericalID)
const override {
186 effort = std::numeric_limits<double>::max();
192 void update(
const int edge,
const int prev,
const double length)
override {
194 std::string
const& edgeType =
myEdges[edge];
206 if (edgeType.c_str()[0] !=
'!') {
208 }
else if (edgeType ==
"!stop") {
210 }
else if (edgeType ==
"!ped") {
212 }
else if (edgeType ==
"!access") {
275 case FareToken ::KLZ:
276 case FareToken ::KLU:
279 case FareToken ::KHU:
280 case FareToken ::KHZ:
284 case FareToken ::START:
291 return std::numeric_limits<double>::max();
296 std::string
output(
const int edge)
const override {
299 std::stringstream msg;
331 std::cout <<
"Propagating fare state for stop w/o a price!" << std::endl;
339 stateAtE = currentFareState;
346 case FareToken ::Free:
459 std::cout <<
"Reached invalid position in fareToken selection!" << std::endl;
470 stateAtE = currentFareState;
488 stateAtE = currentFareState;
500 stateAtE = currentFareState;
514 stateAtE = currentFareState;
static std::unordered_map< int, long long int > fareZoneToRep
int getOverlayZone(int zoneNumber)
the effort calculator interface
double getEffort(const int numericalID) const override
void setInitialState(const int edge) override
void updateFareStatePublic(FareState const ¤tFareState, const int publicTransportEdge, const double length)
void updateFareStatePedestrian(FareState const ¤tFareState, const int pedestrianEdge)
void addStop(const int stopEdge, const Parameterised ¶ms) override
std::vector< FareState > myFareStates
std::vector< std::string > myEdges
std::map< int, int > myStopFareZone
std::map< int, FareToken > myStopStartToken
void init(const std::vector< std::string > &edges) override
void updateFareStateStop(FareState const ¤tFareState, const int stopEdge)
std::string output(const int edge) const override
void updateFareStateAccess(FareState const ¤tFareState, const int accessEdge, const int prev)
void updateFareState(FareState const ¤tFareState, const int intermodalEdge)
std::map< int, FareToken > myStopFareToken
void update(const int edge, const int prev, const double length) override
double computePrice(FareState const &fareState) const
An upper class for objects with additional parameters.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
ZoneCounter(unsigned int ct)
int bitcount(long long int intVal) const
void addZone(int zoneNumber)
std::string tokenToTicket(FareToken const &token)
FareToken stringToToken(std::string str)
double myTravelledDistance
FareState(FareToken token)
std::vector< double > zonePrices