42 #ifdef CHECK_MEMORY_LEAKS
44 #endif // CHECK_MEMORY_LEAKS
89 : myBeta(beta), myA(a) {}
107 for (std::vector<RORoute*>::iterator i = alternatives.begin(); i != alternatives.end() - 1; i++) {
109 for (std::vector<RORoute*>::iterator j = i + 1; j != alternatives.end(); j++) {
138 return (pdr * (pdr + pds) *
gawronG(
myA, x)) /
145 if (((1.0 - (x * x)) == 0)) {
148 return (
SUMOReal) exp((a * x) / (1.0 - (x * x)));
156 : myBeta(beta), myGamma(gamma), myTheta(theta) {}
174 for (std::vector<RORoute*>::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) {
177 const std::vector<const ROEdge*>& edgesR = pR->
getEdgeVector();
178 for (std::vector<const ROEdge*>::const_iterator edge = edgesR.begin(); edge != edgesR.end(); ++edge) {
183 for (std::vector<RORoute*>::const_iterator j = alternatives.begin(); j != alternatives.end(); j++) {
187 const std::vector<const ROEdge*>& edgesS = pS->
getEdgeVector();
188 for (std::vector<const ROEdge*>::const_iterator edge = edgesS.begin(); edge != edgesS.end(); ++edge) {
190 if (std::find(edgesR.begin(), edgesR.end(), *edge) != edgesR.end()) {
194 overlapSum += pow(overlapLength / sqrt(lengthR * lengthS),
myGamma);
199 for (std::vector<RORoute*>::iterator i = alternatives.begin(); i != alternatives.end(); i++) {
202 for (std::vector<RORoute*>::iterator j = alternatives.begin(); j != alternatives.end(); j++) {
214 for (std::vector<RORoute*>::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) {
215 const SUMOReal cost = (*i)->getCosts() / 3600.;
230 for (std::vector<RORoute*>::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) {
231 const SUMOReal cost = (*i)->getCosts() / 3600.;
238 for (std::vector<RORoute*>::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) {
239 diff += pow((*i)->getCosts() / 3600. - meanCost, 2);
241 const SUMOReal cvCost = sqrt(diff /
SUMOReal(alternatives.size())) / meanCost;
244 return M_PI / (sqrt(6.) * cvCost * (min + 1.1)) / 3600.;
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at.
SUMOReal getCosts() const
Returns the costs of the route.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const SUMOReal myA
gawron a - value
const SUMOReal myBeta
logit beta - value
void setProbability(SUMOReal prob)
Sets the probability of the route.
void calculateProbabilities(const ROVehicle *const veh, std::vector< RORoute * > alternatives)
calculate the probabilities
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static OptionsCont & getOptions()
Retrieves the options.
Abstract base class providing static factory method.
bool myKeepRoutes
Information whether all routes should be saved.
SUMOReal gawronG(const SUMOReal a, const SUMOReal x) const
Performs the gawron - g() function From "Dynamic User Equilibria...".
A vehicle as used by router.
virtual ~ROCostCalculator()
Destructor.
ROCostCalculator()
Constructor.
void setCosts(RORoute *route, const SUMOReal costs, const bool isActive=false) const
bool mySkipRouteCalculation
Information whether new routes should be calculated.
SUMOReal getProbability() const
Returns the probability the driver will take this route with.
void setCosts(SUMOReal costs)
Sets the costs of the route.
virtual ~ROGawronCalculator()
Destructor.
SUMOReal gawronF(const SUMOReal pdr, const SUMOReal pds, const SUMOReal x) const
Performs the gawron - f() function From "Dynamic User Equilibria...".
ROGawronCalculator(const SUMOReal beta, const SUMOReal a)
Constructor.
unsigned int myMaxRouteNumber
The maximum route alternatives number.
const SUMOReal myGamma
logit gamma - value
void calculateProbabilities(const ROVehicle *const veh, std::vector< RORoute * > alternatives)
calculate the probabilities in the logit model
const std::vector< const ROEdge * > & getEdgeVector() const
Returns the list of edges this route consists of.
ROLogitCalculator(const SUMOReal beta, const SUMOReal gamma, const SUMOReal theta)
Constructor.
Cost calculation with c-logit or logit method.
A storage for options typed value containers)
Cost calculation with Gawron's method.
const SUMOReal myTheta
logit theta - value
SUMOReal getBetaForCLogit(const std::vector< RORoute * > alternatives) const
calculate the scaling factor in the logit model
static ROCostCalculator & getCalculator()
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::map< const RORoute *, SUMOReal > myCommonalities
The route commonality factors for c-logit.
static ROCostCalculator * myInstance
const SUMOReal myBeta
gawron beta - value
virtual ~ROLogitCalculator()
Destructor.
A complete router's route.
SUMOReal getThetaForCLogit(const std::vector< RORoute * > alternatives) const
calculate the scaling factor in the logit model
void setCosts(RORoute *route, const SUMOReal costs, const bool isActive=false) const