71#define SPEEDMODE_DEFAULT 31
72#define LANECHANGEMODE_DEFAULT 1621
84#pragma warning(disable: 4355)
88 MSVehicle(pars, route, type, speedFactor),
119 ret->
mkItem(
TL(
"position [m]"),
true,
121 ret->
mkItem(
TL(
"lateral offset [m]"),
true,
123 ret->
mkItem(
TL(
"speed [m/s]"),
true,
125 ret->
mkItem(
TL(
"lateral speed [m/s]"),
true,
127 ret->
mkItem(
TL(
"acceleration [m/s^2]"),
true,
129 ret->
mkItem(
TL(
"angle [degree]"),
true,
131 ret->
mkItem(
TL(
"slope [degree]"),
true,
133 ret->
mkItem(
TL(
"speed factor"),
true,
135 ret->
mkItem(
TL(
"time gap on lane [s]"),
true,
137 ret->
mkItem(
TL(
"waiting time [s]"),
true,
141 ret->
mkItem(
TL(
"time since startup [s]"),
true,
143 ret->
mkItem(
TL(
"time loss [s]"),
true,
147 ret->
mkItem(
TL(
"last lane change [s]"),
true,
151 ret->
mkItem(
TL(
"odometer [m]"),
true,
153 if (
getParameter().repetitionNumber < std::numeric_limits<long long int>::max()) {
177 ret->
mkItem(
TL(
"fuel [mg/s]"),
true,
179 ret->
mkItem(
TL(
"electricity [Wh/s]"),
true,
181 ret->
mkItem(
TL(
"noise (Harmonoise) [dB]"),
true,
203 if (hasBattery || isElecHybrid) {
204 ret->
mkItem(
TL(
"present state of charge [Wh]"),
true,
208 ret->
mkItem(
TL(
"relative state of charge (SoC) [-]"),
true,
210 ret->
mkItem(
TL(
"current timestep charge [Wh]"),
true,
212 ret->
mkItem(
TL(
"maximum charge rate [W]"),
true,
216 ret->
mkItem(
TL(
"present electric current [A]"),
true,
290 if (align2 != align) {
291 align = align2 +
" (default: " + align +
")";
298 glTranslated(0, 0,
getType() + .2);
300 if ((*i).myLink ==
nullptr) {
303 MSLink* link = (*i).myLink;
305 if (via !=
nullptr) {
307 if ((*i).mySetRequest) {
312 const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
322 glTranslated(0, 0,
getType() - .2);
332 if (exaggeration == 0) {
340 const int seatsPerCarriage = (int)ceil(
getVType().
getPersonCapacity() / (numCarriages - firstPassengerCarriage - noPersonsBackCarriages));
345 if (requiredSeats > 0) {
348 if (requiredPositions > 0) {
352 const double xCornerCut = 0.3 * exaggeration;
357 const std::vector<MSTrainHelper::Carriage*>& carriages = trainHelper.
getCarriages();
358 for (
int i = 0; i < numCarriages; ++i) {
359 front = carriages[i]->front;
360 back = carriages[i]->back;
365 const double drawnCarriageLength = front.
distanceTo2D(back);
366 angle = atan2((front.
x() - back.
x()), (back.
y() - front.
y())) * (double) 180.0 / (
double)
M_PI;
368 const bool reversed = trainHelper.
isReversed();
370 if (i <= numCarriages - firstPassengerCarriage) {
373 if (i <= numCarriages - firstContainerCarriage) {
377 if (i >= firstPassengerCarriage) {
380 if (i >= firstContainerCarriage) {
387 glTranslated(front.
x(), front.
y(), front.
z() + 1);
389 glTranslated(front.
x(), front.
y(),
getType());
391 glRotated(angle, 0, 0, 1);
397 const int carIndex = trainHelper.
isReversed() ? numCarriages - i : i;
409 glScaled(1, curCLength / 2.5, 1);
425 glBegin(GL_TRIANGLE_FAN);
426 glVertex2d(-halfWidth + xCornerCut, 0);
427 glVertex2d(-halfWidth, yCornerCut);
428 glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
429 glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
430 glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
431 glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
432 glVertex2d(halfWidth, yCornerCut);
433 glVertex2d(halfWidth - xCornerCut, 0);
437 glTranslated(0, 0, 0.1);
439 glBegin(GL_TRIANGLE_FAN);
441 glVertex2d(-halfWidth + xCornerCut, yCornerCut);
442 glVertex2d(-halfWidth + 2 * xCornerCut, 3 * yCornerCut);
443 glVertex2d(halfWidth - 2 * xCornerCut, 3 * yCornerCut);
444 glVertex2d(halfWidth - xCornerCut, yCornerCut);
446 glVertex2d(-halfWidth + 2 * xCornerCut, yCornerCut);
447 glVertex2d(-halfWidth + xCornerCut, 3 * yCornerCut);
448 glVertex2d(halfWidth - xCornerCut, 3 * yCornerCut);
449 glVertex2d(halfWidth - 2 * xCornerCut, yCornerCut);
452 glTranslated(0, 0, -0.1);
462 glTranslated(front.
x(), front.
y(), front.
z() + 1);
464 glTranslated(front.
x(), front.
y(),
getType());
466 glRotated(angle, 0, 0, 1);
474 glTranslated(front.
x(), front.
y(),
getType());
476 glRotated(degAngle, 0, 0, 1);
486#define BLINKER_POS_FRONT .5
487#define BLINKER_POS_BACK .5
491 glColor3d(1.f, .8f, 0);
527 glColor3f(1.f, .2f, 0);
530 glTranslated(0, length, -0.1);
547 glTranslated(0, 2.5, .5);
557 switch (activeScheme) {
584 return getEmissions<PollutantsInterface::CO2>();
586 return getEmissions<PollutantsInterface::CO>();
588 return getEmissions<PollutantsInterface::PM_X>();
590 return getEmissions<PollutantsInterface::NO_X>();
592 return getEmissions<PollutantsInterface::HC>();
594 return getEmissions<PollutantsInterface::FUEL>();
610 return getEmissions<PollutantsInterface::ELEC>();
636 WRITE_WARNINGF(
TL(
"Vehicle parameter '%' key '%' is not a number for vehicle '%'."),
649 std::vector<std::vector<MSVehicle::LaneQ> > bestLanes =
myBestLanes;
651 for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
652 std::vector<MSVehicle::LaneQ>& lanes = *j;
655 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
656 gmax =
MAX2((*i).length, gmax);
657 rmax =
MAX2((*i).occupation, rmax);
659 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
661 double g = (*i).
length / gmax;
662 double r = (*i).occupation / rmax;
664 double width = 0.5 / (1 + abs((*i).bestLaneOffset));
688 int bestLaneIndex = (r ==
myRoute ? 0 : (int)bestLaneConts.size());
689 std::map<const MSLane*, int> repeatLane;
691 const GUILane* prevLane =
nullptr;
692 int reversalIndex = 0;
693 const int indexDigits = (int)
toString(r->size()).size();
702 for (; i != r->end(); ++i) {
704 if (bestLaneIndex < (
int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
705 lane =
static_cast<GUILane*
>(bestLaneConts[bestLaneIndex]);
708 const std::vector<MSLane*>* allowed = (*i)->allowedLanes(
getVClass());
709 if (allowed !=
nullptr && allowed->size() != 0) {
710 lane =
static_cast<GUILane*
>((*allowed)[0]);
712 lane =
static_cast<GUILane*
>((*i)->getLanes()[0]);
717 if (prevLane !=
nullptr && lane->
getBidiLane() == prevLane) {
719 std::string label =
"reverse:" +
toString(reversalIndex++);
730 (laneAngle >= -0.25 *
M_PI && laneAngle < 0.75 *
M_PI ? 1 : -1) * 0.4 * indexDigits * textSize, 0);
736 if (noLoop && i != start && (*i) == (*start)) {
754 std::string result =
"";
760 return "next: " +
myStops.front().getDescription();
764 if (
myStops.front().pars.triggered) {
765 result +=
", triggered";
767 if (
myStops.front().pars.containerTriggered) {
768 result +=
", containerTriggered";
770 if (
myStops.front().pars.collision) {
771 result +=
", collision";
773 if (
myStops.front().pars.arrival != -1) {
776 if (
myStops.front().pars.started != -1) {
779 if (
myStops.front().pars.until != -1) {
782 if (
myStops.front().pars.extension != -1) {
785 if (!
myStops.front().pars.permitted.empty()) {
788 if (
myStops.front().pars.actType !=
"") {
789 result +=
", actType=" +
myStops.front().pars.actType;
801 std::cout <<
SIMTIME <<
" selectBlockingFoes veh=" <<
getID() <<
" dist=" << dist <<
" numLinks=" <<
myLFLinkLanes.size() <<
"\n";
805 if (dpi.
myLink ==
nullptr) {
810 std::vector<const MSPerson*> blockingPersons;
819 std::cout <<
" closed due to:\n";
820 for (
const auto& item : blockingFoes) {
821 std::cout <<
" " << item->getID() <<
"\n";
827 if (parallelLink !=
nullptr) {
831 const bool isShadowOpen =
840 for (
const auto& item : blockingFoes) {
841 std::cout <<
" " << item->getID() <<
"\n";
847 for (
const auto& item : blockingFoes) {
848 if (item->isVehicle()) {
858 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
861 if (leader !=
nullptr) {
862 if (
isLeader(dpi.
myLink, leader, it->vehAndGap.second) || it->inTheWay()) {
865 std::cout <<
" linkLeader=" << leader->
getID() <<
"\n";
869 for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
871 if (foe !=
nullptr) {
887 if (view !=
nullptr) {
909 for (
int i = 0; i < (int)sublaneSides.size(); ++i) {
910 if (sublaneSides[i] > rightSide) {
911 return MAX2(i - 1, 0);
914 return (
int)sublaneSides.size() - 1;
921 for (
int i = (
int)sublaneSides.size() - 1; i >= 0; --i) {
922 if (sublaneSides[i] < leftSide) {
968 std::vector<std::string> result;
972 result.push_back(dw->
getID());
1004 std::string line =
"";
1005 int destinations = 0;
1008 if (!it->reached && destinations < 2 && it->busstop !=
nullptr) {
1009 line += it->busstop->getID();
1012 if (it->busstop == busStop) {
1013 it->duration = finalDuration;
1018 it->duration =
MIN2(it->duration, intermediateDuration);
1021 if (destinations < 2) {
1022 line += busStop->
getID();
1043 std::string errorMsg;
1065 if (
myStops.begin()->parkingarea !=
nullptr) {
1066 return myStops.begin()->parkingarea->getVehiclePosition(*
this);
1089 if (
myStops.begin()->parkingarea !=
nullptr) {
1090 return myStops.begin()->parkingarea->getVehicleAngle(*
this);
1099 double result = (p1 != p2 ? p2.
angleTo2D(p1) :
GUISelectedStorage gSelected
A global holder of selected objects.
#define BLINKER_POS_FRONT
#define LANECHANGEMODE_DEFAULT
#define SPEEDMODE_DEFAULT
void drawAction_drawBlinker(double dir, double length)
std::vector< const MSEdge * > ConstMSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
#define WRITE_WARNINGF(...)
std::shared_ptr< const MSRoute > ConstMSRoutePtr
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
const long long int VTYPEPARS_ACTIONSTEPLENGTH_SET
@ GIVEN
The alignment as offset is given.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a (exclusive) railway edge.
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ RAIL_CAR
render as a (city) rail without locomotive
@ TRUCK_1TRAILER
render as a transport vehicle with one trailer
@ TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
SumoXMLTag
Numbers representing SUMO-XML - element names.
LaneChangeAction
The state of a vehicle's lane-change behavior.
int gPrecision
the precision for floating point outputs
bool gDebugFlag1
global utility flags for debugging
const double SUMO_const_laneWidth
const double SUMO_const_waitingContainerWidth
const double SUMO_const_waitingPersonWidth
std::string joinToStringSorting(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0)
static void popMatrix()
pop matrix
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 RGBColor getColor()
gets the gl-color
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void pushMatrix()
push matrix
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 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 successful
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1, bool isStopped=false, bool amReversed=false)
draw vehicle as a polygon
A MSVehicle extended by some values for usage within the gui.
int getNumContainers() const
return the number of passengers
void drawParkingInfo(const GUIVisualizationSettings &s) const
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
double getScaleValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the size multiplier value according to the current scheme index
void drawChargingInfo(const GUIVisualizationSettings &s) const
@ VO_DRAW_OUTSIDE_NETWORK
draw vehicle outside the road network
Seats myContainerPositions
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
double getNaviDegree() const
return the current angle in navigational degrees
void computeSeats(const Position &front, const Position &back, double seatOffset, int maxSeats, double exaggeration, int &requiredSeats, Seats &into, double extraOffset=0) const
add seats to mySeatPositions and update requiredSeats
int getNumPassengers() const
return the number of passengers
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
Seats mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
void cleanupOnDestruction()
to be called by child class to ensure cleanup in correct order
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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
GUISUMOAbstractView * getActiveView() const
get the active view or 0
static GUIMainWindow * getInstance()
get instance
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.
T getColor(const double value) const
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
void deselect(GUIGlID id)
Deselects the object with the given id.
A MSVehicle extended by some values for usage within the gui.
void drawAction_drawVehicleBlueLight() const override
int getLeftSublaneOnEdge() const
Position getVisualPosition(bool s2, const double offset=0) const override
Return current position taking into account secondary shape.
std::string getDynamicAlignment() const
return the current lateral alignment as string
bool isSelected() const override
whether this vehicle is selected in the GUI
void drawOutsideNetwork(bool add) override
register vehicle for drawing while outside the network
double getLastLaneChangeOffset() const override
Returns the time since the last lane change in seconds.
double getAngle() const override
Return current angle.
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
Position getPosition(const double offset=0) const override
Return current position (x/y, cartesian)
void drawBestLanes() const override
Draws the vehicle's best lanes.
void drawAction_drawVehicleBlinker(double length) const override
std::string getBackLaneIDs() const
void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const override
Draws the route.
double getLeftSideOnEdge() const
return left vehicle side on current edge
std::string getStopInfo() const override
retrieve information about the current stop state
std::string getShadowLaneID() const
double getManeuverDist() const
return the lane-change maneuver distance
double getRightSideOnEdge2() const
return right vehicle side on current edge (without argument)
std::string getSpeedMode() const
return the speed mode as bit string
GUIVehicle(SUMOVehicleParameter *pars, ConstMSRoutePtr route, MSVehicleType *type, const double speedFactor)
Constructor.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
void rerouteDRTStop(MSStoppingPlace *busStop)
handle route to accomodate to given stop
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const override
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
std::string getLCStateRight() const
return the lanechange state
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, double scaledLength, bool asImage) const override
draws the given guiShape with distinct carriages/modules
std::string getLaneID() const
return vehicle lane id
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const override
std::string getTargetLaneID() const
std::string getLCStateLeft() const
void selectBlockingFoes() const override
adds the blocking foes to the current selection
double getVisualAngle(bool s2) const override
Returns the vehicle's direction in radians taking into account secondary shape.
std::string getDriveWays() const
std::string getLCStateCenter() const
std::string getLaneChangeMode() const
return the lane change mode as bit string
Stores the information about how to visualize structures.
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
static const double MISSING_DATA
bool trueZ
drawl all objects according to their z data
GUIVisualizationTextSettings vehicleValue
int vehicleQuality
The quality of vehicle drawing.
bool gaming
whether the application is in gaming mode or not
std::string vehicleParam
key for coloring by vehicle parameter
GUIScaler vehicleScaler
The size scaling settings for vehicles.
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
bool drawReversed
Whether to draw reversed vehicles in their reversed state.
bool showRouteIndex
Information whether the route index should be shown.
double angle
The current view rotation angle.
double getManeuverDist() const
Returns the remaining unblocked distance for the current maneuver. (only used by sublane model)
MSLane * getShadowLane() const
Returns the lane the vehicle's shadow is on during continuous/sublane lane change.
int getShadowDirection() const
return the direction in which the current shadow lane lies
double getSpeedLat() const
return the lateral speed of the current lane change maneuver
double getAngleOffset() const
return the angle offset resulting from lane change and sigma
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
The base class for microscopic and mesoscopic vehicles.
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and technical maximum speed)
bool haveValidStopEdges(bool silent=false) const
check whether all stop.edge MSRouteIterators are valid and in order
std::list< MSStop > myStops
The vehicle's list of stops.
double getImpatience() const
Returns this vehicles impatience.
virtual double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
double getMaxChargeRate() const
Returns the maximum charge rate allowed by the battery in the current time step (W)
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
bool isReversed() const
Returns whether the logical state of the vehicle is reversed - for drawing.
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.
double getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
int getPersonNumber() const
Returns the number of persons.
double getRelativeStateOfCharge() const
Returns actual relative state of charge of battery (-)
MSRouteIterator myCurrEdge
Iterator to current route-edge.
const std::vector< std::string > & getParkingBadges() const
get the valid parking access rights (vehicle settings override vehicle type settings)
ConstMSRoutePtr myRoute
This vehicle's route.
double getWidth() const
Returns the vehicle's width.
double getStateOfCharge() const
Returns actual state of charge of battery (Wh) RICE_CHECK: This may be a misnomer,...
double getDesiredMaxSpeed() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
const MSStop & getNextStop() const
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, MSRouteIterator *searchStart=nullptr)
Adds a stop.
double getChargedEnergy() const
Returns the energy charged to the battery in the current time step (Wh)
int getRoutePosition() const
return index of edge within route
SUMOTime getDepartDelay() const
Returns the depart delay.
double getElecHybridCurrent() const
Returns actual current (A) of ElecHybrid device RICE_CHECK: Is this the current consumed from the ove...
const SUMOVehicleParameter * myParameter
This vehicle's parameter.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
bool reroute(SUMOTime t, const std::string &info, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, const bool onInit=false, const bool withTaz=false, const bool silent=false, const MSEdge *sink=nullptr)
Performs a rerouting using the given router.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
MSDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists, nullptr otherwise.
int getContainerNumber() const
Returns the number of containers.
bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true, std::string *msgReturn=nullptr)
Replaces the current route by the given edges.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
Battery device for electric vehicles.
A device which collects info on the vehicle trip (mainly on departure and arrival)
A device that performs vehicle rerouting based on current edge speeds.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
const std::vector< double > getSubLaneSides() const
Returns the right side offsets of this edge's sublanes.
static bool gModelParkingManoeuver
whether parking simulation includes manoeuver time and any associated lane blocking
static double gLateralResolution
static bool gLefthand
Whether lefthand-drive is being simulated.
static bool gSublane
whether sublane simulation is enabled (sublane model or continuous lanechanging)
static SUMOTime gLaneChangeDuration
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Representation of a lane in the micro simulation.
virtual double getLengthGeometryFactor(bool) const
double getLength() const
Returns the lane's length.
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
MSLane * getBidiLane() const
retrieve bidirectional lane or nullptr
virtual const PositionVector & getShape(bool) const
MSEdge & getEdge() const
Returns the lane's edge.
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
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 SUMOTrafficObject *ego=nullptr, double dist=-1) const
Returns the information whether the link may be passed.
std::vector< LinkLeader > LinkLeaders
MSLink * getParallelLink(int direction) const
return the link that is parallel to this link or 0
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
std::vector< const SUMOTrafficObject * > BlockingFoes
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleRouter & getRouterTT(int rngIndex, const Prohibitions &prohibited={}) const
static MSVehicleRouter & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const Prohibitions &prohibited={})
return the vehicle router instance
A lane area vehicles can halt at.
double getBeginLanePosition() const
Returns the begin position of this stop.
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
A class that helps computing positions of a train's carriages and additional structures.
int getFirstCarriageNo() const
double getFirstCarriageLength() const
const std::vector< Carriage * > & getCarriages() const
double getCarriageLength() const
int getNumCarriages() const
double getUpscaleLength() const
int getFirstPassengerCarriage() const
double getHalfWidth() const
bool isRemoteAffected(SUMOTime t) const
Representation of a vehicle in the micro simulation.
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)
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
double getStopDelay() const
Returns the public transport stop delay in seconds.
bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
bool isActive() const
Returns whether the current simulation step is an action point for the vehicle.
double getTimeLossSeconds() const
Returns the time loss in seconds.
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
SUMOTime getWaitingTime(const bool accumulated=false) const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
double getTimeSinceStartupSeconds() const
MSAbstractLaneChangeModel & getLaneChangeModel()
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
MSAbstractLaneChangeModel * myLaneChangeModel
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
bool signalSet(int which) const
Returns whether the given signal is on.
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the best sequence of lanes to continue the route starting at myLane.
int getBestLaneOffset() const
double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
@ VEH_SIGNAL_BLINKER_RIGHT
Right blinker lights are switched on.
@ VEH_SIGNAL_BRAKELIGHT
The brake lights are on.
@ VEH_SIGNAL_EMERGENCY_BLUE
A blue emergency light is on.
@ VEH_SIGNAL_BLINKER_LEFT
Left blinker lights are switched on.
@ VEH_SIGNAL_BLINKER_EMERGENCY
Blinker lights on both sides are switched on.
const MSLane * getLane() const
Returns the lane the vehicle is on.
bool isLeader(const MSLink *link, const MSVehicle *veh, const double gap) const
whether the given vehicle must be followed at the given junction
Influencer & getInfluencer()
std::vector< std::vector< LaneQ > > myBestLanes
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
double getSlope() const
Returns the slope of the road at vehicle's position in degrees.
double getSpeed() const
Returns the vehicle's current speed.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getPositionOnLane() const
Get the vehicle's position along the lane.
MSLane * myLane
The lane the vehicle is on.
bool hasInfluencer() const
whether the vehicle is individually influenced (via TraCI or special parameters)
DriveItemVector myLFLinkLanes
container for the planned speeds in the current step
The car-following model and parameter.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
const LatAlignmentDefinition & getPreferredLateralAlignment() const
Get vehicle's preferred lateral alignment procedure.
int getPersonCapacity() const
Get this vehicle type's person capacity.
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.
SUMOTime getLoadingDuration(const bool isPerson) const
Get this vehicle type's loading duration.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
double getLength() const
Get vehicle's length [m].
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
double getMass() const
Get this vehicle type's mass.
std::string getImgFile() const
Get this vehicle type's raster model file name.
const SUMOVTypeParameter & getParameter() const
double getPreferredLateralAlignmentOffset() const
Get vehicle's preferred lateral alignment offset (in m from center line)
int getContainerCapacity() const
Get this vehicle type's container capacity.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position (in radians bet...
double y() const
Returns the y-position.
double length() const
Returns the length.
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
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)
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
bool wasSet(long long int what) const
Returns whether the given parameter was set.
std::vector< std::string > carriageImages
Image files for additional carriages.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
SubParams lcParameter
Lane-changing parameter.
SubParams jmParameter
Junction-model parameter.
std::string getManoeuverAngleTimesS() const
Returns myManoeuverAngleTimes as a string for xml output.
Definition of vehicle stop (position and duration)
ParkingType parking
whether the vehicle is removed from the net while stopping
std::string lane
The lane to stop at.
double startPos
The stopping position start.
int parametersSet
Information for the output which parameter were set.
int index
at which position in the stops list
SUMOTime until
The time at which the vehicle may continue its journey.
bool triggered
whether an arriving person lets the vehicle continue
double endPos
The stopping position end.
std::string busstop
(Optional) bus stop if one is assigned to the stop
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
std::string line
The vehicle's line (mainly for public transport)
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static StringBijection< LaneChangeModel > LaneChangeModels
lane change models
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static std::string wrapText(const std::string s, int width)
remove leading and trailing whitespace
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
#define UNUSED_PARAMETER(x)
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Drive process items represent bounds on the safe velocity corresponding to the upcoming links.
double getLeaveSpeed() const