45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
83 }
else if (roadClass == 0 || roadClass == 1) {
85 }
else if (roadClass == 2 && edge->
getSpeed() <= 11.) {
87 }
else if (roadClass == 2 && edge->
getSpeed() > 11. && edge->
getSpeed() <= 16.) {
89 }
else if (roadClass == 2 && edge->
getSpeed() > 16.) {
91 }
else if (roadClass == 3 && edge->
getSpeed() <= 11.) {
93 }
else if (roadClass == 3 && edge->
getSpeed() > 11. && edge->
getSpeed() <= 13.) {
95 }
else if (roadClass == 3 && edge->
getSpeed() > 13. && edge->
getSpeed() <= 16.) {
97 }
else if (roadClass == 3 && edge->
getSpeed() > 16.) {
99 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() <= 5.) {
101 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 5. && edge->
getSpeed() <= 7.) {
103 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 7. && edge->
getSpeed() <= 9.) {
105 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 9. && edge->
getSpeed() <= 11.) {
107 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 11. && edge->
getSpeed() <= 13.) {
109 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 13. && edge->
getSpeed() <= 16.) {
111 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 16. && edge->
getSpeed() <= 18.) {
113 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 18. && edge->
getSpeed() <= 22.) {
115 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 22. && edge->
getSpeed() <= 26.) {
117 }
else if ((roadClass >= 4 || roadClass == -1) && edge->
getSpeed() > 26.) {
127 for (std::vector<RORoute*>::const_iterator p = paths.begin(); p != paths.end(); p++) {
128 if (edges == (*p)->getEdgeVector()) {
134 paths.push_back(
new RORoute(routeId, costs, prob, edges, 0, std::vector<SUMOVehicleParameter::Stop>()));
147 for (
int k = 0; k < kPaths; k++) {
150 for (ConstROEdgeVector::iterator e = edges.begin(); e != edges.end(); e++) {
162 for (
int t = 0; t < numIter; t++) {
169 for (ConstROEdgeVector::iterator e = edges.begin(); e != edges.end(); e++) {
185 for (
int outer = 0; outer < maxOuterIteration; outer++) {
186 for (
int inner = 0; inner < maxInnerIteration; inner++) {
209 int unstableEdges = 0;
214 if (inner == 0 && outer == 0) {
217 newFlow += (edge->
getHelpFlow() - oldFlow) / (inner + 1);
221 if (
abs(newFlow - oldFlow) / newFlow > tolerance) {
224 }
else if (newFlow == 0.) {
225 if (oldFlow != 0. && (
abs(newFlow - oldFlow) / oldFlow > tolerance)) {
238 if (unstableEdges == 0) {
245 bool newRoute =
false;
277 const std::map<const ROEdge* const, SUMOReal>::const_iterator i =
myPenalties.find(e);
284 const std::map<const ROEdge* const, SUMOReal>::const_iterator i =
myPenalties.find(e);
void incremental(const int numIter)
const std::vector< ODCell * > & getCells()
void setHelpFlow(const SUMOReal flow)
SUMOAbstractRouter< ROEdge, ROVehicle > & myRouter
EdgeType getType() const
Returns the type of the edge.
SUMOReal getHelpFlow() const
ROMAAssignments(const SUMOTime begin, const SUMOTime end, RONet &net, ODMatrix &matrix, SUMOAbstractRouter< ROEdge, ROVehicle > &router)
Constructor.
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
const ConstROEdgeVector & getEdgeVector() const
Returns the list of edges this route consists of.
void setProbability(SUMOReal prob)
Sets the probability of the route.
unsigned int getLaneNo() const
Returns the number of lanes this edge has.
std::vector< const ROEdge * > ConstROEdgeVector
std::vector< RORoute * > pathsVector
the list of paths / routes
const std::string DEFAULT_VTYPE_ID
void addTravelTime(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd)
Adds a travel time value.
const std::map< std::string, ROEdge * > & getEdgeMap() const
void addProbability(SUMOReal prob)
add additional vehicles/probability
A vehicle as used by router.
A single O/D-matrix cell.
std::string origin
Name of the origin district.
static SUMOReal getPenalizedTT(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge including penalties.
void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string routeChoiceMethod)
An O/D (origin/destination) matrix.
SUMOReal getProbability() const
Returns the probability the driver will take this route with.
void setCosts(SUMOReal costs)
Sets the costs of the route.
~ROMAAssignments()
Destructor.
SUMOReal vehicleNumber
The number of vehicles.
An edge representing a whole district.
static std::map< const ROEdge *const, SUMOReal > myPenalties
static SUMOReal getTravelTime(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the traveltime on an edge without penalties.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
static SUMOReal getPenalizedEffort(const ROEdge *const e, const ROVehicle *const v, SUMOReal t)
Returns the effort to pass an edge including penalties.
A basic edge for routing applications.
The router's network representation.
Structure representing possible vehicle parameter.
void addEffort(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd)
Adds a weight value.
int getPriority() const
get edge priority (road class)
SUMOReal getLength() const
Returns the length of the edge.
SUMOReal getEffort(const ROVehicle *const veh, SUMOReal time) const
Returns the effort for this edge.
void getKPaths(const int kPaths, const SUMOReal penalty)
get the k shortest paths
virtual SUMOReal recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime) const =0
std::string destination
Name of the destination district.
bool addRoute(ConstROEdgeVector &edges, std::vector< RORoute * > &paths, std::string routeId, SUMOReal costs, SUMOReal prob)
add a route and check for duplicates
virtual void compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
SUMOVTypeParameter * getVehicleTypeSecure(const std::string &id)
Retrieves the named vehicle type.
SUMOReal getTravelTime(const ROVehicle *const veh, SUMOReal time) const
Returns the travel time for this edge.
static RouteCostCalculator< R, E, V > & getCalculator()
SUMOReal capacityConstraintFunction(const ROEdge *edge, const SUMOReal flow) const
A basic edge for routing applications.
static ROVehicle * myDefaultVehicle
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
A complete router's route.