41 const std::vector<SUMOVehicleParameter::Stop>& stops)
43 myProbability(prop), myRoute(route), myColor(color), myStops(stops) {}
47 myProbability(0.0), myRoute(route), myColor(nullptr), myStops() {}
50 :
Named(src.myID), myCosts(src.myCosts),
51 myProbability(src.myProbability), myRoute(src.myRoute), myColor(nullptr) {
83 for (ConstROEdgeVector::const_iterator i =
myRoute.begin() + 1; i !=
myRoute.end(); ++i) {
84 const ROEdge* prev = *(i - 1);
87 mh->
informf(
"Edge '%' not connected to edge '%' for vehicle '%'.", prev->
getID(), cur->
getID(), veh.
getID());
105 if (!roe->isInternal() && !roe->isTazConnector()) {
106 tempRoute.push_back(roe);
115 const bool withCosts,
116 const bool asAlternatives,
117 const bool withExitTimes,
118 const bool withLength,
119 const std::string&
id)
const {
127 if (asAlternatives) {
137 std::vector<double> exitTimes;
140 time += roe->getTravelTime(veh, time);
141 if (!roe->isInternal() && !roe->isTazConnector()) {
142 exitTimes.push_back(time);
150 length += roe->getLength();
std::vector< const ROEdge * > ConstROEdgeVector
std::vector< const ROEdge * > ConstROEdgeVector
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_COLOR
A color information.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
void informf(const std::string &format, T value, Targs... Fargs)
adds a new formatted message
Base class for objects which have an id.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
A basic edge for routing applications.
bool isConnectedTo(const ROEdge &e, const SUMOVehicleClass vClass) const
returns the information whether this edge is directly connected to the given
SUMOVehicleClass getVClass() const
const std::string & getID() const
Returns the id of the routable.
A complete router's route.
OutputDevice & writeXMLDefinition(OutputDevice &dev, const ROVehicle *const veh, const bool withCosts, const bool asAlternatives, const bool withExitTimes, const bool withLength, const std::string &id="") const
ConstROEdgeVector myRoute
The edges the route consists of.
double myCosts
The costs of the route.
void setProbability(double prob)
Sets the probability of the route.
double myProbability
The probability the driver will take this route with.
RORoute(const std::string &id, double costs, double prob, const ConstROEdgeVector &route, const RGBColor *const color, const std::vector< SUMOVehicleParameter::Stop > &stops)
Constructor.
void addProbability(double prob)
add additional vehicles/probability
const RGBColor * myColor
The color of the route.
ConstROEdgeVector getNormalEdges() const
return edges that shall be written in the route definition
void recheckForLoops(const ConstROEdgeVector &mandatory)
Checks whether this route contains loops and removes such.
void setCosts(double costs)
Sets the costs of the route.
bool isValid(const ROVehicle &veh, bool ignoreErrors) const
check whether the route is valid for the given vehicle
A vehicle as used by router.
SUMOTime getDepartureTime() const
Returns the time the vehicle starts at, 0 for triggered vehicles.
Some static methods for string processing.
void recheckForLoops(ConstROEdgeVector &edges, const ConstROEdgeVector &mandatory)
Checks whether the given edge list contains loops and removes them.