22 #ifndef GawronCalculator_h 23 #define GawronCalculator_h 46 template<
class R,
class E,
class V>
57 route->setCosts(costs);
65 for (
typename std::vector<R*>::iterator i = alternatives.begin(); i != alternatives.end() - 1; i++) {
67 for (
typename std::vector<R*>::iterator j = i + 1; j != alternatives.end(); j++) {
71 (pS->getCosts() - pR->getCosts()) /
72 (pS->getCosts() + pR->getCosts());
74 SUMOReal newPR =
gawronF(pR->getProbability(), pS->getProbability(), delta);
75 SUMOReal newPS = pR->getProbability() + pS->getProbability() - newPR;
77 newPR = pS->getCosts() > pR->getCosts()
79 newPS = pS->getCosts() > pR->getCosts()
84 pR->setProbability(newPR);
85 pS->setProbability(newPS);
104 if (((1.0 - (x * x)) == 0)) {
107 return (
SUMOReal) exp((a * x) / (1.0 - (x * x)));
void calculateProbabilities(std::vector< R *> alternatives, const V *const, const SUMOTime)
calculate the probabilities
const SUMOReal myBeta
gawron beta - value
void setCosts(R *route, const SUMOReal costs, const bool isActive=false) const
Cost calculation with Gawron's method.
Abstract base class providing static factory method.
SUMOReal gawronG(const SUMOReal a, const SUMOReal x) const
Performs the gawron - g() function From "Dynamic User Equilibria...".
SUMOReal gawronF(const SUMOReal pdr, const SUMOReal pds, const SUMOReal x) const
Performs the gawron - f() function From "Dynamic User Equilibria...".
GawronCalculator & operator=(const GawronCalculator &s)
invalidated assignment operator
GawronCalculator(const SUMOReal beta, const SUMOReal a)
Constructor.
const SUMOReal myA
gawron a - value
virtual ~GawronCalculator()
Destructor.