46#pragma warning(disable: 4355)
50 MEVehicle(pars, route, type, speedFactor),
72 ret->
mkItem(
"waiting time [s]",
true,
85 ret->
mkItem(
"odometer [m]",
true,
87 if (
getParameter().repetitionNumber < std::numeric_limits<int>::max()) {
141 ret->
mkItem(
"emission class",
false, PollutantsInterface::getName(
myType->getEmissionClass()));
146 ret->
mkItem(
"desired headway (tau) [s]",
false,
getVehicleType().getCarFollowModel().getHeadwayTime());
148 ret->
mkItem(
"person capacity",
false,
myType->getPersonCapacity());
150 ret->
mkItem(
"container capacity",
false,
myType->getContainerCapacity());
165 switch (activeScheme) {
224 std::map<const MSLane*, int> repeatLane;
226 const int indexDigits = (int)
toString(r->size()).size();
228 for (; i != r->end(); ++i) {
235 (laneAngle >= -0.25 *
M_PI && laneAngle < 0.75 *
M_PI ? 1 : -1) * 0.4 * indexDigits * textSize, 0);
239 if (noLoop && i != start && (*i) == (*start)) {
258 std::string result =
"";
291 const double curTime =
SIMTIME;
292 double vehiclePosition = 0.;
297 const std::vector<MEVehicle*>& queue = segment->
getQueue(queIdx);
298 for (
auto it = queue.rbegin(); it != queue.rend(); ++it) {
302 const double offset = segment->
getLength() * (curTime - entry) / (intendedLeave - entry);
303 if (offset < vehiclePosition) {
304 vehiclePosition = offset;
GUISelectedStorage gSelected
A global holder of selected objects.
ConstMSEdgeVector::const_iterator MSRouteIterator
std::shared_ptr< const MSRoute > ConstMSRoutePtr
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
int gPrecision
the precision for floating point outputs
const double SUMO_const_laneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
void drawParkingInfo(const GUIVisualizationSettings &s) const
GUIBaseVehicle(MSBaseVehicle &vehicle)
double getNaviDegree() const
return the current angle in navigational degrees
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
GUIGlID getGlID() const
Returns the numerical id of the object.
Representation of a lane in the micro simulation (gui-version).
const std::vector< double > & getShapeRotations(bool secondary) const
const PositionVector & getShape(bool secondary) const override
const std::vector< double > & getShapeLengths(bool secondary) const
void selectBlockingFoes() const override
adds the blocking foes to the current selection
Position getVisualPosition(bool s2, const double offset=0) const override
Return current position taking into account secondary shape.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
GUIMEVehicle(SUMOVehicleParameter *pars, ConstMSRoutePtr route, MSVehicleType *type, const double speedFactor)
Constructor.
virtual Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
std::string getStopInfo() const override
retrieve information about the current stop state
~GUIMEVehicle()
destructor
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, double scaledLength, bool asImage) const override
draws the given guiShape with distinct carriages/modules
double getLastLaneChangeOffset() const override
Returns the time since the last lane change in seconds.
void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const override
Draws the route.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
bool isSelected() const override
whether this vehicle is selected in the GUI
std::string getEdgeID() const
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
bool showRouteIndex
Information whether the route index should be shown.
double angle
The current view rotation angle.
A single mesoscopic segment (cell).
static const int PARKING_QUEUE
double getLength() const
Returns the length of the segment in meters.
const std::vector< MEVehicle * > & getQueue(int index) const
Returns the cars in the queue with the given index for visualization.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
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.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian).
MEVehicle(SUMOVehicleParameter *pars, ConstMSRoutePtr route, MSVehicleType *type, const double speedFactor)
Constructor.
double getCurrentStoppingTimeSeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
double getPositionOnLane() const
Get the vehicle's position along the lane.
MESegment * getSegment() const
Returns the current segment the vehicle is on.
int getQueIndex() const
Returns the index of the que the vehicle is in.
int getSegmentIndex() const
double getCurrentLinkPenaltySeconds() const
Returns the delay that is accrued due to option –meso-tls-penalty or –meso-minor-penalty.
double getSpeed() const
Returns the vehicle's estimated speed assuming no delays.
double getEventTimeSeconds() const
Returns the earliest leave time for the current segment.
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and technical maximum speed).
MSBaseVehicle(SUMOVehicleParameter *pars, ConstMSRoutePtr route, MSVehicleType *type, const double speedFactor)
Constructor.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition).
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
const MSVehicleType * myType
This vehicle's type.
double getLength() const
Returns the vehicle's length.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
double getWidth() const
Returns the vehicle's width.
double getDesiredMaxSpeed() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s).
SUMOTime getDepartDelay() const
Returns the depart delay.
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
virtual void unlock() const
release exclusive access to the mesoscopic state
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
virtual void lock() const
grant exclusive access to the mesoscopic state
static bool gLefthand
Whether lefthand-drive is being simulated.
Representation of a lane in the micro simulation.
virtual double getLengthGeometryFactor(bool) const
virtual const PositionVector & getShape(bool) const
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
The car-following model and parameter.
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
const std::string & getID() const
Returns the id.
A point in 2D or 3D with translation and scaling methods.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
double angleAt2D(int pos) const
get angle in certain position of position vector (in radians between -M_PI and M_PI)
Structure representing possible vehicle parameter.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values