48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
58 : myParameter(pars), myType(type), myRoute(route), myRoutingSuccess(false) {
65 for (std::vector<SUMOVehicleParameter::Stop>::const_iterator s = pars.
stops.begin(); s != pars.
stops.end(); ++s) {
79 std::vector<SUMOVehicleParameter::Stop>::iterator iter =
myParameter.
stops.begin();
80 ConstROEdgeVector::iterator edgeIter =
myStopEdges.begin();
89 ConstROEdgeVector::const_iterator stopEdgeIt = std::find(edges.begin(), edges.end(), stopEdge);
90 if (stopEdgeIt == edges.end()) {
95 if (edgeIter > stopEdgeIt || (edgeIter == stopEdgeIt && iter->endPos >= stopPar.
endPos)) {
103 iter += stopPar.
index;
104 edgeIter += stopPar.
index;
ROVehicle(const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net)
Constructor.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SUMOVehicleParameter myParameter
The vehicle's parameter.
void writeStops(OutputDevice &dev) const
Writes the enclosed stops.
Structure representing possible vehicle parameter.
bool saved
Information whether this type was already saved (needed by routers)
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.
SUMOReal getMaxSpeed() const
Returns the vehicle's maximum speed.
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
std::vector< const ROEdge * > ConstROEdgeVector
RORouteDef *const myRoute
The route the vehicle takes.
static OptionsCont & getOptions()
Retrieves the options.
std::vector< Stop > stops
List of the stops the vehicle will make.
void saveTypeAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos) const
Saves the vehicle type if it was not saved before.
void addStop(const SUMOVehicleParameter::Stop &stopPar, const RONet *net)
Adds a stop to this vehicle.
OutputDevice & writeXMLDefinition(OutputDevice &dev, const ROVehicle *const veh, bool asAlternatives, bool withExitTimes) const
Saves the built route / route alternatives.
SUMOReal endPos
The stopping position end.
const SUMOVTypeParameter *const myType
The type of the vehicle.
A basic edge for routing applications.
void saveAllAsXML(OutputDevice &os, bool asAlternatives, bool withExitTimes) const
Saves the complete vehicle description.
std::string lane
The lane to stop at.
void write(OutputDevice &dev) const
Writes the vtype.
SUMOReal maxSpeed
The vehicle type's maximum speed [m/s].
The router's network representation.
Structure representing possible vehicle parameter.
ConstROEdgeVector myStopEdges
The edges where the vehicle stops.
Definition of vehicle stop (position and duration)
int index
at which position in the stops list
Base class for a vehicle's route definition.
void write(OutputDevice &dev, const OptionsCont &oc) const
Writes the parameters as a beginning element.
Static storage of an output device and its base (abstract) implementation.
bool closeTag()
Closes the most recently opened tag.
const RORoute * getFirstRoute() const
virtual ~ROVehicle()
Destructor.
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the list of stops this route contains.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.