SUMO - Simulation of Urban MObility
GUINet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // A MSNet extended by some values for usage within the gui
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 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 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <utility>
33 #include <set>
34 #include <vector>
35 #include <map>
43 #include <utils/common/RGBColor.h>
45 #include <microsim/MSNet.h>
46 #include <microsim/MSJunction.h>
48 #include <microsim/MSEdge.h>
54 #include <guisim/GUIEdge.h>
55 #include <guisim/GUILane.h>
63 #include <gui/GUIGlobals.h>
64 #include "GUINet.h"
65 
66 #ifdef HAVE_INTERNAL
67 #include <mesogui/GUIMEVehicleControl.h>
68 #endif
69 
70 #ifdef CHECK_MEMORY_LEAKS
71 #include <foreign/nvwa/debug_new.h>
72 #endif // CHECK_MEMORY_LEAKS
73 
74 
75 // ===========================================================================
76 // definition of static variables used for visualisation of objects' values
77 // ===========================================================================
78 template std::vector< GLObjectValuePassConnector<SUMOReal>* > GLObjectValuePassConnector<SUMOReal>::myContainer;
80 
81 template std::vector< GLObjectValuePassConnector<std::pair<int, class MSPhaseDefinition> >* > GLObjectValuePassConnector<std::pair<int, class MSPhaseDefinition> >::myContainer;
83 
84 
85 // ===========================================================================
86 // member method definitions
87 // ===========================================================================
88 GUINet::GUINet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents,
89  MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents) :
90  MSNet(vc, beginOfTimestepEvents, endOfTimestepEvents, insertionEvents, new GUIShapeContainer(myGrid)),
92  myLastSimDuration(0), /*myLastVisDuration(0),*/ myLastIdleDuration(0),
93  myLastVehicleMovementCount(0), myOverallVehicleCount(0), myOverallSimDuration(0) {
95 }
96 
97 
99  if (myLock.locked()) {
100  myLock.unlock();
101  }
102  // delete allocated wrappers
103  // of junctions
104  for (std::vector<GUIJunctionWrapper*>::iterator i1 = myJunctionWrapper.begin(); i1 != myJunctionWrapper.end(); i1++) {
105  delete(*i1);
106  }
107  // of additional structures
109  // of tl-logics
110  for (Logics2WrapperMap::iterator i3 = myLogics2Wrapper.begin(); i3 != myLogics2Wrapper.end(); i3++) {
111  delete(*i3).second;
112  }
113  // of detectors
114  for (std::vector<GUIDetectorWrapper*>::iterator i = myDetectorDict.begin(); i != myDetectorDict.end(); ++i) {
115  delete *i;
116  }
117 }
118 
119 
120 const Boundary&
122  return myBoundary;
123 }
124 
125 
128  if (myPersonControl == 0) {
130  }
131  return *myPersonControl;
132 }
133 
134 
137  if (myContainerControl == 0) {
139  }
140  return *myContainerControl;
141 }
142 
143 
144 void
146  // get the list of loaded tl-logics
147  const std::vector<MSTrafficLightLogic*>& logics = getTLSControl().getAllLogics();
148  // allocate storage for the wrappers
149  myTLLogicWrappers.reserve(logics.size());
150  // go through the logics
151  for (std::vector<MSTrafficLightLogic*>::const_iterator i = logics.begin(); i != logics.end(); ++i) {
152  createTLWrapper(*i);
153  }
154 }
155 
156 
157 GUIGlID
159  if (myLogics2Wrapper.count(tll) > 0) {
160  return myLogics2Wrapper[tll]->getGlID();
161  }
162  // get the links
163  const MSTrafficLightLogic::LinkVectorVector& links = tll->getLinks();
164  if (links.size() == 0) { // @legacy this should never happen in 0.13.0+ networks
165  return 0;
166  }
167  // build the wrapper
170  // build the association link->wrapper
171  MSTrafficLightLogic::LinkVectorVector::const_iterator j;
172  for (j = links.begin(); j != links.end(); ++j) {
173  MSTrafficLightLogic::LinkVector::const_iterator j2;
174  for (j2 = (*j).begin(); j2 != (*j).end(); ++j2) {
175  myLinks2Logic[*j2] = tll->getID();
176  }
177  }
179  myLogics2Wrapper[tll] = tllw;
180  return tllw->getGlID();
181 }
182 
183 
184 Position
185 GUINet::getJunctionPosition(const std::string& name) const {
186  // !!! no check for existance!
187  return myJunctions->get(name)->getPosition();
188 }
189 
190 
191 bool
192 GUINet::vehicleExists(const std::string& name) const {
193  return myVehicleControl->getVehicle(name) != 0;
194 }
195 
196 
197 unsigned int
199  if (myLinks2Logic.count(link) == 0) {
200  assert(false);
201  return 0;
202  }
203  MSTrafficLightLogic* tll = myLogics->getActive(myLinks2Logic.find(link)->second);
204  if (myLogics2Wrapper.count(tll) == 0) {
205  // tll may have been added via traci. @see ticket #459
206  return 0;
207  }
208  return myLogics2Wrapper.find(tll)->second->getGlID();
209 }
210 
211 
212 int
214  Links2LogicMap::const_iterator i = myLinks2Logic.find(link);
215  if (i == myLinks2Logic.end()) {
216  return -1;
217  }
218  if (myLogics2Wrapper.find(myLogics->getActive((*i).second)) == myLogics2Wrapper.end()) {
219  return -1;
220  }
221  return myLogics2Wrapper.find(myLogics->getActive((*i).second))->second->getLinkIndex(link);
222 }
223 
224 
225 void
230 }
231 
232 
233 void
237 }
238 
239 
240 std::vector<GUIGlID>
241 GUINet::getJunctionIDs(bool includeInternal) const {
242  std::vector<GUIGlID> ret;
243  for (std::vector<GUIJunctionWrapper*>::const_iterator i = myJunctionWrapper.begin(); i != myJunctionWrapper.end(); ++i) {
244  if (!(*i)->isInner() || includeInternal) {
245  ret.push_back((*i)->getGlID());
246  }
247  }
248  return ret;
249 }
250 
251 
252 std::vector<GUIGlID>
254  std::vector<GUIGlID> ret;
255  std::vector<std::string> ids;
256  for (std::map<MSTrafficLightLogic*, GUITrafficLightLogicWrapper*>::const_iterator i = myLogics2Wrapper.begin(); i != myLogics2Wrapper.end(); ++i) {
257  std::string sid = (*i).second->getMicrosimID();
258  if (find(ids.begin(), ids.end(), sid) == ids.end()) {
259  ret.push_back((*i).second->getGlID());
260  ids.push_back(sid);
261  }
262  }
263  return ret;
264 }
265 
266 
267 void
269  // initialise detector storage for gui
270  const std::vector<SumoXMLTag> types = myDetectorControl->getAvailableTypes();
271  for (std::vector<SumoXMLTag>::const_iterator i = types.begin(); i != types.end(); ++i) {
272  const std::map<std::string, MSDetectorFileOutput*>& dets = myDetectorControl->getTypedDetectors(*i).getMyMap();
273  for (std::map<std::string, MSDetectorFileOutput*>::const_iterator j = dets.begin(); j != dets.end(); ++j) {
274  GUIDetectorWrapper* wrapper = (*j).second->buildDetectorGUIRepresentation();
275  if (wrapper != 0) {
276  myDetectorDict.push_back(wrapper);
277  myGrid.addAdditionalGLObject(wrapper);
278  }
279  }
280  }
281  // initialise the tl-map
282  initTLMap();
283  // initialise edge storage for gui
285  // initialise junction storage for gui
286  size_t size = myJunctions->size();
287  myJunctionWrapper.reserve(size);
288  const std::map<std::string, MSJunction*>& junctions = myJunctions->getMyMap();
289  for (std::map<std::string, MSJunction*>::const_iterator i = junctions.begin(); i != junctions.end(); ++i) {
290  myJunctionWrapper.push_back(new GUIJunctionWrapper(*(*i).second));
291  }
292  // build the visualization tree
293  float* cmin = new float[2];
294  float* cmax = new float[2];
295  for (std::vector<GUIEdge*>::iterator i = myEdgeWrapper.begin(); i != myEdgeWrapper.end(); ++i) {
296  GUIEdge* edge = *i;
297  Boundary b;
298  const std::vector<MSLane*>& lanes = edge->getLanes();
299  for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
300  b.add((*j)->getShape().getBoxBoundary());
301  }
302  // make sure persons are always drawn and selectable since they depend on their edge being drawn
304  cmin[0] = b.xmin();
305  cmin[1] = b.ymin();
306  cmax[0] = b.xmax();
307  cmax[1] = b.ymax();
308  myGrid.Insert(cmin, cmax, edge);
309  myBoundary.add(b);
310  if (myBoundary.getWidth() > 10e16 || myBoundary.getHeight() > 10e16) {
311  throw ProcessError("Network size exceeds 1 Lightyear. Please reconsider your inputs.\n");
312  }
313  }
314  for (std::vector<GUIJunctionWrapper*>::iterator i = myJunctionWrapper.begin(); i != myJunctionWrapper.end(); ++i) {
315  GUIJunctionWrapper* junction = *i;
316  Boundary b = junction->getBoundary();
317  b.grow(2.);
318  cmin[0] = b.xmin();
319  cmin[1] = b.ymin();
320  cmax[0] = b.xmax();
321  cmax[1] = b.ymax();
322  myGrid.Insert(cmin, cmax, junction);
323  myBoundary.add(b);
324  }
325  delete[] cmin;
326  delete[] cmax;
328 }
329 
330 
331 unsigned int
333  return myLastSimDuration +/*myLastVisDuration+*/myLastIdleDuration;
334 }
335 
336 
337 unsigned int
339  return myLastSimDuration;
340 }
341 
342 /*
343 int
344 GUINet::getVisDuration() const
345 {
346  return myLastVisDuration;
347 }
348 */
349 
350 
351 SUMOReal
353  if (myLastSimDuration == 0) {
354  return -1;
355  }
356  return (SUMOReal) 1000. / (SUMOReal) myLastSimDuration;
357 }
358 
359 
360 SUMOReal
361 GUINet::getUPS() const {
362  if (myLastSimDuration == 0) {
363  return -1;
364  }
366 }
367 
368 
369 SUMOReal
370 GUINet::getMeanRTFactor(int duration) const {
371  if (myOverallSimDuration == 0) {
372  return -1;
373  }
374  return ((SUMOReal)(duration) * (SUMOReal) 1000. / (SUMOReal)myOverallSimDuration);
375 }
376 
377 
378 SUMOReal
380  if (myOverallSimDuration == 0) {
381  return -1;
382  }
384 }
385 
386 
387 unsigned int
389  return myLastIdleDuration;
390 }
391 
392 
393 void
395  myLastSimDuration = val;
396  myOverallSimDuration += val;
399 }
400 
401 /*
402 void
403 GUINet::setVisDuration(int val)
404 {
405  myLastVisDuration = val;
406 }
407 */
408 
409 void
411  myLastIdleDuration = val;
412 }
413 
414 
417  GUISUMOAbstractView& parent) {
418  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
419  buildPopupHeader(ret, app);
422  buildPositionCopyEntry(ret, false);
423  return ret;
424 }
425 
426 
431  new GUIParameterTableWindow(app, *this, 19);
432  // add items
433  ret->mkItem("loaded vehicles [#]", true,
435  ret->mkItem("waiting vehicles [#]", true,
437  ret->mkItem("departed vehicles [#]", true,
439  ret->mkItem("running vehicles [#]", true,
441  ret->mkItem("arrived vehicles [#]", true,
443  ret->mkItem("collisions [#]", true,
445  ret->mkItem("teleports [#]", true,
447  ret->mkItem("end time [s]", false, OptionsCont::getOptions().getString("end"));
448  ret->mkItem("begin time [s]", false, OptionsCont::getOptions().getString("begin"));
449 // ret->mkItem("time step [s]", true, new FunctionBinding<GUINet, SUMOTime>(this, &GUINet::getCurrentTimeStep));
450  if (logSimulationDuration()) {
451  ret->mkItem("step duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getWholeDuration));
452  ret->mkItem("simulation duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getSimDuration));
453  /*
454  ret->mkItem("visualisation duration [ms]", true,
455  new CastingFunctionBinding<GUINet, SUMOReal, int>(
456  &(getNet()), &GUINet::getVisDuration));
457  */
458  ret->mkItem("idle duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getIdleDuration));
459  ret->mkItem("duration factor []", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getRTFactor));
460  /*
461  ret->mkItem("mean duration factor []", true,
462  new FuncBinding_IntParam<GUINet, SUMOReal>(
463  &(getNet()), &GUINet::getMeanRTFactor), 1);
464  */
465  ret->mkItem("ups [#]", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getUPS));
466  ret->mkItem("mean ups [#]", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getMeanUPS));
467  }
468  ret->mkItem("nodes [#]", false, (int)myJunctions->size());
469  ret->mkItem("edges [#]", false, (int)GUIEdge::getIDs(false).size());
470  ret->mkItem("total edge length [km]", false, GUIEdge::getTotalLength(false, false) / 1000);
471  ret->mkItem("total lane length [km]", false, GUIEdge::getTotalLength(false, true) / 1000);
472 
473  // close building
474  ret->closeBuilding();
475  return ret;
476 }
477 
478 
479 void
481 }
482 
483 Boundary
485  return getBoundary();
486 }
487 
488 
489 GUINet*
491  GUINet* net = dynamic_cast<GUINet*>(MSNet::getInstance());
492  if (net != 0) {
493  return net;
494  }
495  throw ProcessError("A gui-network was not yet constructed.");
496 }
497 
498 
501  return dynamic_cast<GUIVehicleControl*>(myVehicleControl);
502 }
503 
504 
505 void
507  myLock.lock();
508 }
509 
510 
511 void
513  myLock.unlock();
514 }
515 
516 #ifdef HAVE_INTERNAL
517 GUIMEVehicleControl*
518 GUINet::getGUIMEVehicleControl() {
519  return dynamic_cast<GUIMEVehicleControl*>(myVehicleControl);
520 }
521 #endif
522 
523 
524 #ifdef HAVE_OSG
525 void
526 GUINet::updateColor(const GUIVisualizationSettings& s) {
527  for (std::vector<GUIEdge*>::const_iterator i = myEdgeWrapper.begin(); i != myEdgeWrapper.end(); ++i) {
528  if ((*i)->getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) {
529  const std::vector<MSLane*>& lanes = (*i)->getLanes();
530  for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
531  static_cast<GUILane*>(*j)->updateColor(s);
532  }
533  }
534  }
535  for (std::vector<GUIJunctionWrapper*>::iterator i = myJunctionWrapper.begin(); i != myJunctionWrapper.end(); ++i) {
536  (*i)->updateColor(s);
537  }
538 }
539 #endif
540 
541 /****************************************************************************/
542 
Boundary getBoundary() const
Returns the boundary of the junction.
Boundary myBoundary
The networks boundary.
Definition: GUINet.h:322
SUMOReal getHeight() const
Returns the height of the boundary.
Definition: Boundary.cpp:142
The class responsible for building and deletion of vehicles (gui-version)
SUMOReal getWidth() const
Returns the width of the boudary.
Definition: Boundary.cpp:136
unsigned int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
std::vector< GUIJunctionWrapper * > myJunctionWrapper
Wrapped MS-junctions.
Definition: GUINet.h:328
unsigned int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
Storage for geometrical objects extended by mutexes.
SUMOReal getMeanRTFactor(int duration) const
Returns the simulation speed as a factor to real time.
Definition: GUINet.cpp:370
friend class GUITrafficLightLogicWrapper
Definition: GUINet.h:92
void unlock()
release exclusive access to the simulation state
Definition: GUINet.cpp:512
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:186
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
Definition: MSNet.h:605
SUMOReal ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:124
Stores the information about how to visualize structures.
LayeredRTree myGrid
The visualization speed-up.
Definition: GUINet.h:319
void initTLMap()
Initialises the tl-logic map and wrappers.
Definition: GUINet.cpp:145
SUMOReal xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:112
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
MSTrafficLightLogic * getActive(const std::string &id) const
Returns the active program of a named tls.
MSPersonControl * myPersonControl
Controls person building and deletion;.
Definition: MSNet.h:607
~GUINet()
Destructor.
Definition: GUINet.cpp:98
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:159
void initGUIStructures()
Initialises gui wrappers.
Definition: GUINet.cpp:268
void lock()
grant exclusive access to the simulation state
Definition: GUINet.cpp:506
unsigned int getWholeDuration() const
Returns the duration of the last step (sim+visualisation+idle) (in ms)
Definition: GUINet.cpp:332
Links2LogicMap myLinks2Logic
The link-to-logic-id map.
Definition: GUINet.h:340
Position getJunctionPosition(const std::string &name) const
returns the position of a junction
Definition: GUINet.cpp:185
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
std::vector< GUIDetectorWrapper * > myDetectorDict
A detector dictionary.
Definition: GUINet.h:334
long myOverallVehicleCount
Definition: GUINet.h:352
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.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUINet.cpp:480
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:115
SUMOReal xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:118
const Boundary & getBoundary() const
returns the bounder of the network
Definition: GUINet.cpp:121
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
void setIdleDuration(int val)
Sets the duration of the last step's idle part.
Definition: GUINet.cpp:410
The simulated network and simulation perfomer.
Definition: MSNet.h:94
void setNetObject(GUIGlObject *object)
Sets the given object as the "network" object.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
SUMOLong myVehiclesMoved
The overall number of vehicle movements.
Definition: MSNet.h:650
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
T get(const std::string &id) const
Retrieves an item.
unsigned int getCollisionCount() const
return the number of collisions
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUINet.cpp:416
Logics2WrapperMap myLogics2Wrapper
The traffic light-to-wrapper map.
Definition: GUINet.h:346
#define new
Definition: debug_new.h:123
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:61
const std::string & getID() const
Returns the id.
Definition: Named.h:60
SUMOReal getUPS() const
Returns the update per seconds rate.
Definition: GUINet.cpp:361
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
unsigned int getLoadedVehicleNo() const
Returns the number of build vehicles.
GUIGlID createTLWrapper(MSTrafficLightLogic *tll)
creates a wrapper for the given logic and returns the GlID
Definition: GUINet.cpp:158
std::vector< GUIGlID > getJunctionIDs(bool includeInternal) const
Definition: GUINet.cpp:241
std::vector< LinkVector > LinkVectorVector
Definition of a list that holds lists of links that do have the same attribute.
unsigned int getTeleportCount() const
return the number of teleports (including collisions)
unsigned int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUINet.cpp:428
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:490
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:349
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:288
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
MSDetectorControl * myDetectorControl
Controls detectors;.
Definition: MSNet.h:619
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
Definition: MSNet.h:615
int getLinkTLIndex(MSLink *link) const
Definition: GUINet.cpp:213
static void clearDictionary()
Clears the dictionary (the objects will not be deleted)
unsigned int size() const
Returns the number of items within the container.
std::vector< MSTrafficLightLogic * > myTLLogicWrappers
Wrapped TL-Logics.
Definition: GUINet.h:331
unsigned int myLastIdleDuration
Definition: GUINet.h:350
MSContainerControl * myContainerControl
Controls container building and deletion;.
Definition: MSNet.h:609
unsigned int getSimDuration() const
Returns the duration of the last step's simulation part (in ms)
Definition: GUINet.cpp:338
const IDMap & getMyMap() const
unsigned int GUIGlID
Definition: GUIGlObject.h:48
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
void setSimDuration(int val)
Sets the duration of the last step's simulation part.
Definition: GUINet.cpp:394
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:100
std::vector< GUIEdge * > myEdgeWrapper
Wrapped MS-edges.
Definition: GUINet.h:325
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:76
const std::vector< SumoXMLTag > getAvailableTypes() const
Returns the list of available detector types.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Definition: Boundary.cpp:200
static const SUMOReal SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk ...
Definition: MSPModel.h:84
void Insert(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Insert entry (delegate to appropriate layer)
Definition: LayeredRTree.h:79
GUI-version of the container control for building gui containers.
unsigned int getIdleDuration() const
Returns the duration of the last step's idle part (in ms)
Definition: GUINet.cpp:388
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
Definition: MSNet.h:613
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:90
SUMOReal getMeanUPS() const
Returns the update per seconds rate.
Definition: GUINet.cpp:379
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
Definition: SUMORTree.h:129
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:329
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:71
long myOverallSimDuration
Definition: GUINet.h:353
The popup menu of a globject.
GUIVehicleControl * getGUIVehicleControl()
Returns the vehicle control.
Definition: GUINet.cpp:500
std::vector< GUIGlID > getTLSIDs() const
Returns the gl-ids of all traffic light logics within the net.
Definition: GUINet.cpp:253
bool vehicleExists(const std::string &name) const
returns the information whether the vehicle still exists
Definition: GUINet.cpp:192
void lock()
lock mutex
Definition: MFXMutex.cpp:86
unsigned int getEndedVehicleNo() const
Returns the number of removed vehicles.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
The network - empty.
unsigned int myLastSimDuration
The step durations (simulation, /*visualisation, */idle)
Definition: GUINet.h:350
unsigned int getLinkTLID(MSLink *link) const
Definition: GUINet.cpp:198
static void updateAll()
Updates all instances.
The parent class for traffic light logics.
#define SUMOReal
Definition: config.h:218
SUMOReal getRTFactor() const
Returns the simulation speed as a factor to real time.
Definition: GUINet.cpp:352
static void updateAll()
Updates all instances (passes values)
GUI-version of the person control for building gui persons.
SUMOReal ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:130
void simulationStep()
Performs a single simulation step (locking the simulation)
Definition: GUINet.cpp:234
FXbool locked()
Definition: MFXMutex.h:70
bool logSimulationDuration() const
Returns whether duration shall be logged.
Definition: MSNet.cpp:652
The class responsible for building and deletion of vehicles.
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
void simulationStep()
Performs a single simulation step.
Definition: MSNet.cpp:387
The edge is an internal edge.
Definition: MSEdge.h:98
GUINet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents)
Constructor.
Definition: GUINet.cpp:88
void guiSimulationStep()
Some further steps needed for gui processing.
Definition: GUINet.cpp:226
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
void closeBuilding()
Closes the building of the table.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUINet.cpp:484
MSContainerControl & getContainerControl()
Returns the container control.
Definition: GUINet.cpp:136
A window containing a gl-object's parameter.
Stores time-dependant events and executes them at the proper time.
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:140
long myLastVehicleMovementCount
Definition: GUINet.h:352
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUINet.h:357
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const Position & getPosition() const
Definition: MSJunction.cpp:61
MSPersonControl & getPersonControl()
Returns the person control.
Definition: GUINet.cpp:127
Class passing values from a GUIGlObject to another object.