Eclipse SUMO - Simulation of Urban MObility
GUIEdge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // A road/street connecting two junctions (gui-version)
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <vector>
28 #include <cmath>
29 #include <string>
30 #include <algorithm>
31 #include <fx.h>
35 #include <utils/geom/GeomHelper.h>
37 #include <utils/gui/div/GLHelper.h>
40 #include <microsim/MSBaseVehicle.h>
41 #include <microsim/MSEdge.h>
42 #include <microsim/MSJunction.h>
43 #include <microsim/MSLaneChanger.h>
45 #include <microsim/MSGlobals.h>
48 #include "GUITriggeredRerouter.h"
49 #include "GUIEdge.h"
50 #include "GUIVehicle.h"
51 #include "GUINet.h"
52 #include "GUILane.h"
53 #include "GUIPerson.h"
54 #include "GUIContainer.h"
55 
57 #include <mesogui/GUIMEVehicle.h>
58 #include <mesosim/MESegment.h>
59 #include <mesosim/MELoop.h>
60 #include <mesosim/MEVehicle.h>
61 
62 
63 // ===========================================================================
64 // included modules
65 // ===========================================================================
66 GUIEdge::GUIEdge(const std::string& id, int numericalID,
67  const SumoXMLEdgeFunc function,
68  const std::string& streetName, const std::string& edgeType, int priority,
69  double distance)
70  : MSEdge(id, numericalID, function, streetName, edgeType, priority, distance),
71  GUIGlObject(GLO_EDGE, id) {}
72 
73 
75  // just to quit cleanly on a failure
76  if (myLock.locked()) {
77  myLock.unlock();
78  }
79 }
80 
81 
82 MSLane&
83 GUIEdge::getLane(int laneNo) {
84  assert(laneNo < (int)myLanes->size());
85  return *((*myLanes)[laneNo]);
86 }
87 
88 
89 std::vector<GUIGlID>
90 GUIEdge::getIDs(bool includeInternal) {
91  std::vector<GUIGlID> ret;
92  ret.reserve(MSEdge::myDict.size());
93  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
94  const GUIEdge* edge = dynamic_cast<const GUIEdge*>(i->second);
95  assert(edge);
96  if (includeInternal || edge->isNormal()) {
97  ret.push_back(edge->getGlID());
98  }
99  }
100  return ret;
101 }
102 
103 
104 double
105 GUIEdge::getTotalLength(bool includeInternal, bool eachLane) {
106  double result = 0;
107  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
108  const MSEdge* edge = i->second;
109  if (includeInternal || !edge->isInternal()) {
110  // @note needs to be change once lanes may have different length
111  result += edge->getLength() * (eachLane ? edge->getLanes().size() : 1);
112  }
113  }
114  return result;
115 }
116 
117 
118 Boundary
120  Boundary ret;
121  if (!isTazConnector()) {
122  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
123  ret.add((*i)->getShape().getBoxBoundary());
124  }
125  } else {
126  // take the starting coordinates of all follower edges and the endpoints
127  // of all successor edges
128  for (MSEdgeVector::const_iterator it = mySuccessors.begin(); it != mySuccessors.end(); ++it) {
129  const std::vector<MSLane*>& lanes = (*it)->getLanes();
130  for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
131  ret.add((*it_lane)->getShape().front());
132  }
133  }
134  for (MSEdgeVector::const_iterator it = myPredecessors.begin(); it != myPredecessors.end(); ++it) {
135  const std::vector<MSLane*>& lanes = (*it)->getLanes();
136  for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
137  ret.add((*it_lane)->getShape().back());
138  }
139  }
140  }
141  ret.grow(10);
142  return ret;
143 }
144 
145 
148  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
149  buildPopupHeader(ret, app);
155  }
157  new FXMenuCommand(ret, ("segment: " + toString(segment->getIndex())).c_str(), nullptr, nullptr, 0);
158  buildPositionCopyEntry(ret, false);
159  return ret;
160 }
161 
162 
165  GUISUMOAbstractView& parent) {
166  GUIParameterTableWindow* ret = nullptr;
167  ret = new GUIParameterTableWindow(app, *this, 19);
168  // add edge items
169  ret->mkItem("length [m]", false, (*myLanes)[0]->getLength());
170  ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed());
171  ret->mkItem("brutto occupancy [%]", true, new FunctionBinding<GUIEdge, double>(this, &GUIEdge::getBruttoOccupancy, 100.));
172  ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding<GUIEdge, double>(this, &GUIEdge::getMeanSpeed));
173  ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding<GUIEdge, double>(this, &GUIEdge::getFlow));
174  ret->mkItem("routing speed [m/s]", true, new FunctionBinding<MSEdge, double>(this, &MSEdge::getRoutingSpeed));
176  ret->mkItem("vehicle ids", false, getVehicleIDs());
177  // add segment items
179  ret->mkItem("segment index", false, segment->getIndex());
180  ret->mkItem("segment queues", false, segment->numQueues());
181  ret->mkItem("segment length [m]", false, segment->getLength());
182  ret->mkItem("segment allowed speed [m/s]", false, segment->getEdge().getSpeedLimit());
183  ret->mkItem("segment jam threshold [%]", false, segment->getRelativeJamThreshold() * 100);
184  ret->mkItem("segment brutto occupancy [%]", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getRelativeOccupancy, 100));
185  ret->mkItem("segment mean vehicle speed [m/s]", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getMeanSpeed));
186  ret->mkItem("segment flow [veh/h/lane]", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getFlow));
187  ret->mkItem("segment #vehicles", true, new CastingFunctionBinding<MESegment, double, int>(segment, &MESegment::getCarNumber));
188  ret->mkItem("segment leader leave time", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getEventTimeSeconds));
189  ret->mkItem("segment headway [s]", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getLastHeadwaySeconds));
190  ret->mkItem("segment entry blocktime [s]", true, new FunctionBinding<MESegment, double>(segment, &MESegment::getEntryBlockTimeSeconds));
191 
192  // close building
193  ret->closeBuilding();
194  return ret;
195 }
196 
197 
198 Boundary
200  Boundary b = getBoundary();
201  // ensure that vehicles and persons on the side are drawn even if the edge
202  // is outside the view
203  b.grow(10);
204  return b;
205 }
206 
207 const std::string
209  return myStreetName;
210 }
211 
212 void
215  return;
216  }
217  glPushName(getGlID());
218  // draw the lanes
220  setColor(s);
221  }
222  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
223  static_cast<GUILane*>(*i)->drawGL(s);
224  }
226  if (s.scale * s.vehicleSize.getExaggeration(s, nullptr) > s.vehicleSize.minSize) {
227  drawMesoVehicles(s);
228  }
229  }
230  glPopName();
231  // (optionally) draw the name and/or the street name
232  const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNC_NORMAL;
233  const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNC_INTERNAL;
234  const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == EDGEFUNC_CROSSING || myFunction == EDGEFUNC_WALKINGAREA);
235  const bool drawStreetName = s.streetName.show && myStreetName != "";
236  const bool drawEdgeValue = s.edgeValue.show && (myFunction == EDGEFUNC_NORMAL
239  if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName || drawEdgeValue) {
240  GUILane* lane1 = dynamic_cast<GUILane*>((*myLanes)[0]);
241  GUILane* lane2 = dynamic_cast<GUILane*>((*myLanes).back());
242  if (lane1 != nullptr && lane2 != nullptr) {
243  const bool spreadSuperposed = s.spreadSuperposed && getBidiEdge() != nullptr && lane2->drawAsRailway(s);
244  Position p = lane1->getShape().positionAtOffset(lane1->getShape().length() / (double) 2.);
245  p.add(lane2->getShape().positionAtOffset(lane2->getShape().length() / (double) 2.));
246  p.mul(.5);
247  if (spreadSuperposed) {
248  // move name to the right of the edge and towards its beginning
249  const double dist = 0.6 * s.edgeName.scaledSize(s.scale);
250  const double shiftA = lane1->getShape().rotationAtOffset(lane1->getShape().length() / (double) 2.) - DEG2RAD(135);
251  Position shift(dist * cos(shiftA), dist * sin(shiftA));
252  p.add(shift);
253  }
254  double angle = s.getTextAngle(lane1->getShape().rotationDegreeAtOffset(lane1->getShape().length() / (double) 2.) + 90);
255  if (drawEdgeName) {
256  drawName(p, s.scale, s.edgeName, angle);
257  } else if (drawInternalEdgeName) {
258  drawName(p, s.scale, s.internalEdgeName, angle);
259  } else if (drawCwaEdgeName) {
260  drawName(p, s.scale, s.cwaEdgeName, angle);
261  }
262  if (drawStreetName) {
264  }
265  if (drawEdgeValue) {
266  const int activeScheme = s.getLaneEdgeMode();
267  // use value of leftmost lane to hopefully avoid sidewalks, bikelanes etc
268  double value = (MSGlobals::gUseMesoSim
269  ? getColorValue(s, activeScheme)
270  : lane2->getColorValue(s, activeScheme));
271  const RGBColor color = (MSGlobals::gUseMesoSim ? s.edgeColorer : s.laneColorer).getScheme().getColor(value);
272  if (color.alpha() != 0) {
273  GLHelper::drawTextSettings(s.edgeValue, toString(value), p, s.scale, angle);
274  }
275  }
276  }
277  }
278  if (s.scale * s.personSize.getExaggeration(s, nullptr) > s.personSize.minSize) {
279  FXMutexLock locker(myLock);
280  for (std::set<MSTransportable*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
281  GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
282  assert(person != 0);
283  person->drawGL(s);
284  }
285  }
286  if (s.scale * s.containerSize.getExaggeration(s, nullptr) > s.containerSize.minSize) {
287  FXMutexLock locker(myLock);
288  for (std::set<MSTransportable*>::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
289  GUIContainer* container = dynamic_cast<GUIContainer*>(*i);
290  assert(container != 0);
291  container->drawGL(s);
292  }
293  }
294 }
295 
296 
297 void
300  if (vehicleControl != nullptr) {
301  // draw the meso vehicles
302  vehicleControl->secureVehicles();
303  FXMutexLock locker(myLock);
304  int laneIndex = 0;
305  MESegment::Queue queue;
306  for (std::vector<MSLane*>::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) {
307  GUILane* l = static_cast<GUILane*>(*msl);
308  // go through the vehicles
309  double segmentOffset = 0; // offset at start of current segment
310  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
311  segment != nullptr; segment = segment->getNextSegment()) {
312  const double length = segment->getLength();
313  if (laneIndex < segment->numQueues()) {
314  // make a copy so we don't have to worry about synchronization
315  queue = segment->getQueue(laneIndex);
316  const int queueSize = (int)queue.size();
317  double vehiclePosition = segmentOffset + length;
318  // draw vehicles beginning with the leader at the end of the segment
319  double xOff = 0;
320  for (int i = 0; i < queueSize; ++i) {
321  GUIMEVehicle* veh = static_cast<GUIMEVehicle*>(queue[queueSize - i - 1]);
322  const double vehLength = veh->getVehicleType().getLengthWithGap();
323  while (vehiclePosition < segmentOffset) {
324  // if there is only a single queue for a
325  // multi-lane edge shift vehicles and start
326  // drawing again from the end of the segment
327  vehiclePosition += length;
328  xOff += 2;
329  }
330  const Position p = l->geometryPositionAtOffset(vehiclePosition);
331  const double angle = l->getShape().rotationAtOffset(l->interpolateLanePosToGeometryPos(vehiclePosition));
332  veh->drawOnPos(s, p, angle);
333  vehiclePosition -= vehLength;
334  }
335  }
336  segmentOffset += length;
337  }
338  glPopMatrix();
339  }
340  vehicleControl->releaseVehicles();
341  }
342 }
343 
344 
345 
346 int
348  int vehNo = 0;
349  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) {
350  vehNo += segment->getCarNumber();
351  }
352  return (int)vehNo;
353 }
354 
355 
356 std::string
358  std::string result = " ";
359  std::vector<const MEVehicle*> vehs;
360  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) {
361  std::vector<const MEVehicle*> segmentVehs = segment->getVehicles();
362  vehs.insert(vehs.end(), segmentVehs.begin(), segmentVehs.end());
363  }
364  for (std::vector<const MEVehicle*>::const_iterator it = vehs.begin(); it != vehs.end(); it++) {
365  result += (*it)->getID() + " ";
366  }
367  return result;
368 }
369 
370 
371 double
373  double flow = 0;
374  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) {
375  flow += (double) segment->getCarNumber() * segment->getMeanSpeed();
376  }
377  return 3600 * flow / (*myLanes)[0]->getLength();
378 }
379 
380 
381 double
383  double occ = 0;
384  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) {
385  occ += segment->getBruttoOccupancy();
386  }
387  return occ / (*myLanes)[0]->getLength() / (double)(myLanes->size());
388 }
389 
390 
391 double
393  return (*myLanes)[0]->getSpeedLimit();
394 }
395 
396 
397 double
399  return getMeanSpeed() / getAllowedSpeed();
400 }
401 
402 
403 void
405  myMesoColor = RGBColor(0, 0, 0); // default background color when using multiColor
406  const GUIColorer& c = s.edgeColorer;
407  if (!setFunctionalColor(c) && !setMultiColor(c)) {
409  }
410 }
411 
412 
413 bool
415  const int activeScheme = c.getActive();
416  int activeMicroScheme = -1;
417  switch (activeScheme) {
418  case 0:
419  activeMicroScheme = 0; // color uniform
420  break;
421  case 9:
422  activeMicroScheme = 18; // color by angle
423  break;
424  case 17:
425  activeMicroScheme = 30; // color by TAZ
426  break;
427  default:
428  return false;
429  }
430  GUILane* guiLane = static_cast<GUILane*>(getLanes()[0]);
431  return guiLane->setFunctionalColor(c, myMesoColor, activeMicroScheme);
432 }
433 
434 
435 bool
437  const int activeScheme = c.getActive();
438  mySegmentColors.clear();
439  switch (activeScheme) {
440  case 10: // alternating segments
441  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
442  segment != nullptr; segment = segment->getNextSegment()) {
443  mySegmentColors.push_back(c.getScheme().getColor(segment->getIndex() % 2));
444  }
445  //std::cout << getID() << " scheme=" << c.getScheme().getName() << " schemeCols=" << c.getScheme().getColors().size() << " thresh=" << toString(c.getScheme().getThresholds()) << " segmentColors=" << mySegmentColors.size() << " [0]=" << mySegmentColors[0] << " [1]=" << mySegmentColors[1] << "\n";
446  return true;
447  case 11: // by segment jammed state
448  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
449  segment != nullptr; segment = segment->getNextSegment()) {
450  mySegmentColors.push_back(c.getScheme().getColor(segment->free() ? 0 : 1));
451  }
452  return true;
453  case 12: // by segment occupancy
454  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
455  segment != nullptr; segment = segment->getNextSegment()) {
456  mySegmentColors.push_back(c.getScheme().getColor(segment->getRelativeOccupancy()));
457  }
458  return true;
459  case 13: // by segment speed
460  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
461  segment != nullptr; segment = segment->getNextSegment()) {
462  mySegmentColors.push_back(c.getScheme().getColor(segment->getMeanSpeed()));
463  }
464  return true;
465  case 14: // by segment flow
466  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
467  segment != nullptr; segment = segment->getNextSegment()) {
468  mySegmentColors.push_back(c.getScheme().getColor(3600 * segment->getCarNumber() * segment->getMeanSpeed() / segment->getLength()));
469  }
470  return true;
471  case 15: // by segment relative speed
472  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
473  segment != nullptr; segment = segment->getNextSegment()) {
474  mySegmentColors.push_back(c.getScheme().getColor(segment->getMeanSpeed() / getAllowedSpeed()));
475  }
476  return true;
477  default:
478  return false;
479  }
480 }
481 
482 
483 double
484 GUIEdge::getColorValue(const GUIVisualizationSettings& /*s*/, int activeScheme) const {
485  switch (activeScheme) {
486  case 1:
487  return gSelected.isSelected(getType(), getGlID());
488  case 2:
489  return getFunction();
490  case 3:
491  return getAllowedSpeed();
492  case 4:
493  return getBruttoOccupancy();
494  case 5:
495  return getMeanSpeed();
496  case 6:
497  return getFlow();
498  case 7:
499  return getRelativeSpeed();
500  case 8:
501  return getRoutingSpeed();
502  case 16:
504  }
505  return 0;
506 }
507 
508 
509 double
510 GUIEdge::getScaleValue(int activeScheme) const {
511  switch (activeScheme) {
512  case 1:
513  return gSelected.isSelected(getType(), getGlID());
514  case 2:
515  return getAllowedSpeed();
516  case 3:
517  return getBruttoOccupancy();
518  case 4:
519  return getMeanSpeed();
520  case 5:
521  return getFlow();
522  case 6:
523  return getRelativeSpeed();
524  case 7:
526  }
527  return 0;
528 }
529 
530 
531 MESegment*
533  const PositionVector& shape = getLanes()[0]->getShape();
534  const double lanePos = shape.nearest_offset_to_point2D(pos);
535  return MSGlobals::gMesoNet->getSegmentForEdge(*this, lanePos);
536 }
537 
538 
539 
540 void
542  const std::vector<MSLane*>& lanes = getLanes();
543  const bool isClosed = lane->isClosed();
544  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
545  GUILane* l = dynamic_cast<GUILane*>(*i);
546  if (l->isClosed() == isClosed) {
547  l->closeTraffic(false);
548  }
549  }
551  for (MSEdge* const pred : getPredecessors()) {
552  pred->rebuildAllowedTargets();
553  }
554 }
555 
556 
557 void
559  MSEdgeVector edges;
560  edges.push_back(this);
561  GUITriggeredRerouter* rr = new GUITriggeredRerouter(getID() + "_dynamic_rerouter", edges, 1, "", false, 0, "",
562  GUINet::getGUIInstance()->getVisualisationSpeedUp());
563 
566  ri.end = SUMOTime_MAX;
568  rr->myIntervals.push_back(ri);
569 
570  // trigger rerouting for vehicles already on this edge
571  const std::vector<MSLane*>& lanes = getLanes();
572  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
573  const MSLane::VehCont& vehicles = (*i)->getVehiclesSecure();
574  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
575  if ((*v)->getLane() == (*i)) {
577  } // else: this is the shadow during a continuous lane change
578  }
579  (*i)->releaseVehicles();
580  }
581 }
582 
583 
584 bool
587 }
588 /****************************************************************************/
589 
RGBColor::alpha
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition: RGBColor.h:83
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
GUIMEVehicle.h
EDGEFUNC_INTERNAL
Definition: SUMOXMLDefinitions.h:1080
RandomDistributor::add
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
Definition: RandomDistributor.h:71
GUIVisualizationSettings::edgeColorer
GUIColorer edgeColorer
The mesoscopic edge colorer.
Definition: GUIVisualizationSettings.h:429
MSTriggeredRerouter::RerouteInterval
Definition: MSTriggeredRerouter.h:92
GLHelper::drawTextSettings
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
Definition: GLHelper.cpp:701
GUIVisualizationSettings::hideConnectors
bool hideConnectors
flag to show or hidde connectors
Definition: GUIVisualizationSettings.h:462
MSEdge::myDict
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:869
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
MSEdge::getSpeedLimit
double getSpeedLimit() const
Returns the speed limit of the edge @caution The speed limit of the first lane is retured; should pro...
Definition: MSEdge.cpp:916
GUIVehicle.h
GUIEdge::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:199
GUIContainer.h
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
MSEdge::getStreetName
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:270
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
GUIVisualizationSettings::getTextAngle
double getTextAngle(double objectAngle) const
return an angle that is suitable for reading text aligned with the given angle (degrees)
Definition: GUIVisualizationSettings.cpp:1605
GUIParameterTableWindow.h
MSLaneChanger.h
MESegment
A single mesoscopic segment (cell)
Definition: MESegment.h:50
GUIVisualizationSettings::getLaneEdgeMode
int getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
Definition: GUIVisualizationSettings.cpp:1142
EDGEFUNC_CROSSING
Definition: SUMOXMLDefinitions.h:1078
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:355
GUINet::getGUIInstance
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:516
GUIGlObject::buildSelectionPopupEntry
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Definition: GUIGlObject.cpp:236
CastingFunctionBinding
Definition: CastingFunctionBinding.h:38
MSEdge::myPredecessors
MSEdgeVector myPredecessors
The preceeding edges.
Definition: MSEdge.h:797
GUIMEVehicleControl.h
GUIPerson.h
GUIEdge::setColor
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIEdge.cpp:404
MESegment::getEdge
const MSEdge & getEdge() const
Returns the edge this segment belongs to.
Definition: MESegment.h:266
GUIEdge::drawMesoVehicles
void drawMesoVehicles(const GUIVisualizationSettings &s) const
Definition: GUIEdge.cpp:298
GUIEdge::myMesoColor
RGBColor myMesoColor
Definition: GUIEdge.h:234
GUIEdge::getFlow
double getFlow() const
return flow based on meanSpead
Definition: GUIEdge.cpp:372
GUIGLObjectPopupMenu.h
GUIGlobalSelection.h
MSNet::getInsertionControl
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:390
MESegment::getRelativeOccupancy
double getRelativeOccupancy() const
Returns the relative occupany of the segment (percentage of road used))
Definition: MESegment.h:176
MSLane::VehCont
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:93
GUILane::setFunctionalColor
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
Definition: GUILane.cpp:972
SumoXMLEdgeFunc
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
Definition: SUMOXMLDefinitions.h:1074
GUIEdge::getLane
MSLane & getLane(int laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:83
MSGlobals::gUseMesoSim
static bool gUseMesoSim
Definition: MSGlobals.h:91
GUIEdge::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIEdge.cpp:213
GUIMEVehicle
A MSVehicle extended by some values for usage within the gui.
Definition: GUIMEVehicle.h:55
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:476
GUIVisualizationSettings::containerSize
GUIVisualizationSizeSettings containerSize
Definition: GUIVisualizationSettings.h:546
MSEdge.h
GUIEdge::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIEdge.cpp:484
GUIEdge::getVehicleNo
int getVehicleNo() const
Definition: GUIEdge.cpp:347
GLHelper.h
GUIEdge::getScaleValue
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
Definition: GUIEdge.cpp:510
MESegment::getEntryBlockTimeSeconds
double getEntryBlockTimeSeconds() const
get the last headway time in seconds
Definition: MESegment.h:293
GUIVisualizationSettings::vehicleSize
GUIVisualizationSizeSettings vehicleSize
Definition: GUIVisualizationSettings.h:511
MSInsertionControl.h
GUIEdge::~GUIEdge
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:74
GUINet.h
PositionVector
A list of positions.
Definition: PositionVector.h:46
GUIEdge::getAllowedSpeed
double getAllowedSpeed() const
Definition: GUIEdge.cpp:392
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:48
MSTriggeredRerouter::RerouteInterval::edgeProbs
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
Definition: MSTriggeredRerouter.h:106
MSEdge::getLength
double getLength() const
return the length of the edge
Definition: MSEdge.h:582
GUILane::closeTraffic
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
Definition: GUILane.cpp:1290
GUIMEVehicleControl
The class responsible for building and deletion of vehicles (gui-version)
Definition: GUIMEVehicleControl.h:41
MSEdge::isNormal
bool isNormal() const
return whether this edge is an internal edge
Definition: MSEdge.h:228
GUIEdge::closeTraffic
void closeTraffic(const GUILane *lane)
close this edge for traffic
Definition: GUIEdge.cpp:541
GUIParameterTableWindow::closeBuilding
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Definition: GUIParameterTableWindow.cpp:220
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
GUINet::getGUIMEVehicleControl
GUIMEVehicleControl * getGUIMEVehicleControl()
Returns the vehicle control.
Definition: GUINet.cpp:543
GUITriggeredRerouter
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
Definition: GUITriggeredRerouter.h:51
GUIMainWindow.h
MESegment.h
GUILane::isClosed
bool isClosed() const
Definition: GUILane.h:251
MSEdge::isInternal
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:233
GUISUMOAbstractView.h
GUIEdge::addRerouter
void addRerouter()
add a rerouter
Definition: GUIEdge.cpp:558
GUIBaseVehicle::drawOnPos
void drawOnPos(const GUIVisualizationSettings &s, const Position &pos, const double angle) const
Draws the object on the specified position with the specified angle.
Definition: GUIBaseVehicle.cpp:331
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:809
GUIVisualizationSettings::drawCrossingsAndWalkingareas
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
Definition: GUIVisualizationSettings.h:567
RGBColor
Definition: RGBColor.h:40
GUIVisualizationSettings::internalEdgeName
GUIVisualizationTextSettings internalEdgeName
Definition: GUIVisualizationSettings.h:459
MSTriggeredRerouter::notifyEnter
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Tries to reroute the vehicle.
Definition: MSTriggeredRerouter.cpp:364
MSTriggeredRerouter::mySpecialDest_keepDestination
static MSEdge mySpecialDest_keepDestination
special destination values
Definition: MSTriggeredRerouter.h:253
GUIContainer::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIContainer.cpp:215
GUILane::getShape
const PositionVector & getShape() const
Definition: GUILane.cpp:899
MSEdge::myLanes
const std::vector< MSLane * > * myLanes
Container for the edge's lane; should be sorted: (right-hand-traffic) the more left the lane,...
Definition: MSEdge.h:769
GUIEdge::getSegmentAtPosition
MESegment * getSegmentAtPosition(const Position &pos)
returns the segment closest to the given position
Definition: GUIEdge.cpp:532
MSEdge::getMeanSpeed
double getMeanSpeed() const
get the mean speed
Definition: MSEdge.cpp:750
MESegment::getMeanSpeed
double getMeanSpeed() const
wrapper to satisfy the FunctionBinding signature
Definition: MESegment.h:201
MESegment::getEventTimeSeconds
double getEventTimeSeconds() const
Like getEventTime but returns seconds (for visualization)
Definition: MESegment.h:283
GUIGlObject::buildNameCopyPopupEntry
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Definition: GUIGlObject.cpp:226
MSJunction.h
MSVehicleType::getLengthWithGap
double getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
Definition: MSVehicleType.h:118
GUIContainer
Definition: GUIContainer.h:52
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:80
GUILane::drawAsRailway
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition: GUILane.cpp:1263
GUIMEVehicleControl::releaseVehicles
void releaseVehicles()
unlock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:95
EDGEFUNC_WALKINGAREA
Definition: SUMOXMLDefinitions.h:1079
GUILane.h
GUIEdge::GUIEdge
GUIEdge(const std::string &id, int numericalID, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, double distance)
Constructor.
Definition: GUIEdge.cpp:66
GUIEdge::setMultiColor
bool setMultiColor(const GUIColorer &c) const
sets multiple colors according to the current scheme index and edge function
Definition: GUIEdge.cpp:436
GUIParameterTableWindow::mkItem
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Definition: GUIParameterTableWindow.h:109
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:284
MSEdge::isTazConnector
bool isTazConnector() const
Definition: MSEdge.h:256
PositionVector::positionAtOffset
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:246
PositionVector::rotationDegreeAtOffset
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Definition: PositionVector.cpp:311
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
MESegment::getFlow
double getFlow() const
returns flow based on headway
Definition: MESegment.cpp:707
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
MSLane::interpolateLanePosToGeometryPos
double interpolateLanePosToGeometryPos(double lanePos) const
Definition: MSLane.h:499
MSInsertionControl::getPendingEmits
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
Definition: MSInsertionControl.cpp:300
MELoop::getSegmentForEdge
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
Definition: MELoop.cpp:293
GUIEdge::getRelativeSpeed
double getRelativeSpeed() const
return meanSpead divided by allowedSpeed
Definition: GUIEdge.cpp:398
MSEdge::getFunction
SumoXMLEdgeFunc getFunction() const
Returns the edge type (SumoXMLEdgeFunc)
Definition: MSEdge.h:223
CastingFunctionBinding.h
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:623
MESegment::getLastHeadwaySeconds
double getLastHeadwaySeconds() const
get the last headway time in seconds
Definition: MESegment.h:288
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GLO_EDGE
an edge
Definition: GUIGlObjectTypes.h:47
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
MSGlobals.h
MSEdge::getBidiEdge
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:247
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:76
GUIVisualizationSettings::personSize
GUIVisualizationSizeSettings personSize
Definition: GUIVisualizationSettings.h:529
EDGEFUNC_CONNECTOR
Definition: SUMOXMLDefinitions.h:1077
GUIEdge::getVehicleIDs
std::string getVehicleIDs() const
Definition: GUIEdge.cpp:357
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:69
GUIGlObject
Definition: GUIGlObject.h:66
MSBaseVehicle::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:118
EDGEFUNC_NORMAL
Definition: SUMOXMLDefinitions.h:1076
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:188
GUIEdge::getOptionalName
const std::string getOptionalName() const
Returns the street name.
Definition: GUIEdge.cpp:208
Position::mul
void mul(double val)
Multiplies both positions with the given value.
Definition: Position.h:107
MSEdge::getRoutingSpeed
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:797
GUIVisualizationSizeSettings::minSize
double minSize
The minimum size to draw this object.
Definition: GUIVisualizationSettings.h:104
DEG2RAD
#define DEG2RAD(x)
Definition: GeomHelper.h:38
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:208
GUIVisualizationSettings::streetName
GUIVisualizationTextSettings streetName
Definition: GUIVisualizationSettings.h:459
GUIEdge::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of myPersons/ myContainers.
Definition: GUIEdge.h:232
MSTriggeredRerouter::RerouteInterval::begin
SUMOTime begin
The begin time these definitions are valid.
Definition: MSTriggeredRerouter.h:96
GUIEdge::setFunctionalColor
bool setFunctionalColor(const GUIColorer &c) const
sets the color according to the current scheme index and some edge function
Definition: GUIEdge.cpp:414
GLIncludes.h
GUIVisualizationSettings::cwaEdgeName
GUIVisualizationTextSettings cwaEdgeName
Definition: GUIVisualizationSettings.h:459
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GUILane
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:62
GUIEdge::getParameterWindow
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIEdge.cpp:164
FunctionBinding.h
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
GUIMainWindow
Definition: GUIMainWindow.h:47
MSGlobals::gMesoNet
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Definition: MSGlobals.h:106
MSEdge::mySuccessors
MSEdgeVector mySuccessors
The succeeding edges.
Definition: MSEdge.h:792
GUIEdge
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:53
MESegment::getLength
double getLength() const
Returns the length of the segment in meters.
Definition: MESegment.h:160
PositionVector::rotationAtOffset
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
Definition: PositionVector.cpp:286
GUIPerson::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:277
GUIPerson
Definition: GUIPerson.h:54
GUIEdge.h
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:72
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:249
GUIEdge::getTotalLength
static double getTotalLength(bool includeInternal, bool eachLane)
Definition: GUIEdge.cpp:105
MESegment::numQueues
int numQueues() const
return the number of queues
Definition: MESegment.h:129
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:34
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:217
GUIGlObject::buildPositionCopyEntry
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Definition: GUIGlObject.cpp:267
MEVehicle.h
MESegment::getRelativeJamThreshold
double getRelativeJamThreshold() const
Returns the relative occupany of the segment (percentage of road used)) at which the segment is consi...
Definition: MESegment.h:184
MSEdge::myContainers
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:807
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:165
MESegment::Queue
std::vector< MEVehicle * > Queue
Definition: MESegment.h:79
GUIEdge::getBruttoOccupancy
double getBruttoOccupancy() const
Definition: GUIEdge.cpp:382
MSTriggeredRerouter::myIntervals
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
Definition: MSTriggeredRerouter.h:218
config.h
GUILane::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUILane.cpp:1049
GUIEdge::getIDs
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:90
Position::add
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:127
GUIVisualizationSettings::laneColorer
GUIColorer laneColorer
The lane colorer.
Definition: GUIVisualizationSettings.h:438
GeomHelper.h
GUITriggeredRerouter.h
GUIVisualizationSettings::spreadSuperposed
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
Definition: GUIVisualizationSettings.h:477
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
MSLane::geometryPositionAtOffset
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:505
MELoop.h
SUMOTime_MAX
#define SUMOTime_MAX
Definition: SUMOTime.h:36
GUIVisualizationSettings::drawJunctionShape
bool drawJunctionShape
whether the shape of the junction should be drawn
Definition: GUIVisualizationSettings.h:565
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GUIMEVehicleControl::secureVehicles
void secureVehicles()
lock access to vehicle removal/additions for thread synchronization
Definition: GUIMEVehicleControl.cpp:89
FunctionBinding
Definition: FunctionBinding.h:41
MSBaseVehicle.h
MSTriggeredRerouter::RerouteInterval::end
SUMOTime end
The end time these definitions are valid.
Definition: MSTriggeredRerouter.h:98
GUIEdge::mySegmentColors
std::vector< RGBColor > mySegmentColors
The color of the segments (cached)
Definition: GUIEdge.h:218
MESegment::getIndex
int getIndex() const
Returns the running index of the segment in the edge (0 is the most upstream).
Definition: MESegment.h:144
MSEdge::myPersons
std::set< MSTransportable * > myPersons
Persons on the edge for drawing and pushbutton.
Definition: MSEdge.h:804
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSMoveReminder::NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
Definition: MSMoveReminder.h:93
GUIEdge::isSelected
bool isSelected() const
whether this lane is selected in the GUI
Definition: GUIEdge.cpp:585
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:111
GUIVisualizationSettings::edgeName
GUIVisualizationTextSettings edgeName
Definition: GUIVisualizationSettings.h:459
GUIVisualizationSettings::edgeValue
GUIVisualizationTextSettings edgeValue
Definition: GUIVisualizationSettings.h:459
GUIEdge::getPopUpMenu
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIEdge.cpp:147
MSEdge::myStreetName
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:825
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:76
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
MESegment::getCarNumber
int getCarNumber() const
Returns the total number of cars on the segment.
Definition: MESegment.h:124
MSEdge::rebuildAllowedLanes
void rebuildAllowedLanes()
Definition: MSEdge.cpp:268
GUIEdge::getBoundary
Boundary getBoundary() const
Returns the street's geometry.
Definition: GUIEdge.cpp:119
MSEdge::myFunction
const SumoXMLEdgeFunc myFunction
the purpose of the edge
Definition: MSEdge.h:775
GUIPropertySchemeStorage< GUIColorScheme >
MSEdge::getPredecessors
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:352
GUISelectedStorage::isSelected
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Definition: GUISelectedStorage.cpp:95