53 if (period > 0 && timestep % period != 0) {
82 if (microVeh !=
nullptr) {
86 if (microVeh !=
nullptr && signals) {
93 const std::vector<MSTransportable*>& persons = veh->
getPersons();
94 for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
97 const std::vector<MSTransportable*>& containers = veh->
getContainers();
98 for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
107 for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
111 const std::vector<MSTransportable*>& persons = (*e)->getSortedPersons(timestep);
112 for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
120 const std::vector<MSEdge*>& edges = ec.
getEdges();
121 for (std::vector<MSEdge*>::const_iterator e = edges.begin(); e != edges.end(); ++e) {
125 const std::vector<MSTransportable*>& containers = (*e)->getSortedContainers(timestep);
126 for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
static const std::set< const MSEdge * > & getEdgeFilter()
SumoXMLTag
Numbers representing SUMO-XML - element names.
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
double z() const
Returns the z-position.
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
MSLane * getLane() const
Returns the lane the vehicle is on.
virtual double getEdgePos() const
Return the position on the edge.
double y() const
Returns the y-position.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
std::string time2string(SUMOTime t)
double x() const
Returns the x-position.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
int getSignals() const
Returns the signals.
const std::string & getID() const
Returns the id.
static void writeTransportable(OutputDevice &of, const MSEdge *e, MSTransportable *p, SumoXMLTag tag, bool useGeo, bool elevation)
write transportable
virtual double getSpeed() const
the current speed of the transportable
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
static OptionsCont & getOptions()
Retrieves the options.
static bool equippedByParameter(const MSTransportable *t, const std::string &deviceName, bool outputOptionSet)
Determines whether a transportable should get a certain device.
static void write(OutputDevice &of, SUMOTime timestep, bool elevation)
Writes the position and the angle of each vehicle into the given device.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
A road/street connecting two junctions.
static double naviDegree(const double angle)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a vehicle.
A point in 2D or 3D with translation and scaling methods.
virtual double getAngle() const
return the current angle of the transportable
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Stores edges and lanes, performs moving of vehicle.
virtual bool isRemoteControlled() const =0
Returns the information whether the vehicle is fully controlled via TraCI.
SUMOTime string2time(const std::string &r)
const std::string & getID() const
returns the id of the transportable
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
virtual const std::vector< MSTransportable * > & getContainers() const =0
retrieve riding containers
trigger: the time of the step
virtual double getAngle() const =0
Get the vehicle's angle.
virtual Position getPosition() const
Return the Network coordinate of the transportable.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
const std::string & getID() const
Returns the name of the vehicle type.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
const MSEdgeVector & getEdges() const
Returns loaded edges.
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
MSEdgeControl & getEdgeControl()
Returns the edge control.
The class responsible for building and deletion of vehicles.
std::vector< MSEdge * > MSEdgeVector
virtual double getSpeed() const =0
Returns the vehicle's current speed.
virtual const std::string & getID() const =0
Get the vehicle's ID.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.