Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] weight update-routing algorithms

Hello,

I would like to know about calculating the cost of the shortest path in 3 routing algorithms in SUMO. Is the metric, travel time? Do they take the cost of internal edges into account when they find the shortest path?
I read this page  https://sumo.dlr.de/docs/Simulation/Routing.html , but it is not very clear for me.
The reason I ask this is that I have added another routing algorithm in SUMO. I assign the cost of each edge  using the function below:

 void MyRouter::setcurrent_weight(SUMOTime msTime, const V* const vehicle)
{
current_weight.clear();
for (const E * edge : myEdges){
 if (edge->getFromJunction() != nullptr && edge->getToJunction() != nullptr) {
   current_weight.push_back(MSRoutingEngine::getEffort(edge, vehicle, STEPS2TIME(msTime)));}
}
}

and update the whole vector in the interval defined by   --device.rerouting.adaptation-interval . However, the calculated shortest path and duration, for some trips, are slightly longer. I think there should be a difference between how I assign the edge weight and the way CH and other algorithms do.


--
RAZ

Back to the top