SUMO - Simulation of Urban MObility
GUIEdge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // A road/street connecting two junctions (gui-version)
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <cmath>
36 #include <string>
37 #include <algorithm>
42 #include <utils/geom/GeomHelper.h>
45 #include <utils/gui/div/GLHelper.h>
48 #include <microsim/MSBaseVehicle.h>
49 #include <microsim/MSEdge.h>
50 #include <microsim/MSJunction.h>
51 #include <microsim/MSLaneChanger.h>
52 #include <microsim/MSGlobals.h>
55 #include "GUITriggeredRerouter.h"
56 #include "GUIEdge.h"
57 #include "GUIVehicle.h"
58 #include "GUINet.h"
59 #include "GUILane.h"
60 #include "GUIPerson.h"
61 #include "GUIContainer.h"
62 
64 #include <mesogui/GUIMEVehicle.h>
65 #include <mesosim/MESegment.h>
66 #include <mesosim/MELoop.h>
67 #include <mesosim/MEVehicle.h>
68 
69 #ifdef CHECK_MEMORY_LEAKS
70 #include <foreign/nvwa/debug_new.h>
71 #endif // CHECK_MEMORY_LEAKS
72 
73 
74 // ===========================================================================
75 // included modules
76 // ===========================================================================
77 GUIEdge::GUIEdge(const std::string& id, int numericalID,
78  const EdgeBasicFunction function,
79  const std::string& streetName, const std::string& edgeType, int priority)
80  : MSEdge(id, numericalID, function, streetName, edgeType, priority),
81  GUIGlObject(GLO_EDGE, id) {}
82 
83 
85  // just to quit cleanly on a failure
86  if (myLock.locked()) {
87  myLock.unlock();
88  }
89 }
90 
91 
92 MSLane&
93 GUIEdge::getLane(size_t laneNo) {
94  assert(laneNo < myLanes->size());
95  return *((*myLanes)[laneNo]);
96 }
97 
98 
99 std::vector<GUIGlID>
100 GUIEdge::getIDs(bool includeInternal) {
101  std::vector<GUIGlID> ret;
102  ret.reserve(MSEdge::myDict.size());
103  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
104  const GUIEdge* edge = dynamic_cast<const GUIEdge*>(i->second);
105  assert(edge);
106  if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) {
107  ret.push_back(edge->getGlID());
108  }
109  }
110  return ret;
111 }
112 
113 
114 SUMOReal
115 GUIEdge::getTotalLength(bool includeInternal, bool eachLane) {
116  SUMOReal result = 0;
117  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
118  const MSEdge* edge = i->second;
119  if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) {
120  // @note needs to be change once lanes may have different length
121  result += edge->getLength() * (eachLane ? edge->getLanes().size() : 1);
122  }
123  }
124  return result;
125 }
126 
127 
128 Boundary
130  Boundary ret;
132  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
133  ret.add((*i)->getShape().getBoxBoundary());
134  }
135  } else {
136  // take the starting coordinates of all follower edges and the endpoints
137  // of all successor edges
138  for (MSEdgeVector::const_iterator it = mySuccessors.begin(); it != mySuccessors.end(); ++it) {
139  const std::vector<MSLane*>& lanes = (*it)->getLanes();
140  for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
141  ret.add((*it_lane)->getShape().front());
142  }
143  }
144  for (MSEdgeVector::const_iterator it = myPredecessors.begin(); it != myPredecessors.end(); ++it) {
145  const std::vector<MSLane*>& lanes = (*it)->getLanes();
146  for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
147  ret.add((*it_lane)->getShape().back());
148  }
149  }
150  }
151  ret.grow(10);
152  return ret;
153 }
154 
155 
156 void
157 GUIEdge::fill(std::vector<GUIEdge*>& netsWrappers) {
158  size_t size = MSEdge::dictSize();
159  netsWrappers.reserve(size);
160  for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) {
161  if (i->second->getPurpose() != MSEdge::EDGEFUNCTION_DISTRICT) {
162  netsWrappers.push_back(static_cast<GUIEdge*>((*i).second));
163  }
164  }
165 }
166 
167 
168 
171  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
172  buildPopupHeader(ret, app);
178  }
179  const SUMOReal pos = getLanes()[0]->getShape().nearest_offset_to_point2D(parent.getPositionInformation());
180  new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0);
181  buildPositionCopyEntry(ret, false);
182  return ret;
183 }
184 
185 
188  GUISUMOAbstractView& parent) {
189  GUIParameterTableWindow* ret = 0;
190  ret = new GUIParameterTableWindow(app, *this, 16);
191  // add edge items
192  ret->mkItem("length [m]", false, (*myLanes)[0]->getLength());
193  ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed());
194  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getBruttoOccupancy, 100.));
195  ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getMesoMeanSpeed));
196  ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getFlow));
198  ret->mkItem("vehicle ids", false, getVehicleIDs());
199  // add segment items
201  ret->mkItem("segment index", false, segment->getIndex());
202  ret->mkItem("segment length [m]", false, segment->getLength());
203  ret->mkItem("segment allowed speed [m/s]", false, segment->getEdge().getSpeedLimit());
204  ret->mkItem("segment jam threshold [%]", false, segment->getRelativeJamThreshold());
205  ret->mkItem("segment occupancy [%]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getRelativeOccupancy));
206  ret->mkItem("segment mean vehicle speed [m/s]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getMeanSpeed));
207  ret->mkItem("segment flow [veh/h/lane]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getFlow));
208  ret->mkItem("segment #vehicles", true, new CastingFunctionBinding<MESegment, SUMOReal, size_t>(segment, &MESegment::getCarNumber));
209  ret->mkItem("segment leader leave time", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getEventTimeSeconds));
210 
211  // close building
212  ret->closeBuilding();
213  return ret;
214 }
215 
216 
217 Boundary
219  Boundary b = getBoundary();
220  // ensure that vehicles and persons on the side are drawn even if the edge
221  // is outside the view
222  b.grow(10);
223  return b;
224 }
225 
226 
227 void
230  return;
231  }
232  glPushName(getGlID());
233  // draw the lanes
234  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
236  setColor(s);
237  }
238  GUILane* l = dynamic_cast<GUILane*>(*i);
239  if (l != 0) {
240  l->drawGL(s);
241  }
242  }
245  drawMesoVehicles(s);
246  }
247  }
248  glPopName();
249  // (optionally) draw the name and/or the street name
250  const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNCTION_NORMAL;
251  const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNCTION_INTERNAL;
252  const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == EDGEFUNCTION_CROSSING || myFunction == EDGEFUNCTION_WALKINGAREA);
253  const bool drawStreetName = s.streetName.show && myStreetName != "";
254  if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName) {
255  GUILane* lane1 = dynamic_cast<GUILane*>((*myLanes)[0]);
256  GUILane* lane2 = dynamic_cast<GUILane*>((*myLanes).back());
257  if (lane1 != 0 && lane2 != 0) {
258  Position p = lane1->getShape().positionAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
259  p.add(lane2->getShape().positionAtOffset(lane2->getShape().length() / (SUMOReal) 2.));
260  p.mul(.5);
261  SUMOReal angle = lane1->getShape().rotationDegreeAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
262  angle += 90;
263  if (angle > 90 && angle < 270) {
264  angle -= 180;
265  }
266  if (drawEdgeName) {
267  drawName(p, s.scale, s.edgeName, angle);
268  } else if (drawInternalEdgeName) {
269  drawName(p, s.scale, s.internalEdgeName, angle);
270  } else if (drawCwaEdgeName) {
271  drawName(p, s.scale, s.cwaEdgeName, angle);
272  }
273  if (drawStreetName) {
275  s.streetName.size / s.scale, s.streetName.color, angle);
276  }
277  }
278  }
280  myLock.lock();
281  for (std::set<MSTransportable*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
282  GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
283  assert(person != 0);
284  person->drawGL(s);
285  }
286  myLock.unlock();
287  }
289  myLock.lock();
290  for (std::set<MSTransportable*>::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
291  GUIContainer* container = dynamic_cast<GUIContainer*>(*i);
292  assert(container != 0);
293  container->drawGL(s);
294  }
295  myLock.unlock();
296  }
297 }
298 
299 
300 void
303  if (vehicleControl != 0) {
304  // draw the meso vehicles
305  vehicleControl->secureVehicles();
307  size_t laneIndex = 0;
308  MESegment::Queue queue;
309  for (std::vector<MSLane*>::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) {
310  GUILane* l = static_cast<GUILane*>(*msl);
311  // go through the vehicles
312  SUMOReal segmentOffset = 0; // offset at start of current segment
313  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
314  segment != 0; segment = segment->getNextSegment()) {
315  const SUMOReal length = segment->getLength();
316  if (laneIndex < segment->numQueues()) {
317  // make a copy so we don't have to worry about synchronization
318  queue = segment->getQueue(laneIndex);
319  const size_t queueSize = queue.size();
320  SUMOReal vehiclePosition = segmentOffset + length;
321  // draw vehicles beginning with the leader at the end of the segment
322  SUMOReal xOff = 0;
323  for (size_t i = 0; i < queueSize; ++i) {
324  GUIMEVehicle* veh = static_cast<GUIMEVehicle*>(queue[queueSize - i - 1]);
325  const SUMOReal vehLength = veh->getVehicleType().getLengthWithGap();
326  while (vehiclePosition < segmentOffset) {
327  // if there is only a single queue for a
328  // multi-lane edge shift vehicles and start
329  // drawing again from the end of the segment
330  vehiclePosition += length;
331  xOff += 2;
332  }
333  const Position p = l->geometryPositionAtOffset(vehiclePosition);
334  const SUMOReal angle = l->getShape().rotationAtOffset(l->interpolateLanePosToGeometryPos(vehiclePosition));
335  veh->setPositionAndAngle(p, angle);
336  veh->drawGL(s);
337  vehiclePosition -= vehLength;
338  }
339  }
340  segmentOffset += length;
341  }
342  glPopMatrix();
343  }
344  vehicleControl->releaseVehicles();
345  }
346 }
347 
348 
349 
350 unsigned int
352  size_t vehNo = 0;
353  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
354  vehNo += segment->getCarNumber();
355  }
356  return (unsigned int)vehNo;
357 }
358 
359 
360 std::string
362  std::string result = " ";
363  std::vector<const MEVehicle*> vehs;
364  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
365  std::vector<const MEVehicle*> segmentVehs = segment->getVehicles();
366  vehs.insert(vehs.end(), segmentVehs.begin(), segmentVehs.end());
367  }
368  for (std::vector<const MEVehicle*>::const_iterator it = vehs.begin(); it != vehs.end(); it++) {
369  result += (*it)->getID() + " ";
370  }
371  return result;
372 }
373 
374 
375 SUMOReal
377  SUMOReal flow = 0;
378  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
379  flow += (SUMOReal) segment->getCarNumber() * segment->getMeanSpeed();
380  }
381  return 3600 * flow / (*myLanes)[0]->getLength();
382 }
383 
384 
385 SUMOReal
387  SUMOReal occ = 0;
388  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
389  occ += segment->getBruttoOccupancy();
390  }
391  return occ / (*myLanes)[0]->getLength() / (SUMOReal)(myLanes->size());
392 }
393 
394 
395 SUMOReal
397  return (*myLanes)[0]->getSpeedLimit();
398 }
399 
400 
401 SUMOReal
403  return getMesoMeanSpeed() / getAllowedSpeed();
404 }
405 
406 
407 void
410 }
411 
412 
413 SUMOReal
414 GUIEdge::getColorValue(size_t activeScheme) const {
415  switch (activeScheme) {
416  case 1:
417  return gSelected.isSelected(getType(), getGlID());
418  case 2:
419  return getPurpose();
420  case 3:
421  return getAllowedSpeed();
422  case 4:
423  return getBruttoOccupancy();
424  case 5:
425  return getMesoMeanSpeed();
426  case 6:
427  return getFlow();
428  case 7:
429  return getRelativeSpeed();
430  }
431  return 0;
432 }
433 
434 
435 SUMOReal
436 GUIEdge::getScaleValue(size_t activeScheme) const {
437  switch (activeScheme) {
438  case 1:
439  return gSelected.isSelected(getType(), getGlID());
440  case 2:
441  return getAllowedSpeed();
442  case 3:
443  return getBruttoOccupancy();
444  case 4:
445  return getMesoMeanSpeed();
446  case 5:
447  return getFlow();
448  case 6:
449  return getRelativeSpeed();
450  }
451  return 0;
452 }
453 
454 
455 MESegment*
457  const PositionVector& shape = getLanes()[0]->getShape();
458  const SUMOReal lanePos = shape.nearest_offset_to_point2D(pos);
459  return MSGlobals::gMesoNet->getSegmentForEdge(*this, lanePos);
460 }
461 
462 
463 
464 void
466  const std::vector<MSLane*>& lanes = getLanes();
467  const bool isClosed = lane->isClosed();
468  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
469  GUILane* l = dynamic_cast<GUILane*>(*i);
470  if (l->isClosed() == isClosed) {
471  l->closeTraffic(false);
472  }
473  }
475 }
476 
477 
478 void
480  MSEdgeVector edges;
481  edges.push_back(this);
482  GUITriggeredRerouter* rr = new GUITriggeredRerouter(getID() + "_dynamic_rerouter", edges, 1, "", false,
483  GUINet::getGUIInstance()->getVisualisationSpeedUp());
484 
487  ri.end = SUMOTime_MAX;
489  rr->myIntervals.push_back(ri);
490 
491  // trigger rerouting for vehicles already on this edge
492  const std::vector<MSLane*>& lanes = getLanes();
493  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
494  const MSLane::VehCont& vehicles = (*i)->getVehiclesSecure();
495  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
496  if ((*v)->getLane() == (*i)) {
498  } // else: this is the shadow during a continuous lane change
499  }
500  (*i)->releaseVehicles();
501  }
502 }
503 
504 /****************************************************************************/
505 
SUMOReal getScaleValue(size_t activeScheme) const
gets the scaling value according to the current scheme index
Definition: GUIEdge.cpp:436
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:218
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:760
SUMOReal getFlow() const
returns flow based on headway
Definition: MESegment.cpp:637
std::vector< MEVehicle * > Queue
Definition: MESegment.h:87
GUIVisualizationTextSettings streetName
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
SUMOReal rotationAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
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.
Definition: Position.h:119
bool isClosed() const
Definition: GUILane.h:235
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIEdge.cpp:170
const Position geometryPositionAtOffset(SUMOReal offset) const
Definition: MSLane.h:339
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:185
SUMOReal getLengthWithGap() const
Get vehicle&#39;s length including the minimum gap [m].
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
Definition: GUILane.cpp:1019
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
The vehicle arrived at a junction.
bool add(SUMOReal prob, T val, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Stores the information about how to visualize structures.
const EdgeBasicFunction myFunction
the purpose of the edge
Definition: MSEdge.h:735
GUIColorer edgeColorer
The mesoscopic edge colorer.
SUMOReal getFlow() const
return flow based on meanSpead
Definition: GUIEdge.cpp:376
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:417
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:271
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
GUIMEVehicleControl * getGUIMEVehicleControl()
Returns the vehicle control.
Definition: GUINet.cpp:531
The edge is a macroscopic connector (source/sink)
Definition: MSEdge.h:95
The class responsible for building and deletion of vehicles (gui-version)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:160
void setPositionAndAngle(const Position &pos, SUMOReal angle)
set position and angle for drawing
Definition: GUIMEVehicle.h:139
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
SUMOReal getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
Definition: MESegment.h:207
unsigned int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
Definition: MESegment.h:150
GUIVisualizationTextSettings cwaEdgeName
static void drawText(const std::string &text, const Position &pos, const SUMOReal layer, const SUMOReal size, const RGBColor &col=RGBColor::BLACK, const SUMOReal angle=0)
draw Text with given parameters
Definition: GLHelper.cpp:460
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:255
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:89
static SUMOReal getTotalLength(bool includeInternal, bool eachLane)
Definition: GUIEdge.cpp:115
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.
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Definition: MESegment.h:272
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:123
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
SUMOReal scale
information about a lane&#39;s width (temporary, used for a single view)
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
SUMOReal getRelativeSpeed() const
return meanSpead divided by allowedSpeed
Definition: GUIEdge.cpp:402
GUIVisualizationTextSettings edgeName
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:60
const std::string & getID() const
Returns the id.
Definition: Named.h:65
A road/street connecting two junctions.
Definition: MSEdge.h:80
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:180
void rebuildAllowedLanes()
Definition: MSEdge.cpp:172
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:562
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:84
The edge is a district edge.
Definition: MSEdge.h:99
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:443
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:504
void closeTraffic(const GUILane *lane)
close this edge for traffic
Definition: GUIEdge.cpp:465
GUIVisualizationTextSettings internalEdgeName
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
SUMOTime begin
The begin time these definitions are valid.
SUMOReal getLength() const
Returns the length of the segment in meters.
Definition: MESegment.h:166
size_t getCarNumber() const
Returns the total number of cars on the segment.
Definition: MESegment.cpp:253
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:747
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIEdge.cpp:187
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
const T getColor(const SUMOReal value) const
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
Definition: GUIEdge.cpp:414
SUMOReal getAllowedSpeed() const
Definition: GUIEdge.cpp:396
static MSEdge mySpecialDest_keepDestination
special destination values
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Tries to reroute the vehicle.
float minSize
The minimum size to draw this object.
const std::vector< MSLane * > * myLanes
Container for the edge&#39;s lane; should be sorted: (right-hand-traffic) the more left the lane...
Definition: MSEdge.h:729
MSLane & getLane(size_t laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:93
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:54
SUMOReal getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Definition: MSEdge.cpp:674
void addRerouter()
add a rerouter
Definition: GUIEdge.cpp:479
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:246
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIEdge.cpp:408
void drawMesoVehicles(const GUIVisualizationSettings &s) const
Definition: GUIEdge.cpp:301
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
SUMOReal getMesoMeanSpeed() const
get the mean speed for mesoscopic simulation
Definition: MSEdge.cpp:542
GUIEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: GUIEdge.cpp:77
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:103
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:100
MESegment * getSegmentAtPosition(const Position &pos)
returns the segment closest to the given position
Definition: GUIEdge.cpp:456
SUMOReal length() const
Returns the length.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:76
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Definition: Boundary.cpp:201
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:242
unsigned int getVehicleNo() const
Definition: GUIEdge.cpp:351
SUMOReal getBruttoOccupancy() const
Definition: GUIEdge.cpp:386
SUMOTime end
The end time these definitions are valid.
#define SUMOTime_MAX
Definition: SUMOTime.h:44
SUMOReal getRelativeOccupancy() const
Returns the relative occupany of the segment (percentage of road used))
Definition: MESegment.h:182
A MSVehicle extended by some values for usage within the gui.
Definition: GUIMEVehicle.h:61
GUIVisualizationSizeSettings containerSize
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons/ myContainers.
Definition: GUIEdge.h:216
The edge is a normal street.
Definition: MSEdge.h:93
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:71
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:333
A single mesoscopic segment (cell)
Definition: MESegment.h:57
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:101
static size_t dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:605
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type definition.
Definition: MSBaseVehicle.h:93
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
The popup menu of a globject.
an edge
MESegment * getSegmentForEdge(const MSEdge &e, SUMOReal pos=0)
Get the segment for a given edge at a given position.
Definition: MELoop.cpp:288
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIEdge.cpp:228
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:779
void mul(SUMOReal val)
Multiplies both positions with the given value.
Definition: Position.h:99
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Definition: MSGlobals.h:99
GUIVisualizationSizeSettings personSize
void lock()
lock mutex
Definition: MFXMutex.cpp:86
std::string getVehicleIDs() const
Definition: GUIEdge.cpp:361
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:808
#define SUMOReal
Definition: config.h:213
GUIVisualizationSizeSettings vehicleSize
Boundary getBoundary() const
Returns the street&#39;s geometry.
Definition: GUIEdge.cpp:129
FXbool locked()
Definition: MFXMutex.h:70
empty max
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:77
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
The edge is an internal edge.
Definition: MSEdge.h:97
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:750
GUISelectedStorage gSelected
A global holder of selected objects.
void closeBuilding()
Closes the building of the table.
static bool gUseMesoSim
Definition: MSGlobals.h:87
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A window containing a gl-object&#39;s parameter.
SUMOReal getRelativeJamThreshold() const
Returns the relative occupany of the segment (percentage of road used)) at which the segment is consi...
Definition: MESegment.h:190
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:157
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
SUMOReal getEventTimeSeconds() const
Like getEventTime but returns seconds (for visualization)
Definition: MESegment.h:289
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const PositionVector & getShape() const
Definition: GUILane.cpp:725
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:757