38 #ifdef CHECK_MEMORY_LEAKS 40 #endif // CHECK_MEMORY_LEAKS 47 int maxEdges,
bool ignoreClasses,
bool allowLoops) :
49 myUnbuildIsWarningOnly(unbuildIsWarningOnly),
50 myAcceptAllDestination(acceptAllDestinations), myMaxEdges(maxEdges),
51 myIgnoreClasses(ignoreClasses), myAllowLoops(allowLoops)
64 std::set<const ROEdge*> avoidEdges;
66 while (current != 0 && current != to &&
69 into.push_back(current);
71 avoidEdges.insert(current);
78 if (current == 0 || (
int) into.size() >=
myMaxEdges) {
83 mh->
inform(
"The route starting at edge '" + from->
getID() +
"' could not be closed.");
88 into.push_back(current);
96 for (ConstROEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
97 costs += (*i)->getTravelTime(v, time);
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
const bool myUnbuildIsWarningOnly
Whether unbuildable routes shall be reported as warniings, not errors.
const int myMaxEdges
The maximum number of edges a route may have.
ROJTREdge * chooseNext(const ROVehicle *const veh, SUMOReal time, const std::set< const ROEdge * > &avoid) const
Returns the next edge to use.
EdgeFunc getFunc() const
Returns the function of the edge.
std::vector< const ROEdge * > ConstROEdgeVector
const bool myAcceptAllDestination
Whether all edges may be used as route end.
void compute(const ROEdge *from, const ROEdge *to, const ROVehicle *const vehicle, SUMOTime time, ConstROEdgeVector &into)
Computes a route.
const bool myAllowLoops
Whether a vehicle may reuse a road.
SUMOReal recomputeCosts(const ConstROEdgeVector &edges, const ROVehicle *const v, SUMOTime time) const
Recomputes the costs of a route.
const std::string & getID() const
Returns the id.
A vehicle as used by router.
An edge where vehicles disappear (no vehicle may leave this edge)
~ROJTRRouter()
Destructor.
const bool myIgnoreClasses
Whether vehicle class information shall be ignored.
An edge the jtr-router may route through.
A basic edge for routing applications.
ROJTRRouter(bool unbuildIsWarningOnly, bool acceptAllDestinations, int maxEdges, bool ignoreClasses, bool allowLoops)
Constructor.
bool prohibits(const ROVehicle *const vehicle) const
Returns whether this edge prohibits the given vehicle to pass it.
void inform(std::string msg, bool addType=true)
adds a new error to the list
SUMOReal getTravelTime(const ROVehicle *const veh, SUMOReal time) const
Returns the travel time for this edge.