 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
55 if (period > 0 && timestep % period != 0) {
63 const MSVehicle* microVeh = dynamic_cast<const MSVehicle*>(veh);
84 if (microVeh !=
nullptr) {
88 if (microVeh !=
nullptr) {
101 of.
writeAttr(
"distance", fabs(distance));
108 const std::vector<MSTransportable*>& persons = veh->
getPersons();
109 for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
112 const std::vector<MSTransportable*>& containers = veh->
getContainers();
113 for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
122 for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
126 const std::vector<MSTransportable*>& persons = (*e)->getSortedPersons(timestep);
127 for (std::vector<MSTransportable*>::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) {
135 const std::vector<MSEdge*>& edges = ec.
getEdges();
136 for (std::vector<MSEdge*>::const_iterator e = edges.begin(); e != edges.end(); ++e) {
140 const std::vector<MSTransportable*>& containers = (*e)->getSortedContainers(timestep);
141 for (std::vector<MSTransportable*>::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) {
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 const std::vector< MSTransportable * > & getContainers() const =0
retrieve riding containers
virtual double getAngle() const =0
Get the vehicle's angle.
Static storage of an output device and its base (abstract) implementation.
static const std::set< const MSEdge * > & getEdgeFilter()
double z() const
Returns the z-position.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual bool isRemoteControlled() const =0
Returns the information whether the vehicle is fully controlled via TraCI.
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
Representation of a vehicle.
static double naviDegree(const double angle)
const MSRoute & getRoute() const
Returns the current route.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static void write(OutputDevice &of, SUMOTime timestep, bool elevation)
Writes the position and the angle of each vehicle into the given device.
static OptionsCont & getOptions()
Retrieves the options.
A device which collects info on the vehicle trip (mainly on departure and arrival)
SumoXMLTag
Numbers representing SUMO-XML - element names.
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.
MSTransportableDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
static void writeTransportable(OutputDevice &of, const MSEdge *e, MSTransportable *p, SumoXMLTag tag, bool useGeo, bool elevation)
write transportable
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double getPositionOnLane() const
Get the vehicle's position along the lane.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
virtual double getSlope() const =0
Returns the slope of the road at vehicle's position.
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)
int getSignals() const
Returns the signals.
A road/street connecting two junctions.
Position getPosition(const double) const
Return current position (x/y, cartesian)
trigger: the time of the step
SUMOTime string2time(const std::string &r)
virtual double getEdgePos() const
Return the position on the edge.
MSLane * getLane() const
Returns the lane the vehicle is on.
A device which collects info on the vehicle trip (mainly on departure and arrival)
MSEdge & getEdge() const
Returns the lane's edge.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
virtual double getSpeed() const
the current speed of the transportable
int getRoutePosition() const
std::vector< MSEdge * > MSEdgeVector
const std::string & getID() const
returns the id of the transportable
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
The class responsible for building and deletion of vehicles.
Stores edges and lanes, performs moving of vehicle.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
MSEdgeControl & getEdgeControl()
Returns the edge control.
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes....
const std::string & getID() const
Returns the id.
virtual double getAngle() const
return the current angle of the transportable
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const MSEdgeVector & getEdges() const
Returns loaded edges.
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
virtual double getSpeed() const =0
Returns the vehicle's current speed.
Representation of a vehicle in the micro simulation.