48 #ifdef CHECK_MEMORY_LEAKS
50 #endif // CHECK_MEMORY_LEAKS
58 : myParameter(pars), myType(type), myRoute(route) {
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 std::vector<const ROEdge*>::iterator edgeIter =
myStopEdges.begin();
89 std::vector<const ROEdge*>::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.
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.
bool isSaved() const
Returns the information whether this item was already saved.
SUMOReal getMaxSpeed() const
Returns the vehicle's maximum speed.
RORouteDef *const myRoute
The route the vehicle takes.
void saveAllAsXML(OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
Saves the complete vehicle description.
static OptionsCont & getOptions()
Retrieves the options.
std::vector< Stop > stops
List of the stops the vehicle will make.
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.
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].
const std::vector< const ROEdge * > & getEdgeVector() const
Returns the list of edges this route consists of.
The router's network representation.
Structure representing possible vehicle parameter.
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.
std::vector< const ROEdge * > myStopEdges
The edges where the vehicle stops.
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.