68 const std::string& streetName,
const std::string& edgeType,
int priority)
69 :
MSEdge(id, numericalID, function, streetName, edgeType, priority),
83 assert(laneNo < (
int)
myLanes->size());
84 return *((*myLanes)[laneNo]);
90 std::vector<GUIGlID> ret;
107 const MSEdge* edge = i->second;
121 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
122 ret.
add((*i)->getShape().getBoxBoundary());
128 const std::vector<MSLane*>& lanes = (*it)->getLanes();
129 for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
130 ret.
add((*it_lane)->getShape().front());
134 const std::vector<MSLane*>& lanes = (*it)->getLanes();
135 for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
136 ret.
add((*it_lane)->getShape().back());
156 new FXMenuCommand(ret, (
"segment: " +
toString(segment->
getIndex())).c_str(),
nullptr,
nullptr, 0);
214 for (std::vector<MSLane*>::const_iterator i =
myLanes->begin(); i !=
myLanes->end(); ++i) {
237 if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName || drawEdgeValue) {
240 if (lane1 !=
nullptr && lane2 !=
nullptr) {
247 }
else if (drawInternalEdgeName) {
249 }
else if (drawCwaEdgeName) {
252 if (drawStreetName) {
267 for (std::set<MSTransportable*>::const_iterator i =
myPersons.begin(); i !=
myPersons.end(); ++i) {
277 assert(container != 0);
287 if (vehicleControl !=
nullptr) {
293 for (std::vector<MSLane*>::const_iterator msl =
myLanes->begin(); msl !=
myLanes->end(); ++msl, ++laneIndex) {
296 double segmentOffset = 0;
298 segment !=
nullptr; segment = segment->getNextSegment()) {
299 const double length = segment->
getLength();
300 if (laneIndex < segment->numQueues()) {
302 queue = segment->getQueue(laneIndex);
303 const int queueSize = (int)queue.size();
304 double vehiclePosition = segmentOffset + length;
307 for (
int i = 0; i < queueSize; ++i) {
310 while (vehiclePosition < segmentOffset) {
314 vehiclePosition += length;
320 vehiclePosition -= vehLength;
323 segmentOffset += length;
337 vehNo += segment->getCarNumber();
345 std::string result =
" ";
346 std::vector<const MEVehicle*> vehs;
348 std::vector<const MEVehicle*> segmentVehs = segment->getVehicles();
349 vehs.insert(vehs.end(), segmentVehs.begin(), segmentVehs.end());
351 for (std::vector<const MEVehicle*>::const_iterator it = vehs.begin(); it != vehs.end(); it++) {
352 result += (*it)->getID() +
" ";
362 flow += (double) segment->getCarNumber() * segment->getMeanSpeed();
364 return 3600 * flow / (*myLanes)[0]->getLength();
372 occ += segment->getBruttoOccupancy();
374 return occ / (*myLanes)[0]->getLength() / (double)(
myLanes->size());
380 return (*
myLanes)[0]->getSpeedLimit();
403 int activeMicroScheme = -1;
404 switch (activeScheme) {
406 activeMicroScheme = 0;
409 activeMicroScheme = 18;
412 activeMicroScheme = 30;
426 switch (activeScheme) {
429 segment !=
nullptr; segment = segment->getNextSegment()) {
436 segment !=
nullptr; segment = segment->getNextSegment()) {
442 segment !=
nullptr; segment = segment->getNextSegment()) {
448 segment !=
nullptr; segment = segment->getNextSegment()) {
454 segment !=
nullptr; segment = segment->getNextSegment()) {
460 segment !=
nullptr; segment = segment->getNextSegment()) {
472 switch (activeScheme) {
498 switch (activeScheme) {
529 const std::vector<MSLane*>& lanes =
getLanes();
530 const bool isClosed = lane->
isClosed();
531 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
539 pred->rebuildAllowedTargets();
547 edges.push_back(
this);
558 const std::vector<MSLane*>& lanes =
getLanes();
559 for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
561 for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
562 if ((*v)->getLane() == (*i)) {
566 (*i)->releaseVehicles();
const SumoXMLEdgeFunc myFunction
the purpose of the edge
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
std::set< MSTransportable * > myContainers
Containers on the edge.
double getBruttoOccupancy() const
double getRelativeOccupancy() const
Returns the relative occupany of the segment (percentage of road used))
double scale
information about a lane's width (temporary, used for a single view)
std::vector< MEVehicle * > Queue
double getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
GUIVisualizationTextSettings streetName
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
double getLength() const
Returns the length of the segment in meters.
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
int getCarNumber() const
Returns the total number of cars on the segment.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void add(const Position &pos)
Adds the given position to this one.
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
The vehicle arrived at a junction.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
std::vector< RGBColor > mySegmentColors
The color of the segments (cached)
Stores the information about how to visualize structures.
const MSEdgeVector & getPredecessors() const
double getEventTimeSeconds() const
Like getEventTime but returns seconds (for visualization)
GUIColorer edgeColorer
The mesoscopic edge colorer.
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
double getEntryBlockTimeSeconds() const
get the last headway time in seconds
GUIVisualizationTextSettings edgeValue
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
GUIMEVehicleControl * getGUIMEVehicleControl()
Returns the vehicle control.
Boundary getBoundary() const
Returns the street's geometry.
The class responsible for building and deletion of vehicles (gui-version)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
double getMeanSpeed() const
get the mean speed
double getLength() const
Returns the lane's length.
GUIVisualizationTextSettings cwaEdgeName
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
const std::string & getID() const
Returns the id.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
double getLength() const
return the length of the edge
void drawMesoVehicles(const GUIVisualizationSettings &s) const
std::string getVehicleIDs() const
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
double getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
A class that stores a 2D geometrical boundary.
Representation of a lane in the micro simulation (gui-version)
MSLane & getLane(int laneNo)
returns the enumerated lane (!!! why not private with a friend?)
GUIVisualizationTextSettings edgeName
bool setFunctionalColor(const GUIColorer &c) const
sets the color according to the current scheme index and some edge function
A road/street connecting two junctions (gui-version)
A road/street connecting two junctions.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
int getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
void rebuildAllowedLanes()
double getAllowedSpeed() const
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
double getTextAngle(double objectAngle) const
return an angle that is suitable for reading text aligned with the given angle (degrees) ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double minSize
The minimum size to draw this object.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
void closeTraffic(const GUILane *lane)
close this edge for traffic
GUIVisualizationTextSettings internalEdgeName
A point in 2D or 3D with translation and scaling methods.
void drawOnPos(const GUIVisualizationSettings &s, const Position &pos, const double angle) const
Draws the object on the specified position with the specified angle.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOTime begin
The begin time these definitions are valid.
MSEdgeVector mySuccessors
The succeeding edges.
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static MSEdge mySpecialDest_keepDestination
special destination values
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
const PositionVector & getShape() const
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Boundary & grow(double by)
extends the boundary by the given amount
const std::vector< MSLane * > * myLanes
Container for the edge's lane; should be sorted: (right-hand-traffic) the more left the lane...
const T getColor(const double value) const
bool isInternal() const
return whether this edge is an internal edge
void addRerouter()
add a rerouter
std::vector< MSVehicle * > VehCont
Container for vehicles.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::string & getStreetName() const
Returns the street name of the edge.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Tries to reroute the vehicle.
double getRelativeSpeed() const
return meanSpead divided by allowedSpeed
void unlock()
release mutex lock
static std::vector< GUIGlID > getIDs(bool includeInternal)
MESegment * getSegmentAtPosition(const Position &pos)
returns the segment closest to the given position
double length() const
Returns the length.
SUMOTime end
The end time these definitions are valid.
bool setMultiColor(const GUIColorer &c) const
sets multiple colors according to the current scheme index and edge function
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isTazConnector() const
A MSVehicle extended by some values for usage within the gui.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
GUIVisualizationSizeSettings containerSize
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons/ myContainers.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
double getRelativeJamThreshold() const
Returns the relative occupany of the segment (percentage of road used)) at which the segment is consi...
double getLastHeadwaySeconds() const
get the last headway time in seconds
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
A single mesoscopic segment (cell)
double getFlow() const
returns flow based on headway
double interpolateLanePosToGeometryPos(double lanePos) const
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
bool isSelected() const
whether this lane is selected in the GUI
int numQueues() const
return the number of queues
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
std::string myStreetName
the real-world name of this edge (need not be unique)
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
GUIVisualizationSizeSettings personSize
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
GUIGlID getGlID() const
Returns the numerical id of the object.
static DictType myDict
Static dictionary to associate string-ids with objects.
GUIEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
FXbool locked()
check if mutex is locked
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void mul(double val)
Multiplies both positions with the given value.
std::vector< MSEdge * > MSEdgeVector
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
static double getTotalLength(bool includeInternal, bool eachLane)
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
double getFlow() const
return flow based on meanSpead
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
MSEdgeVector myPredecessors
The preceeding edges.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUISelectedStorage gSelected
A global holder of selected objects.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Representation of a lane in the micro simulation.
A window containing a gl-object's parameter.
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.