59 #pragma warning(disable: 4275)
61 #include <osg/Geometry>
81 MSEdge*
const edge,
int numericalID,
84 const std::string& type) :
85 MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions, index, isRampAccel, type),
100 int e = (int)
myShape.size() - 1;
101 for (
int i = 0; i < e; ++i) {
124 const MSLane::VehCont::iterator& at,
126 FXMutexLock locker(
myLock);
147 FXMutexLock locker(
myLock);
153 FXMutexLock locker(
myLock);
160 FXMutexLock locker(
myLock);
167 FXMutexLock locker(
myLock);
174 FXMutexLock locker(
myLock);
181 FXMutexLock locker(
myLock);
188 FXMutexLock locker(
myLock);
195 FXMutexLock locker(
myLock);
202 FXMutexLock locker(
myLock);
209 FXMutexLock locker(
myLock);
217 int noLinks = (int)
myLinks.size();
232 double w =
myWidth / (double) noLinks;
234 for (
int i = noLinks; --i >= 0;) {
235 double x2 = x1 - (double)(w / 2.);
244 int noLinks = (int)
myLinks.size();
267 double w =
myWidth / (double) noLinks;
269 for (
int i = noLinks; --i >= 0;) {
270 double x2 = x1 - (double)(w / 2.);
283 int noLinks = (int)
myLinks.size();
302 const double w =
myWidth / (double) noLinks;
304 for (
int i = 0; i < noLinks; ++i) {
311 const double stopOffsetPassenger =
myStopOffsets.begin()->second;
314 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
317 glTranslated(end.
x(), end.
y(), 0);
318 glRotated(rot, 0, 0, 1);
319 glTranslated(0, stopOffsetPassenger, 0);
335 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
336 if (link ==
nullptr) {
343 glTranslated(end.
x(), end.
y(), 0);
344 glRotated(rot, 0, 0, 1);
354 glTranslated(end.
x(), end.
y(), 0);
355 glRotated(rot, 0, 0, 1);
383 glScaled(scale, scale, 1);
404 const double rot =
RAD2DEG(atan2((end.
x() - f.
x()), (f.
y() - end.
y())));
407 glTranslated(end.
x(), end.
y(), 0);
408 glRotated(rot, 0, 0, 1);
466 if (exaggeration > 1) {
470 const MSLane* connected = link->getLane();
471 if (connected ==
nullptr) {
478 if (exaggeration > 1) {
479 p1 = centroid + ((p1 - centroid) * exaggeration);
480 p2 = centroid + ((p2 - centroid) * exaggeration);
482 glVertex2d(p1.
x(), p1.
y());
483 glVertex2d(p2.
x(), p2.
y());
497 bool mustDrawMarkings =
false;
506 const bool detailZoom = s.
scale * exaggeration > 5;
509 if (isCrossing || isWalkingArea) {
514 glTranslated(0, 0,
getType() - 0.2);
522 const std::vector<RGBColor>& segmentColors =
static_cast<const GUIEdge*
>(
myEdge)->getSegmentColors();
523 if (segmentColors.size() > 0) {
526 for (
int ii = 0; ii < (int)
myShape.size() - 1; ++ii) {
535 double junctionExaggeration = 1;
555 if (hiddenBidi && !spreadSuperposed) {
557 }
else if (drawRails) {
564 if (spreadSuperposed) {
570 const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
572 const double halfCrossTieWidth = halfGauge * 1.81;
581 glTranslated(0, 0, .1);
586 }
else if (isCrossing) {
588 glTranslated(0, 0, .2);
590 glTranslated(0, 0, -.2);
592 }
else if (isWalkingArea) {
594 glTranslated(0, 0, .2);
595 if (s.
scale * exaggeration < 20.) {
600 glTranslated(0, 0, -.2);
601 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
611 const int cornerDetail = drawDetails && !
isInternal ? (int)(s.
scale * exaggeration) : 0;
619 #ifdef GUILane_DEBUG_DRAW_VERTICES
622 #ifdef GUILane_DEBUG_DRAW_FOE_INTERSECTIONS
632 glTranslated(0, 0, .5);
639 glColor3d(0.3, 0.3, 0.3);
659 glTranslated(0, 0, 1000);
666 glTranslated(0, 0, -1000);
668 glTranslated(0, 0, .1);
676 if ((drawDetails || junctionExaggeration > 1) && s.
showLane2Lane) {
683 if (mustDrawMarkings && drawDetails && s.
laneShowBorders && !hiddenBidi) {
696 for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
697 if ((*v)->getLane() ==
this) {
725 int e = (int)
getShape().size() - 1;
726 for (
int i = 0; i < e; ++i) {
734 glVertex2d(-mw, -t - length);
735 glVertex2d(-mw2, -t - length);
736 glVertex2d(-mw2, -t);
757 const int e = (int)
getShape().size() - 1;
758 const double markWidth = 0.1;
760 for (
int i = 0; i < e; ++i) {
766 for (
int side = -1; side <= 1; side += 2) {
768 glVertex2d(side * mw, -t);
769 glVertex2d(side * mw, -t - 0.35);
770 glVertex2d(side * (mw + markWidth), -t - 0.35);
771 glVertex2d(side * (mw + markWidth), -t);
783 int e = (int)
getShape().size() - 1;
784 const double widthFactor = spreadSuperposed ? 0.4 : 1;
785 const double w =
MAX2(POSITION_EPS,
myWidth * widthFactor);
788 const double sideOffset = spreadSuperposed ? w * -0.5 : 0;
789 for (
int i = 0; i < e; ++i) {
795 glBegin(GL_TRIANGLES);
796 glVertex2d(sideOffset, -t - length);
797 glVertex2d(sideOffset - w4 * exaggeration, -t);
798 glVertex2d(sideOffset + w4 * exaggeration, -t);
810 glColor3d(1.0, 0.3, 0.3);
811 const double orthoLength = 0.5;
813 const std::vector<const MSLane*>& foeLanes = link->
getFoeLanes();
815 if (foeLanes.size() == lengthsBehind.size()) {
816 for (
int i = 0; i < (int)foeLanes.size(); ++i) {
817 const MSLane* l = foeLanes[i];
820 if (ortho.
length() < orthoLength) {
846 new FXMenuSeparator(ret);
848 new FXMenuSeparator(ret);
862 new FXMenuSeparator(ret);
864 FXMenuPane* reachableByClass =
new FXMenuPane(ret);
899 ret->
mkItem((
"edgeParam:" + kv.first).c_str(),
false, kv.second);
924 const std::vector<double>&
930 const std::vector<double>&
993 if (activeScheme < 0) {
996 switch (activeScheme) {
1019 std::vector<RGBColor> tazColors;
1021 if (e->isTazConnector() && e->knowsParameter(
"tazColor")) {
1026 if (e->isTazConnector() && e->knowsParameter(
"tazColor")) {
1030 if (tazColors.size() > 0) {
1032 col = tazColors[randColor];
1047 switch (activeScheme) {
1049 for (PositionVector::const_iterator ii =
myShape.begin(); ii !=
myShape.end() - 1; ++ii) {
1056 for (
int ii = 1; ii < (int)
myShape.size(); ++ii) {
1070 switch (activeScheme) {
1222 switch (activeScheme) {
1310 osg::Vec4ubArray* colors =
dynamic_cast<osg::Vec4ubArray*
>(myGeom->getColorArray());
1312 myGeom->setColorArray(colors);
1327 if (rebuildAllowed) {
1330 pred->rebuildAllowedTargets();
1340 const double slength =
myLength / no;
1343 for (
int i = 0; i < no; ++i) {
1347 if (pos.
distanceTo(result[index]) > POSITION_EPS) {
@ MID_COPY_EDGE_NAME
Copy edge name (for lanes only)
@ MID_REACHABILITY
show reachability from a given lane
@ MID_CLOSE_LANE
close lane
@ MID_CLOSE_EDGE
close edge
@ MID_ADD_REROUTER
add rerouter
GUISelectedStorage gSelected
A global holder of selected objects.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ SVC_SHIP
is an arbitrary ship
@ SVC_RAIL_CLASSES
classes which drive on tracks
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_AUTHORITY
authorities vehicles
@ SVC_PEDESTRIAN
pedestrian
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ PARTLEFT
The link is a partial left direction.
@ RIGHT
The link is a (hard) right direction.
@ TURN
The link is a 180 degree turn.
@ LEFT
The link is a (hard) left direction.
@ STRAIGHT
The link is a straight direction.
@ TURN_LEFTHAND
The link is a 180 degree turn (left-hand network)
@ PARTRIGHT
The link is a partial right direction.
@ NODIR
The link has no direction (is a dead end link)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_TL_REDYELLOW
The link has red light (must brake) but indicates upcoming green.
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
@ LINKSTATE_TL_YELLOW_MAJOR
The link has yellow light, may pass.
@ LINKSTATE_TL_GREEN_MAJOR
The link has green light, may pass.
@ LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
@ LINKSTATE_DEADEND
This is a dead end link.
@ LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
@ LINKSTATE_TL_YELLOW_MINOR
The link has yellow light, has to brake anyway.
@ LINKSTATE_TL_RED
The link has red light (must brake)
@ LINKSTATE_TL_GREEN_MINOR
The link has green light, has to brake.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
@ LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
const double SUMO_const_laneWidth
const double SUMO_const_laneMarkWidth
const double SUMO_const_halfLaneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
static void debugVertices(const PositionVector &shape, double size, double layer=256)
draw vertex numbers for the given shape (in a random color)
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
static void drawCrossTies(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForRectangleSelection)
draw crossties for railroads or pedestrian crossings
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 drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, const GUIVisualizationTextSettings &settings, const double scale)
draw text and the end of shape
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 drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
A road/street connecting two junctions (gui-version)
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterway
const PositionVector & getShape() const
void debugDrawFoeIntersections() const
draw intersection positions of foe internal lanes with this one
bool isSelected() const
whether this lane is selected in the GUI
std::vector< double > myShapeLengths
The lengths of the shape parts.
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
bool isLaneOrEdgeSelected() const
whether this lane or its parent edge is selected in the GUI
const std::vector< double > & getShapeLengths() const
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
void integrateNewVehicles()
double myHalfLaneWidth
Half of lane width, for speed-up.
void removeParking(MSVehicle *veh)
remove parking vehicle
PositionVector splitAtSegments(const PositionVector &shape)
add intermediate points at segment borders
std::vector< int > myShapeSegments
the meso segment index for each geometry segment
double firstWaitingTime() const
double myQuarterLaneWidth
Quarter of lane width, for speed-up.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const GUINet &net) const
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
double getPendingEmits() const
get number of vehicles waiting for departure on this lane
void drawLane2LaneConnections(double exaggeration) const
void drawLinkNo(const GUIVisualizationSettings &s) const
helper methods
static const RGBColor MESO_USE_LANE_COLOR
special color to signify alternative coloring scheme
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
void drawLinkRules(const GUIVisualizationSettings &s, const GUINet &net) const
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void releaseVehicles() const
Allows to use the container for microsimulation again.
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
const std::vector< double > & getShapeRotations() const
void detectCollisions(SUMOTime timestep, const std::string &stage)
double getEdgeLaneNumber() const
double myReachability
the time distance from a particular edge
double getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::vector< double > myShapeRotations
The rotations of the shape parts.
void executeMovements(const SUMOTime t)
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
void setJunctionApproaches(const SUMOTime t) const
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, const MSLink *link, const PositionVector &shape, double x1, double x2) const
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
double getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane borders and white markings
double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
GUILane(const std::string &id, double maxSpeed, double length, MSEdge *const edge, int numericalID, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel, const std::string &type)
Constructor.
void drawBikeMarkings() const
bike lane markings on top of an intersection
bool myAmClosed
state for dynamic lane closings
void planMovements(const SUMOTime t)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
A MSNet extended by some values for usage within the gui.
int getLinkTLID(const MSLink *const link) const
int getLinkTLIndex(const MSLink *const link) const
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
double getEdgeData(const MSEdge *edge, const std::string &attr)
retrieve loaded edged weight for the given attribute and the current simulation time
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.
const T getColor(const double value) const
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
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.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings vehicleSize
GUIVisualizationSizeSettings junctionSize
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
GUIScaler laneScaler
The lane scaler.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
bool drawJunctionShape
whether the shape of the junction should be drawn
std::string edgeData
key for coloring by edgeData
GUIVisualizationTextSettings drawLinkJunctionIndex
bool showRails
Information whether rails shall be drawn.
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
bool showSublanes
Whether to show sublane boundaries.
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
double scale
information about a lane's width (temporary, used for a single view)
bool showLaneDirection
Whether to show direction indicators for lanes.
GUIScaler edgeScaler
The mesoscopic edge scaler.
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
GUIColorer laneColorer
The lane colorer.
bool laneShowBorders
Information whether lane borders shall be drawn.
double laneMinSize
The minimum visual lane width for drawing.
GUIVisualizationTextSettings drawLinkTLIndex
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
std::string edgeParam
key for coloring by edge parameter
static double naviDegree(const double angle)
static int numSegmentsFor(const double length, const double slength)
Compute number of segments per edge (best value stay close to the configured segment length)
A road/street connecting two junctions.
bool isCrossing() const
return whether this edge is a pedestrian crossing
int getPriority() const
Returns the priority of the edge.
SVCPermissions getPermissions() const
Returns the combined permissions of all lanes of this edge.
const MSEdgeVector & getPredecessors() const
const std::string & getStreetName() const
Returns the street name of the edge.
bool isWalkingArea() const
return whether this edge is walking area
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void rebuildAllowedLanes()
bool isTazConnector() const
bool isInternal() const
return whether this edge is an internal edge
int getNumericalID() const
Returns the numerical id of the edge.
const std::string & getEdgeType() const
Returns the type of the edge.
const MSJunction * getToJunction() const
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
A storage for edge travel times and efforts.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
static double gLateralResolution
static int gNumSimThreads
how many threads to use for simulation
static bool gLefthand
Whether lefthand-drive is being simulated.
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
const PositionVector & getShape() const
Returns this junction's shape.
SumoXMLNodeType getType() const
return the type of this Junction
Representation of a lane in the micro simulation.
SVCPermissions myPermissions
The vClass permissions for this lane.
virtual void setJunctionApproaches(const SUMOTime t) const
Register junction approaches for all vehicles after velocities have been planned.
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
const std::vector< MSLink * > & getLinkCont() const
returns the container with all links !!!
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
virtual void integrateNewVehicles()
Insert buffered vehicle into the real lane.
double myLength
Lane length [m].
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
PositionVector myShape
The shape of the lane.
std::map< long long, SVCPermissions > myPermissionChanges
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
MSEdge *const myEdge
The lane's edge, for routing only.
double myMaxSpeed
Lane-wide speedlimit [m/s].
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
const MSLink * getLinkTo(const MSLane *const) const
returns the link to the given lane or nullptr, if it is not connected
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step....
VehCont myVehicles
The lane's vehicles. This container holds all vehicles that have their front (longitudinally) and the...
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
std::vector< MSVehicle * > VehCont
Container for vehicles.
std::set< const MSVehicle * > myParkingVehicles
void resetPermissions(long long transientID)
const std::string myLaneType
the type of this lane
double getLength() const
Returns the lane's length.
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
int getIndex() const
Returns the lane's index.
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
const double myWidth
Lane width [m].
const double myLengthGeometryFactor
precomputed myShape.length / myLength
virtual void executeMovements(const SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
int myIndex
The lane index.
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
std::vector< MSLink * > myLinks
static const long CHANGE_PERMISSIONS_GUI
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
MSEdge & getEdge() const
Returns the lane's edge.
std::map< SVCPermissions, double > myStopOffsets
const PositionVector & getShape() const
Returns this lane's shape.
double interpolateGeometryPosToLanePos(double geometryPos) const
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
double getCOEmissions() const
Returns the sum of last step CO emissions.
double getWidth() const
Returns the lane's width.
double getMeanSpeed() const
Returns the mean speed on this lane.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
double getHCEmissions() const
Returns the sum of last step HC emissions.
const std::vector< std::pair< double, double > > & getLengthsBehindCrossing() const
LinkState getState() const
Returns the current state of the link.
int getIndex() const
Returns the respond index (for visualization)
bool havePriority() const
Returns whether this link is a major link.
const std::vector< const MSLane * > & getFoeLanes() const
const MSTrafficLightLogic * getTLLogic() const
Returns the TLS index.
Notification
Definition of a vehicle state.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Representation of a vehicle in the micro simulation.
const std::string & getID() const
Returns the id.
static OptionsCont & getOptions()
Retrieves the options.
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
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 distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double z() const
Returns the z-position.
double y() const
Returns the y-position.
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
double length() const
Returns the length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0, double deg=90) const
return orthogonal through p (extending this vector if necessary)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
int insertAtClosest(const Position &p, bool interpolateZ)
inserts p between the two closest positions
int indexOfClosest(const Position &p) const
index of the closest position to p
double nearest_offset_to_point25D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D projected onto the 3D geometry
PositionVector reverse() const
reverse position vector
unsigned char red() const
Returns the red-amount of the color.
unsigned char alpha() const
Returns the alpha-amount of the color.
static RGBColor parseColor(std::string coldef)
Parses a color information.
unsigned char green() const
Returns the green-amount of the color.
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
unsigned char blue() const
Returns the blue-amount of the color.
static std::mt19937 * getColorRNG()
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static double rand(std::mt19937 *rng=nullptr)
Returns a random real number in [0, 1)
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
static const RGBColor SUMO_color_DEADEND_SHOW
color for highlighthing deadends
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
double exaggeration
The size exaggeration (upscale)
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
double minSize
The minimum size to draw this object.