56 if ((period > 0 && (timestep - begin) % period != 0) || timestep < begin) {
68 std::set<const Named*> inRadius;
152 const std::pair<const MSVehicle* const, double> leader = microVeh->
getLeader(maxLeaderDistance);
153 if (leader.first !=
nullptr) {
155 return leader.first->getID();
158 return leader.first->getSpeed();
175 for (
const std::string& key : params) {
177 const std::string value =
static_cast<const MSBaseVehicle*
>(veh)->getPrefixedParameter(key, error);
183 const double arrivalDelay =
static_cast<const MSBaseVehicle*
>(veh)->getStopArrivalDelay();
233 for (
const MSTransportable*
const person : e->getSortedPersons(timestep)) {
278 const bool filter,
const bool shapeFilter,
const bool inRadius,
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ SUMO_TAG_VEHICLE
description of a vehicle
std::bitset< 96 > SumoXMLAttrMask
@ SUMO_ATTR_ACCELERATION_LAT
@ SUMO_ATTR_TIME
trigger: the time of the step
int gPrecision
the precision for floating point outputs
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static double naviDegree(const double angle)
A vehicle from the mesoscopic point of view.
double getLastEntryTimeSeconds() const
Returns the entry time for the current segment.
double getBlockTimeSeconds() const
Returns the time at which the vehicle was blocked on the current segment.
int getQueIndex() const
Returns the index of the que the vehicle is in.
int getSegmentIndex() const
double getEventTimeSeconds() const
Returns the earliest leave time for the current segment.
SUMOTime getBlockTime() const
Returns the time at which the vehicle was blocked.
double getAccelerationLat() const
return the lateral speed of the current lane change maneuver
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
The base class for microscopic and mesoscopic vehicles.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
const MSRoute & getRoute() const
Returns the current route.
int getRoutePosition() const
return index of edge within route
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
A device which collects info on the vehicle trip (mainly on departure and arrival)
static const std::set< const MSEdge * > & getEdgeFilter()
static SUMOTime getPeriod()
static double getRadius()
static SUMOTime getBegin()
static double getMaxLeaderDistance()
static void initOnce()
initialize edge filter and attribute mask (once)
static bool hasShapeFilter()
is there a filter based on shapes?
static bool shapeFilter(const SUMOTrafficObject *veh)
checks if in polygon
static const SumoXMLAttrMask & getWrittenAttributes()
static const std::vector< std::string > & getParamsToWrite()
const MSEdgeVector & getEdges() const
Returns loaded edges.
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getDistanceAt(double pos) const
Returns the kilometrage/mileage at the given offset along the edge.
static void writeEmissions(OutputDevice &of, const MSBaseVehicle *const veh, const bool includeType, const SumoXMLAttrMask &mask)
Writes emission values for a single vehicle into the given device.
static void write(OutputDevice &of, const SUMOTime timestep, const SumoXMLTag tag=SUMO_TAG_NOTHING)
Writes the position and the angle of each vehicle into the given device.
static bool isVisible(const SUMOVehicle *veh)
static void writeTransportable(OutputDevice &of, const MSEdge *const e, const MSTransportable *const p, const SUMOVehicle *const v, const bool filter, const bool shapeFilter, const bool inRadius, const SumoXMLTag tag, const bool useGeo, const SumoXMLAttrMask mask)
write transportable
static bool hasOwnOutput(const SUMOVehicle *veh, bool filter, bool shapeFilter, bool isInRadius=false)
MSEdge & getEdge() const
Returns the lane's edge.
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getContainerControl()
Returns the container control.
bool hasContainers() const
Returns whether containers are simulated.
bool hasPersons() const
Returns whether persons are simulated.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
MSEdgeControl & getEdgeControl()
Returns the edge control.
double getDistanceBetween(double fromPos, double toPos, const MSLane *fromLane, const MSLane *toLane, int routePosition=0) const
Compute the distance between 2 given edges on this route, optionally including the length of internal...
bool hasTransportables() const
checks whether any transportable waits to finish her plan
A device which collects info on the vehicle trip (mainly on departure and arrival)
virtual double getEdgePos() const
Return the position on the edge.
virtual double getAngle() const
return the current angle of the transportable
virtual double getSpeed() const
the current speed of the transportable
Position getPosition(const double) const
Return current position (x/y, cartesian)
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
const MSEdge * getEdge() const
Returns the current edge.
MSDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or nullptr if not.
The class responsible for building and deletion of vehicles.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
Representation of a vehicle in the micro simulation.
MSAbstractLaneChangeModel & getLaneChangeModel()
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
int getSignals() const
Returns the signals.
const MSLane * getLane() const
Returns the lane the vehicle is on.
std::pair< const MSVehicle *const, double > getLeader(double dist=0, bool considerFoes=true) const
Returns the leader of the vehicle looking for a fixed distance.
const std::string & getID() const
Returns the name of the vehicle type.
double getMinGap() const
Get the free space in front of vehicles of this class.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
OutputDevice & writeOptionalAttr(const SumoXMLAttr attr, const T &val, const SumoXMLAttrMask &attributeMask, const bool isNull=false)
writes a named attribute unless filtered
OutputDevice & writeFuncAttr(const SumoXMLAttr attr, const Func &valFunc, const SumoXMLAttrMask &attributeMask, const bool isNull=false)
OutputDevice & writeTime(const SumoXMLAttr attr, const SUMOTime val)
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual double getSlope() const =0
Returns the slope of the road at object's position in degrees.
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual MSDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or nullptr if not.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual const std::vector< MSTransportable * > & getContainers() const =0
retrieve riding containers
virtual double getLateralPositionOnLane() const =0
Get the vehicle's lateral position on the lane.
virtual double getOdometer() const =0
Returns the distance that was already driven by this vehicle.
virtual bool isOnRoad() const =0
Returns the information whether the vehicle is on a road (is simulated)
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
virtual bool isParking() const =0
Returns the information whether the vehicle is parked.
virtual bool isRemoteControlled() const =0
Returns the information whether the vehicle is fully controlled via TraCI.
virtual double getAngle() const =0
Get the vehicle's angle.
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
static void collectObjectsInRange(int domain, const PositionVector &shape, double range, std::set< const Named * > &into)
TRACI_CONST int CMD_GET_VEHICLE_VARIABLE
TRACI_CONST int CMD_GET_PERSON_VARIABLE