34 int maxEdges,
bool ignoreClasses,
36 bool discountSources) :
38 myUnbuildIsWarningOnly(unbuildIsWarningOnly),
39 myAcceptAllDestination(acceptAllDestinations), myMaxEdges(maxEdges),
40 myIgnoreClasses(ignoreClasses),
41 myAllowLoops(allowLoops),
42 myDiscountSources(discountSources)
58 std::set<const ROEdge*> avoidEdges;
60 while (current !=
nullptr && current != to &&
63 into.push_back(current);
64 const_cast<ROJTREdge*
>(current)->changeSourceFlow(-1);
66 avoidEdges.insert(current);
73 if (current ==
nullptr || (
int) into.size() >=
myMaxEdges) {
79 mh->
inform(
"The route starting at edge '" + from->
getID() +
"' could not be closed.");
85 if (current !=
nullptr) {
86 into.push_back(current);
std::vector< const ROEdge * > ConstROEdgeVector
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
const std::string & getID() const
Returns the id.
A basic edge for routing applications.
bool prohibits(const ROVehicle *const vehicle) const
Returns whether this edge prohibits the given vehicle to pass it.
bool isSink() const
Returns whether the edge acts as a sink.
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
An edge the jtr-router may route through.
ROJTREdge * chooseNext(const ROVehicle *const veh, double time, const std::set< const ROEdge * > &avoid) const
Returns the next edge to use.
int getSourceFlow() const
register source flow on this edge
const bool myAcceptAllDestination
Whether all edges may be used as route end.
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.
~ROJTRRouter()
Destructor.
bool compute(const ROEdge *from, const ROEdge *to, const ROVehicle *const vehicle, SUMOTime time, ConstROEdgeVector &into, bool silent=false)
Computes a route.
const bool myIgnoreClasses
Whether vehicle class information shall be ignored.
const bool myDiscountSources
Whether upstream flows shall be discounted from source flows.
ROJTRRouter(bool unbuildIsWarningOnly, bool acceptAllDestinations, int maxEdges, bool ignoreClasses, bool allowLoops, bool discountSources)
Constructor.
const bool myAllowLoops
Whether a vehicle may reuse a road.
A vehicle as used by router.