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