 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
78 #pragma warning(disable: 4355)
82 MSVehicle(pars, route, type, speedFactor),
108 ret->
mkItem(
"position [m]",
true,
110 ret->
mkItem(
"lateral offset [m]",
true,
112 ret->
mkItem(
"speed [m/s]",
true,
114 ret->
mkItem(
"lateral speed [m/s]",
true,
116 ret->
mkItem(
"acceleration [m/s^2]",
true,
118 ret->
mkItem(
"angle [degree]",
true,
120 ret->
mkItem(
"slope [degree]",
true,
123 ret->
mkItem(
"time gap on lane [s]",
true,
125 ret->
mkItem(
"waiting time [s]",
true,
129 ret->
mkItem(
"time loss [s]",
true,
131 ret->
mkItem(
"impatience",
true,
133 ret->
mkItem(
"last lane change [s]",
true,
137 if (
getParameter().repetitionNumber < std::numeric_limits<int>::max()) {
148 ret->
mkItem(
"CO2 [mg/s]",
true,
150 ret->
mkItem(
"CO [mg/s]",
true,
152 ret->
mkItem(
"HC [mg/s]",
true,
154 ret->
mkItem(
"NOx [mg/s]",
true,
156 ret->
mkItem(
"PMx [mg/s]",
true,
158 ret->
mkItem(
"fuel [ml/s]",
true,
160 ret->
mkItem(
"electricity [Wh/s]",
true,
162 ret->
mkItem(
"noise (Harmonoise) [dB]",
true,
165 ret->
mkItem(
"persons",
true,
167 ret->
mkItem(
"containers",
true,
193 ret->
mkItem(
"Type Information:",
false,
"");
244 glTranslated(0, 0,
getType() + .2);
246 if ((*i).myLink ==
nullptr) {
249 MSLink* link = (*i).myLink;
251 if (via !=
nullptr) {
253 if ((*i).mySetRequest) {
258 const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
268 glTranslated(0, 0,
getType() - .2);
278 double upscaleLength = exaggeration;
279 if (exaggeration > 1 && totalLength > 5) {
281 upscaleLength =
MAX2(1.0, upscaleLength * (5 + sqrt(totalLength - 5)) / totalLength);
284 if (exaggeration == 0) {
289 const double length = totalLength * upscaleLength;
292 const double xCornerCut = 0.3 * exaggeration;
293 const double yCornerCut = 0.4 * exaggeration;
295 const int numCarriages =
MAX2(1, 1 + (
int)((length - locomotiveLength) / (defaultLength + carriageGap) + 0.5));
296 assert(numCarriages > 0);
297 double carriageLengthWithGap = length / numCarriages;
298 double carriageLength = carriageLengthWithGap - carriageGap;
299 double firstCarriageLength = carriageLength;
300 if (defaultLength != locomotiveLength && numCarriages > 1) {
301 firstCarriageLength = locomotiveLength;
302 carriageLengthWithGap = (length - locomotiveLength) / (numCarriages - 1);
303 carriageLength = carriageLengthWithGap - carriageGap;
305 const int firstPassengerCarriage = defaultLength == locomotiveLength || numCarriages == 1 ? 0 : 1;
307 const int seatsPerCarriage = (int)ceil(totalSeats / (numCarriages - firstPassengerCarriage));
310 int furtherIndex = 0;
313 int backFurtherIndex = furtherIndex;
316 double carriageBackOffset =
myState.
pos() - firstCarriageLength;
319 if (requiredSeats > 0) {
325 double curCLength = firstCarriageLength;
327 for (
int i = 0; i < numCarriages; ++i) {
329 curCLength = carriageLength;
331 while (carriageOffset < 0) {
341 while (carriageBackOffset < 0) {
343 if (prev != backLane) {
347 carriageBackOffset = 0;
357 const double drawnCarriageLength = front.
distanceTo2D(back);
358 angle = atan2((front.
x() - back.
x()), (back.
y() - front.
y())) * (double) 180.0 / (
double)
M_PI;
359 if (i >= firstPassengerCarriage) {
360 computeSeats(front, back, seatsPerCarriage, exaggeration, requiredSeats);
363 glTranslated(front.
x(), front.
y(),
getType());
364 glRotated(angle, 0, 0, 1);
383 glBegin(GL_TRIANGLE_FAN);
384 glVertex2d(-halfWidth + xCornerCut, 0);
385 glVertex2d(-halfWidth, yCornerCut);
386 glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
387 glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
388 glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
389 glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
390 glVertex2d(halfWidth, yCornerCut);
391 glVertex2d(halfWidth - xCornerCut, 0);
397 carriageOffset -= (curCLength + carriageGap);
398 carriageBackOffset -= carriageLengthWithGap;
402 glTranslated(front.
x(), front.
y(),
getType());
403 glRotated(angle, 0, 0, 1);
411 glTranslated(front.
x(), front.
y(),
getType());
413 glRotated(degAngle, 0, 0, 1);
414 glScaled(exaggeration, upscaleLength, 1);
420 #define BLINKER_POS_FRONT .5
421 #define BLINKER_POS_BACK .5
425 glColor3d(1.f, .8f, 0);
461 glColor3f(1.f, .2f, 0);
464 glTranslated(0, length, -0.1);
481 glTranslated(0, 2.5, .5);
491 switch (activeScheme) {
568 std::vector<std::vector<MSVehicle::LaneQ> > bestLanes =
myBestLanes;
570 for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
571 std::vector<MSVehicle::LaneQ>& lanes = *j;
574 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
575 gmax =
MAX2((*i).length, gmax);
576 rmax =
MAX2((*i).occupation, rmax);
578 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
580 double g = (*i).
length / gmax;
581 double r = (*i).occupation / rmax;
583 double width = 0.5 / (1 + abs((*i).bestLaneOffset));
606 int bestLaneIndex = (&r ==
myRoute ? 0 : (int)bestLaneConts.
size());
607 std::map<const MSLane*, int> repeatLane;
608 for (; i != r.
end(); ++i) {
610 if (bestLaneIndex < (
int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
611 lane =
static_cast<GUILane*
>(bestLaneConts[bestLaneIndex]);
614 const std::vector<MSLane*>* allowed = (*i)->allowedLanes(
getVClass());
615 if (allowed !=
nullptr && allowed->size() != 0) {
616 lane =
static_cast<GUILane*
>((*allowed)[0]);
618 lane =
static_cast<GUILane*
>((*i)->getLanes()[0]);
634 std::map<std::pair<const MSLane*, double>,
int> repeat;
638 if (stop.pars.speed > 0) {
639 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
643 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
645 std::string label = stop.reached ?
"stopped" :
"stop " +
toString(stopIndex);
649 if (stop.pars.until >= 0) {
652 if (stop.duration >= 0 || stop.pars.duration > 0) {
654 label +=
" duration:1day+";
656 label +=
" duration:" +
time2string(stop.duration);
659 std::pair<const MSLane*, double> stopPos = std::make_pair(stop.lane, stop.getEndPos(*
this));
679 if (furtherIndex % 2 == 0) {
680 routeIndex -= (furtherIndex + 0) / 2;
681 resultInternal =
false;
683 routeIndex -= (furtherIndex + 1) / 2;
684 resultInternal =
false;
687 if (furtherIndex % 2 != 0) {
688 routeIndex -= (furtherIndex + 1) / 2;
689 resultInternal =
false;
691 routeIndex -= (furtherIndex + 2) / 2;
692 resultInternal =
true;
696 routeIndex -= furtherIndex;
697 resultInternal =
false;
700 if (routeIndex >= 0) {
701 if (resultInternal) {
704 for (
MSLink* link : cand->getLinkCont()) {
705 if (link->getLane() == current) {
706 if (link->getViaLane() !=
nullptr) {
707 return link->getViaLane();
709 return const_cast<MSLane*
>(link->getLaneBefore());
731 std::string result =
"";
737 return "next: " +
myStops.front().getDescription();
741 if (
myStops.front().pars.triggered) {
742 result +=
", triggered";
743 }
else if (
myStops.front().pars.containerTriggered) {
744 result +=
", containerTriggered";
745 }
else if (
myStops.front().collision) {
746 result +=
", collision";
747 }
else if (
myStops.front().pars.until != -1) {
760 std::cout <<
SIMTIME <<
" selectBlockingFoes veh=" <<
getID() <<
" dist=" << dist <<
" numLinks=" <<
myLFLinkLanes.size() <<
"\n";
764 if (dpi.
myLink ==
nullptr) {
769 std::vector<const MSPerson*> blockingPersons;
778 std::cout <<
" closed due to:\n";
779 for (
const auto& item : blockingFoes) {
780 std::cout <<
" " << item->getID() <<
"\n";
786 if (parallelLink !=
nullptr) {
790 const bool isShadowOpen =
799 for (
const auto& item : blockingFoes) {
800 std::cout <<
" " << item->getID() <<
"\n";
806 for (
const auto& item : blockingFoes) {
816 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
819 if (leader !=
nullptr) {
823 std::cout <<
" linkLeader=" << leader->
getID() <<
"\n";
827 for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
829 if (foe !=
nullptr) {
845 if (view !=
nullptr) {
867 for (
int i = 0; i < (int)sublaneSides.size(); ++i) {
868 if (sublaneSides[i] > rightSide) {
869 return MAX2(i - 1, 0);
879 for (
int i = (
int)sublaneSides.size() - 1; i >= 0; --i) {
880 if (sublaneSides[i] < leftSide) {
929 std::string line =
"";
930 int destinations = 0;
933 if (!it->reached && destinations < 2 && it->busstop !=
nullptr) {
934 line += it->busstop->getID();
937 if (it->busstop == busStop) {
938 it->duration = finalDuration;
943 it->duration =
MIN2(it->duration, intermediateDuration);
946 if (destinations < 2) {
947 line += busStop->
getID();
968 std::string errorMsg;
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
The car-following model and parameter.
SUMOTime getBoardingDuration() const
Get this vehicle type's boarding duration.
const MSLane & getLane() const
Returns the lane this stop is located at.
#define UNUSED_PARAMETER(x)
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
@ VEH_SIGNAL_BLINKER_LEFT
Left blinker lights are switched on.
bool isSelected() const
whether this vehicle is selected in the GUI
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
SubParams lcParameter
Lane-changing parameter.
double getLeftSideOnEdge() const
return left vehicle side on current edge
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
const std::string & getID() const
Returns the name of the vehicle type.
int getBestLaneOffset() const
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
A lane area vehicles can halt at.
static RGBColor getColor()
gets the gl-color
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
A window containing a gl-object's parameter.
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
A MSVehicle extended by some values for usage within the gui.
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
void drawAction_drawVehicleBlueLight() const
A device that performs vehicle rerouting based on current edge speeds.
LateralAlignment getPreferredLateralAlignment() const
Get vehicle's preferred lateral alignment.
int getNumPassengers() const
return the number of passengers
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
#define WRITE_WARNING(msg)
int getContainerNumber() const
Returns the number of containers.
Representation of a lane in the micro simulation.
bool isStopped() const
Returns whether the vehicle is at a stop.
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
static bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, const std::string &file, const GUIGlObject *o, const double width, double length)
try to draw vehicle as raster image and return true if sucessful
std::string lane
The lane to stop at.
double getEndLanePosition() const
Returns the end position of this stop.
#define BLINKER_POS_FRONT
std::string getStopInfo() const
retrieve information about the current stop state
@ VEH_SIGNAL_BLINKER_RIGHT
Right blinker lights are switched on.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
int getNumContainers() const
return the number of passengers
double angle
The current view rotation angle.
ConstMSEdgeVector::const_iterator MSRouteIterator
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 drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
bool showRouteIndex
Information whether the route index should be shown.
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
@ VO_DRAW_OUTSIDE_NETWORK
draw vehicle outside the road network
double getTimeLossSeconds() const
Returns the time loss in seconds.
double getBeginLanePosition() const
Returns the begin position of this stop.
void drawRouteHelper(const GUIVisualizationSettings &s, const MSRoute &r, bool future, const RGBColor &col) const
Draws the route.
std::vector< const SUMOVehicle * > BlockingFoes
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
std::string busstop
(Optional) bus stop if one is assigned to the stop
int parametersSet
Information for the output which parameter were set.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
double getRightSideOnEdge2() const
return right vehicle side on current edge (without argument)
bool isParking() const
Returns whether the vehicle is parking.
double getLength() const
Returns the vehicle's length.
void rerouteDRTStop(MSStoppingPlace *busStop)
handle route to accomodate to given stop
SUMOTime getDepartDelay() const
Returns the depart delay.
const MSRoute * myRoute
This vehicle's route.
std::vector< const MSEdge * > ConstMSEdgeVector
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=0)
Adds a stop.
int getRoutePosition() const
return index of edge within route
const ConstMSEdgeVector & getEdges() const
double carriageLength
the length of train carriages and locomotive
@ VEH_SIGNAL_BLINKER_EMERGENCY
Blinker lights on both sides are switched on.
PositionVector mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
double length() const
Returns the length.
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
Structure representing possible vehicle parameter.
GUIVisualizationSizeSettings vehicleSize
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
int getPersonCapacity() const
Get this vehicle type's person capacity.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
bool triggered
whether an arriving person lets the vehicle continue
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getSlope() const
Returns the slope of the road at vehicle's position.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
SumoXMLTag
Numbers representing SUMO-XML - element names.
MSAbstractLaneChangeModel & getLaneChangeModel()
double getManeuverDist() const
return the lane-change maneuver distance
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
double getMaxSpeed() const
Returns the maximum speed.
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
std::string getTargetLaneID() const
static double gLateralResolution
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
void drawAction_drawVehicleBlinker(double length) const
static StringBijection< SumoXMLTag > CarFollowModels
car following models
void drawAction_drawBlinker(double dir, double length)
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
bool wasSet(int what) const
Returns whether the given parameter was set.
std::string line
The vehicle's line (mainly for public transport)
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
GUISUMOAbstractView * getActiveView() const
get the active view or 0
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
int size() const
Returns the number of edges to pass.
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, bool asImage) const
draws the given guiShape with distinct carriages/modules
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
double getPMxEmissions() const
Returns PMx emission of the current state.
void drawOutsideNetwork(bool add)
register vehicle for drawing while outside the network
static GUIMainWindow * getInstance()
double getPositionOnLane() const
Get the vehicle's position along the lane.
const PositionVector & getShape() const
double getImpatience() const
Returns this vehicles impatience.
double getAngle() const
Return current angle.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
LaneChangeAction
The state of a vehicle's lane-change behavior.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
MSLane * getShadowLane() const
Returns the lane the vehicle's shadow is on during continuous/sublane lane change.
double getCOEmissions() const
Returns CO emission of the current state.
SubParams jmParameter
Junction-model parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
SUMOTime until
The time at which the vehicle may continue its journey.
const std::vector< double > & getShapeRotations() const
A MSVehicle extended by some values for usage within the gui.
double getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
bool opened(SUMOTime arrivalTime, double arrivalSpeed, double leaveSpeed, double vehicleLength, double impatience, double decel, SUMOTime waitingTime, double posLat=0, BlockingFoes *collectFoes=nullptr, bool ignoreRed=false, const SUMOVehicle *ego=nullptr) const
Returns the information whether the link may be passed.
void computeSeats(const Position &front, const Position &back, int maxSeats, double exaggeration, int &requiredSeats) const
add seats to mySeatPositions and update requiredSeats
GUIGlID getGlID() const
Returns the numerical id of the object.
std::vector< LinkLeader > LinkLeaders
double getLength() const
Returns the lane's length.
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
const std::vector< double > & getShapeLengths() const
double scale
information about a lane's width (temporary, used for a single view)
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
GUIVisualizationTextSettings vehicleName
std::vector< std::vector< LaneQ > > myBestLanes
static bool gModelParkingManoeuver
whether parking simulation includes manoeuver time and any associated lane blocking
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
std::string getLaneID() const
return vehicle lane id
double getHCEmissions() const
Returns HC emission of the current state.
std::string time2string(SUMOTime t)
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
double getMinGap() const
Get the free space in front of vehicles of this class.
std::list< Stop > myStops
The vehicle's list of stops.
void selectBlockingFoes() const
adds the blocking foes to the current selection
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
A road/street connecting two junctions.
double endPos
The stopping position end.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
double getNOxEmissions() const
Returns NOx emission of the current state.
bool isLeader(const MSLink *link, const MSVehicle *veh) const
whether the given vehicle must be followed at the given junction
MSLane * myLane
The lane the vehicle is on.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model)
double pos() const
Position of this state.
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)
Replaces the current route by the given edges.
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
double getNaviDegree() const
return the current angle in navigational degrees
void drawBestLanes() const
Draws the vehicle's best lanes.
std::string vehicleParam
key for coloring by vehicle parameter
Definition of vehicle stop (position and duration)
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
double startPos
The stopping position start.
MSLane * getLane() const
Returns the lane the vehicle is on.
MSEdge & getEdge() const
Returns the lane's edge.
@ VEH_SIGNAL_EMERGENCY_BLUE
A blue emergency light is on.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
State myState
This Vehicles driving state (pos and speed)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Representation of a lane in the micro simulation (gui-version)
const PositionVector & getShape() const
Returns this lane's shape.
@ VEH_SIGNAL_BRAKELIGHT
The brake lights are on.
bool containerTriggered
whether an arriving container lets the vehicle continue
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double y() const
Returns the y-position.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
int index
at which position in the stops list
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
MSLane * getPreviousLane(MSLane *current, int &furtherIndex) const
double getLength() const
Get vehicle's length [m].
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
GUIVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0)
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
int getPersonNumber() const
Returns the number of persons.
double getLeaveSpeed() const
const SUMOVTypeParameter & getParameter() const
GUISelectedStorage gSelected
A global holder of selected objects.
The base class for microscopic and mesoscopic vehicles.
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
const std::string & getID() const
Returns the name of the vehicle.
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
bool signalSet(int which) const
Returns whether the given signal is on.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getFuelConsumption() const
Returns fuel consumption of the current state.
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
std::string getLCStateRight() const
return the lanechange state
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
double getWidth() const
Returns the lane's width.
double getWidth() const
Returns the vehicle's width.
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
int getShadowDirection() const
return the direction in which the current shadow lane lies
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
int getContainerCapacity() const
Get this vehicle type's container capacity.
bool gDebugFlag1
global utility flags for debugging
int getLeftSublaneOnEdge() const
double getSpeed() const
Returns the vehicle's current speed.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
std::string getShadowLaneID() const
static SUMOTime gLaneChangeDuration
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
Stores the information about how to visualize structures.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
SUMOTime duration
The stopping duration.
void reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false)
Performs a rerouting using the given router.
MSVehicleType * myType
This vehicle's type.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
bool parking
whether the vehicle is removed from the net while stopping
bool gaming
whether the application is in gaming mode or not
const std::string & getID() const
Returns the id.
double getCO2Emissions() const
Returns CO2 emission of the current state.
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const
Definition of vehicle stop (position and duration)
Drive process items represent bounds on the safe velocity corresponding to the upcoming links.
std::string getLCStateLeft() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
SUMOTime getLoadingDuration() const
Get this vehicle type's loading duration.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
std::string getManoeuverAngleTimesS() const
Returns myManoeuverAngleTimes as a string for xml output.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Representation of a vehicle in the micro simulation.