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