66 #define SPEEDMODE_DEFAULT 31
67 #define LANECHANGEMODE_DEFAULT 1621
83 #pragma warning(disable: 4355)
87 MSVehicle(pars, route, type, speedFactor),
115 ret->
mkItem(
"position [m]",
true,
117 ret->
mkItem(
"lateral offset [m]",
true,
119 ret->
mkItem(
"speed [m/s]",
true,
121 ret->
mkItem(
"lateral speed [m/s]",
true,
123 ret->
mkItem(
"acceleration [m/s^2]",
true,
125 ret->
mkItem(
"angle [degree]",
true,
127 ret->
mkItem(
"slope [degree]",
true,
130 ret->
mkItem(
"time gap on lane [s]",
true,
132 ret->
mkItem(
"waiting time [s]",
true,
136 ret->
mkItem(
"time loss [s]",
true,
138 ret->
mkItem(
"impatience",
true,
140 ret->
mkItem(
"last lane change [s]",
true,
144 ret->
mkItem(
"odometer [m]",
true,
146 if (
getParameter().repetitionNumber < std::numeric_limits<int>::max()) {
157 ret->
mkItem(
"CO2 [mg/s]",
true,
159 ret->
mkItem(
"CO [mg/s]",
true,
161 ret->
mkItem(
"HC [mg/s]",
true,
163 ret->
mkItem(
"NOx [mg/s]",
true,
165 ret->
mkItem(
"PMx [mg/s]",
true,
167 ret->
mkItem(
"fuel [ml/s]",
true,
169 ret->
mkItem(
"electricity [Wh/s]",
true,
171 ret->
mkItem(
"noise (Harmonoise) [dB]",
true,
174 ret->
mkItem(
"persons",
true,
176 ret->
mkItem(
"containers",
true,
190 ret->
mkItem(
"actual state of charge [Wh]",
true,
192 ret->
mkItem(
"actual electric current [A]",
true,
213 ret->
mkItem(
"Type Information:",
false,
"");
264 glTranslated(0, 0,
getType() + .2);
266 if ((*i).myLink ==
nullptr) {
269 MSLink* link = (*i).myLink;
271 if (via !=
nullptr) {
273 if ((*i).mySetRequest) {
278 const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
288 glTranslated(0, 0,
getType() - .2);
298 double upscaleLength = exaggeration;
299 if (exaggeration > 1 && totalLength > 5) {
302 const double shrinkFactor =
MIN2(widthLengthFactor, sqrt(upscaleLength));
303 upscaleLength /= shrinkFactor;
306 if (exaggeration == 0) {
311 const double length = totalLength * upscaleLength;
314 const double xCornerCut = 0.3 * exaggeration;
315 const double yCornerCut = 0.4 * exaggeration;
317 const int numCarriages =
MAX2(1, 1 + (
int)((length - locomotiveLength) / (defaultLength + carriageGap) + 0.5));
318 assert(numCarriages > 0);
319 double carriageLengthWithGap = length / numCarriages;
320 double carriageLength = carriageLengthWithGap - carriageGap;
321 double firstCarriageLength = carriageLength;
322 if (defaultLength != locomotiveLength && numCarriages > 1) {
323 firstCarriageLength = locomotiveLength;
324 carriageLengthWithGap = (length - locomotiveLength) / (numCarriages - 1);
325 carriageLength = carriageLengthWithGap - carriageGap;
327 const int firstPassengerCarriage = defaultLength == locomotiveLength || numCarriages == 1 || (
getVClass() &
SVC_RAIL_CLASSES) == 0 ? 0 : 1;
333 int furtherIndex = 0;
336 int backFurtherIndex = furtherIndex;
339 double carriageBackOffset =
myState.
pos() - firstCarriageLength;
343 if (requiredSeats > 0) {
346 if (requiredPositions > 0) {
355 double curCLength = firstCarriageLength;
357 for (
int i = 0; i < numCarriages; ++i) {
359 curCLength = carriageLength;
361 while (carriageOffset < 0) {
371 while (carriageBackOffset < 0) {
373 if (prev != backLane) {
377 carriageBackOffset = 0;
387 const double drawnCarriageLength = front.
distanceTo2D(back);
388 angle = atan2((front.
x() - back.
x()), (back.
y() - front.
y())) * (double) 180.0 / (
double)
M_PI;
389 if (i >= firstPassengerCarriage) {
392 if (i >= firstContainerCarriage) {
396 glTranslated(front.
x(), front.
y(),
getType());
397 glRotated(angle, 0, 0, 1);
416 glBegin(GL_TRIANGLE_FAN);
417 glVertex2d(-halfWidth + xCornerCut, 0);
418 glVertex2d(-halfWidth, yCornerCut);
419 glVertex2d(-halfWidth, drawnCarriageLength - yCornerCut);
420 glVertex2d(-halfWidth + xCornerCut, drawnCarriageLength);
421 glVertex2d(halfWidth - xCornerCut, drawnCarriageLength);
422 glVertex2d(halfWidth, drawnCarriageLength - yCornerCut);
423 glVertex2d(halfWidth, yCornerCut);
424 glVertex2d(halfWidth - xCornerCut, 0);
430 carriageOffset -= (curCLength + carriageGap);
431 carriageBackOffset -= carriageLengthWithGap;
435 glTranslated(front.
x(), front.
y(),
getType());
436 glRotated(angle, 0, 0, 1);
444 glTranslated(front.
x(), front.
y(),
getType());
446 glRotated(degAngle, 0, 0, 1);
447 glScaled(exaggeration, upscaleLength, 1);
456 #define BLINKER_POS_FRONT .5
457 #define BLINKER_POS_BACK .5
461 glColor3d(1.f, .8f, 0);
497 glColor3f(1.f, .2f, 0);
500 glTranslated(0, length, -0.1);
517 glTranslated(0, 2.5, .5);
527 switch (activeScheme) {
611 std::vector<std::vector<MSVehicle::LaneQ> > bestLanes =
myBestLanes;
613 for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
614 std::vector<MSVehicle::LaneQ>& lanes = *j;
617 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
618 gmax =
MAX2((*i).length, gmax);
619 rmax =
MAX2((*i).occupation, rmax);
621 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
623 double g = (*i).
length / gmax;
624 double r = (*i).occupation / rmax;
626 double width = 0.5 / (1 + abs((*i).bestLaneOffset));
650 int bestLaneIndex = (&r ==
myRoute ? 0 : (int)bestLaneConts.
size());
651 std::map<const MSLane*, int> repeatLane;
653 const GUILane* prevLane =
nullptr;
654 int reversalIndex = 0;
656 for (; i != r.
end(); ++i) {
658 if (bestLaneIndex < (
int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
659 lane =
static_cast<GUILane*
>(bestLaneConts[bestLaneIndex]);
662 const std::vector<MSLane*>* allowed = (*i)->allowedLanes(
getVClass());
663 if (allowed !=
nullptr && allowed->size() != 0) {
664 lane =
static_cast<GUILane*
>((*allowed)[0]);
666 lane =
static_cast<GUILane*
>((*i)->getLanes()[0]);
671 if (prevLane !=
nullptr && lane->
getBidiLane() == prevLane) {
673 std::string label =
"reverse:" +
toString(reversalIndex++);
681 (laneAngle >= -0.25 *
M_PI && laneAngle < 0.75 *
M_PI ? 1 : -1) * 0.4 * indexDigits * textSize, 0);
687 if (noLoop && i != start && (*i) == (*start)) {
693 std::map<std::pair<const MSLane*, double>,
int> repeat;
697 if (stop.pars.speed > 0) {
698 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
702 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
705 std::string label = stop.pars.speed > 0 ?
"waypoint" : (stop.reached ?
"stopped" :
"stop " +
toString(stopIndex));
710 label +=
" triggered:";
711 if (stop.triggered) {
713 if (stop.numExpectedPerson > 0) {
714 label +=
"(" +
toString(stop.numExpectedPerson) +
")";
717 if (stop.containerTriggered) {
718 label +=
"container";
719 if (stop.numExpectedContainer > 0) {
720 label +=
"(" +
toString(stop.numExpectedContainer) +
")";
723 if (stop.joinTriggered) {
725 if (stop.pars.join !=
"") {
726 label +=
"(" + stop.pars.join +
")";
730 if (stop.pars.until >= 0) {
733 if (stop.duration >= 0 || stop.pars.duration > 0) {
735 label +=
" duration:1day+";
737 label +=
" duration:" +
time2string(stop.duration);
740 if (stop.pars.speed > 0) {
741 label +=
" speed:" +
toString(stop.pars.speed);
743 std::pair<const MSLane*, double> stopPos = std::make_pair(stop.lane, stopLanePos);
746 if (noLoop && repeat[stopPos] > 0) {
767 if (furtherIndex % 2 == 0) {
768 routeIndex -= (furtherIndex + 0) / 2;
769 resultInternal =
false;
771 routeIndex -= (furtherIndex + 1) / 2;
772 resultInternal =
false;
775 if (furtherIndex % 2 != 0) {
776 routeIndex -= (furtherIndex + 1) / 2;
777 resultInternal =
false;
779 routeIndex -= (furtherIndex + 2) / 2;
780 resultInternal =
true;
784 routeIndex -= furtherIndex;
785 resultInternal =
false;
788 if (routeIndex >= 0) {
789 if (resultInternal) {
792 for (
MSLink* link : cand->getLinkCont()) {
793 if (link->getLane() == current) {
794 if (link->getViaLane() !=
nullptr) {
795 return link->getViaLane();
797 return const_cast<MSLane*
>(link->getLaneBefore());
819 std::string result =
"";
825 return "next: " +
myStops.front().getDescription();
829 if (
myStops.front().pars.triggered) {
830 result +=
", triggered";
831 }
else if (
myStops.front().pars.containerTriggered) {
832 result +=
", containerTriggered";
833 }
else if (
myStops.front().collision) {
834 result +=
", collision";
835 }
else if (
myStops.front().pars.until != -1) {
848 std::cout <<
SIMTIME <<
" selectBlockingFoes veh=" <<
getID() <<
" dist=" << dist <<
" numLinks=" <<
myLFLinkLanes.size() <<
"\n";
852 if (dpi.
myLink ==
nullptr) {
857 std::vector<const MSPerson*> blockingPersons;
866 std::cout <<
" closed due to:\n";
867 for (
const auto& item : blockingFoes) {
868 std::cout <<
" " << item->getID() <<
"\n";
874 if (parallelLink !=
nullptr) {
878 const bool isShadowOpen =
887 for (
const auto& item : blockingFoes) {
888 std::cout <<
" " << item->getID() <<
"\n";
894 for (
const auto& item : blockingFoes) {
904 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
907 if (leader !=
nullptr) {
911 std::cout <<
" linkLeader=" << leader->
getID() <<
"\n";
915 for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
917 if (foe !=
nullptr) {
933 if (view !=
nullptr) {
955 for (
int i = 0; i < (int)sublaneSides.size(); ++i) {
956 if (sublaneSides[i] > rightSide) {
957 return MAX2(i - 1, 0);
960 return (
int)sublaneSides.size() - 1;
967 for (
int i = (
int)sublaneSides.size() - 1; i >= 0; --i) {
968 if (sublaneSides[i] < leftSide) {
1037 std::string line =
"";
1038 int destinations = 0;
1041 if (!it->reached && destinations < 2 && it->busstop !=
nullptr) {
1042 line += it->busstop->getID();
1045 if (it->busstop == busStop) {
1046 it->duration = finalDuration;
1051 it->duration =
MIN2(it->duration, intermediateDuration);
1054 if (destinations < 2) {
1055 line += busStop->
getID();
1076 std::string errorMsg;
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_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
const int VTYPEPARS_ACTIONSTEPLENGTH_SET
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVS_TRUCK_SEMITRAILER
render as a semi-trailer transport vehicle ("Sattelschlepper")
@ SVS_RAIL_CAR
render as a (city) rail without locomotive
@ SVS_TRUCK_1TRAILER
render as a transport vehicle with one trailer
SumoXMLTag
Numbers representing SUMO-XML - element names.
LaneChangeAction
The state of a vehicle's lane-change behavior.
bool gDebugFlag1
global utility flags for debugging
const double SUMO_const_laneWidth
#define UNUSED_PARAMETER(x)
const double SUMO_const_waitingContainerWidth
const double SUMO_const_waitingPersonWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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(double width, int steps=8)
Draws a filled circle around (0,0)
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 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_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
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
A MSVehicle extended by some values for usage within the gui.
int getNumContainers() const
return the number of passengers
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
void computeSeats(const Position &front, const Position &back, double seatOffset, int maxSeats, double exaggeration, int &requiredSeats, Seats &into) const
add seats to mySeatPositions and update requiredSeats
@ 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
int getNumPassengers() const
return the number of passengers
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
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.
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 PositionVector & getShape() const
const std::vector< double > & getShapeLengths() const
const std::vector< double > & getShapeRotations() 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.
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.
A MSVehicle extended by some values for usage within the gui.
bool isSelected() const
whether this vehicle is selected in the GUI
int getLeftSublaneOnEdge() const
double getAngle() const
Return current angle.
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
void selectBlockingFoes() const
adds the blocking foes to the current selection
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
void drawBestLanes() const
Draws the vehicle's best lanes.
void drawOutsideNetwork(bool add)
register vehicle for drawing while outside the network
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
MSLane * getPreviousLane(MSLane *current, int &furtherIndex) const
std::string getStopInfo() const
retrieve information about the current stop state
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getLeftSideOnEdge() const
return left vehicle side on current edge
GUIVehicle(SUMOVehicleParameter *pars, const MSRoute *route, MSVehicleType *type, const double speedFactor)
Constructor.
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, bool asImage) const
draws the given guiShape with distinct carriages/modules
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
std::string getBackLaneID() const
void drawAction_drawVehicleBlinker(double length) const
void rerouteDRTStop(MSStoppingPlace *busStop)
handle route to accomodate to given stop
std::string getLCStateRight() const
return the lanechange state
void drawAction_drawVehicleBlueLight() const
double getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
std::string getLaneID() const
return vehicle lane id
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const
std::string getTargetLaneID() const
std::string getLCStateLeft() const
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
void drawRouteHelper(const GUIVisualizationSettings &s, const MSRoute &r, bool future, bool noLoop, const RGBColor &col) const
Draws the route.
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
GUIVisualizationTextSettings vehicleValue
bool gaming
whether the application is in gaming mode or not
std::string vehicleParam
key for coloring by vehicle parameter
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings vehicleText
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)
static bool haveLateralDynamics()
whether any kind of lateral dynamics is active
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
The base class for microscopic and mesoscopic vehicles.
double getMaxSpeed() const
Returns the maximum speed.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
std::list< MSStop > myStops
The vehicle's list of stops.
double getImpatience() const
Returns this vehicles impatience.
MSVehicleType * myType
This vehicle's type.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
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.
double getFuelConsumption() const
Returns fuel consumption of the current state.
double getCO2Emissions() const
Returns CO2 emission of the current state.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
double getElectricityConsumption() const
Returns electricity consumption of the current state.
double getOdometer() const
Returns the distance that was already driven by this vehicle.
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 getNOxEmissions() const
Returns NOx emission of the current state.
double getPMxEmissions() const
Returns PMx emission of the current state.
MSRouteIterator myCurrEdge
Iterator to current route-edge.
double getWidth() const
Returns the vehicle's width.
double getCOEmissions() const
Returns CO emission of the current state.
double getStateOfCharge() const
Returns actual state of charge of battery (Wh) RICE_CHECK: This may be a misnomer,...
const MSRoute * myRoute
This vehicle's route.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool hasStops() const
Returns whether the vehicle has to stop somewhere.
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 isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
bool addStop(const SUMOVehicleParameter::Stop &stopPar, std::string &errorMsg, SUMOTime untilOffset=0, bool collision=false, MSRouteIterator *searchStart=nullptr)
Adds a stop.
double getHCEmissions() const
Returns HC emission of the current state.
bool haveValidStopEdges() const
check whether all stop.edge MSRouteIterators are valid and in order
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.
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.
bool isStopped() const
Returns whether the vehicle is at a stop.
int getContainerNumber() const
Returns the number of containers.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
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.
A road/street connecting two junctions.
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 SUMOTime gLaneChangeDuration
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Representation of a lane in the micro simulation.
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.
MSEdge & getEdge() const
Returns the lane's edge.
const PositionVector & getShape() const
Returns this lane's shape.
MSLane * getBidiLane() const
retrieve bidirectional lane or nullptr
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
std::vector< const SUMOVehicle * > BlockingFoes
std::vector< LinkLeader > LinkLeaders
MSLink * getParallelLink(int direction) const
return the link that is parallel to this lane or 0
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) const
Returns the information whether the link may be passed.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
int size() const
Returns the number of edges to pass.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
const ConstMSEdgeVector & getEdges() const
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the 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.
double pos() const
Position of this state.
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.
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
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.
MSAbstractLaneChangeModel & getLaneChangeModel()
bool isActionStep(SUMOTime t) const
Returns whether the next simulation step will be an action point for the vehicle.
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 getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
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.
bool isLeader(const MSLink *link, const MSVehicle *veh) 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.
double getPositionOnLane() const
Get the vehicle's position along the lane.
const MSLane * getLane() const
Returns the lane the vehicle is on.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
MSLane * myLane
The lane the vehicle is on.
bool hasInfluencer() const
State myState
This Vehicles driving state (pos and speed)
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.
int getPersonCapacity() const
Get this vehicle type's person capacity.
double getMinGap() const
Get the free space in front of vehicles of this class.
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].
SUMOTime getLoadingDuration() const
Get this vehicle type's loading duration.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
const std::string & getID() const
Returns the name of the vehicle type.
double getLength() const
Get vehicle's length [m].
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
LateralAlignment getPreferredLateralAlignment() const
Get vehicle's preferred lateral alignment.
SUMOTime getBoardingDuration() const
Get this vehicle type's boarding duration.
const SUMOVTypeParameter & getParameter() const
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.
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.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double length() const
Returns the length.
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
double angleAt2D(int pos) const
get angle in certain position of position vector
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
double carriageLength
the length of train carriages and locomotive
bool wasSet(int what) const
Returns whether the given parameter was set.
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)
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.
bool parking
whether the vehicle is removed from the net while stopping
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 bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
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