 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
43 const std::string& vType,
45 :
Named(id), myVType(vType), myOutputDevice(od), myFrequency(frequency) {
64 const MSVehicle* microVeh = dynamic_cast<const MSVehicle*>(veh);
70 if (microVeh !=
nullptr) {
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
const std::string & getID() const
Returns the name of the vehicle type.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
Base class for objects which have an id.
Static storage of an output device and its base (abstract) implementation.
double z() const
Returns the z-position.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
virtual const std::string & getID() const =0
Get the vehicle's ID.
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
Representation of a vehicle.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
SUMOTime myFrequency
The frequency of reporting.
SUMOTime execute(SUMOTime currentTime)
Writes values into the given stream.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
std::string time2string(SUMOTime t)
std::string myVType
The id of the vehicle type vehicles must have to be reported.
bool hasElevation() const
return whether the network contains elevation data
trigger: the time of the step
virtual ~MSVTypeProbe()
Destructor.
MSLane * getLane() const
Returns the lane the vehicle is on.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & myOutputDevice
The device to write into.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
The class responsible for building and deletion of vehicles.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
const std::string & getID() const
Returns the id.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
MSVTypeProbe(const std::string &id, const std::string &vType, OutputDevice &od, SUMOTime frequency)
Constructor.
Representation of a vehicle in the micro simulation.