84 myLastSimDuration(0), myLastIdleDuration(0),
85 myLastVehicleMovementCount(0), myOverallVehicleCount(0), myOverallSimDuration(0) {
143 for (std::vector<MSTrafficLightLogic*>::const_iterator i = logics.begin(); i != logics.end(); ++i) {
156 if (links.size() == 0) {
163 MSTrafficLightLogic::LinkVectorVector::const_iterator j;
164 for (j = links.begin(); j != links.end(); ++j) {
165 MSTrafficLightLogic::LinkVector::const_iterator j2;
166 for (j2 = (*j).begin(); j2 != (*j).end(); ++j2) {
233 std::vector<GUIGlID> ret;
235 if (!(*i)->isInternal() || includeInternal) {
236 ret.push_back((*i)->getGlID());
245 std::vector<GUIGlID> ret;
246 std::vector<std::string> ids;
248 std::string sid = (*i).second->getMicrosimID();
249 if (find(ids.begin(), ids.end(), sid) == ids.end()) {
250 ret.push_back((*i).second->getGlID());
262 for (std::vector<SumoXMLTag>::const_iterator i = types.begin(); i != types.end(); ++i) {
276 for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
278 if (!(*i)->isTazConnector() || (*i)->getLanes().size() > 0) {
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());
298 const float cmin[2] = { (float)b.
xmin(), (float)b.
ymin() };
299 const float cmax[2] = { (float)b.
xmax(), (float)b.
ymax() };
303 throw ProcessError(
"Network size exceeds 1 Lightyear. Please reconsider your inputs.\n");
310 const float cmin[2] = { (float)b.
xmin(), (float)b.
ymin() };
311 const float cmax[2] = { (float)b.
xmax(), (float)b.
ymax() };
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 ret->
mkItem(
"halting [#]",
true,
437 ret->
mkItem(
"avg. speed [m/s]",
true,
439 ret->
mkItem(
"avg. relative speed",
true,
442 ret->
mkItem(
"loaded persons [#]",
true,
444 ret->
mkItem(
"running persons [#]",
true,
446 ret->
mkItem(
"jammed persons [#]",
true,
511 throw ProcessError(
"A gui-network was not yet constructed.");
542 if (!(*i)->isInternal()) {
543 const std::vector<MSLane*>& lanes = (*i)->getLanes();
544 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
545 static_cast<GUILane*
>(*j)->updateColor(s);
550 (*i)->updateColor(s);
Boundary getBoundary() const
Returns the boundary of the junction.
int getIdleDuration() const
Returns the duration of the last step's idle part (in ms)
double getAvgWalkTimeLoss() const
int myLastSimDuration
The step durations (simulation, /*visualisation, */idle)
double xmax() const
Returns maximum x-coordinate.
int getTeleportCount() const
return the number of teleports (including collisions)
Boundary myBoundary
The networks boundary.
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.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
std::vector< GUIJunctionWrapper * > myJunctionWrapper
Wrapped MS-junctions.
Storage for geometrical objects extended by mutexes.
friend class GUITrafficLightLogicWrapper
void unlock()
release exclusive access to the simulation state
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
int getLinkTLID(MSLink *link) const
double ymax() const
Returns maximum y-coordinate.
Stores the information about how to visualize structures.
LayeredRTree myGrid
The visualization speed-up.
void initTLMap()
Initialises the tl-logic map and wrappers.
double getMeanRTFactor(int duration) const
Returns the simulation speed as a factor to real time.
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.
The class responsible for building and deletion of vehicles (gui-version)
double getAvgDepartDelay() const
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double getAvgDuration() const
int getCollisionCount() const
return the number of collisions
void initGUIStructures()
Initialises gui wrappers.
static const double SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk ...
int getEndedVehicleNo() const
Returns the number of removed vehicles.
double myVersion
the network version
double getMeanUPS() const
Returns the update per seconds rate.
void lock()
grant exclusive access to the simulation state
Links2LogicMap myLinks2Logic
The link-to-logic-id map.
Position getJunctionPosition(const std::string &name) const
returns the position of a junction
double getAvgWalkDuration() const
double getAvgWalkRouteLength() const
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
long myOverallVehicleCount
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.
GUIGlID getGlID() const
Returns the numerical id of the object.
const Boundary & getBoundary() const
returns the bounder of the network
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
A class that stores a 2D geometrical boundary.
void setIdleDuration(int val)
Sets the duration of the last step's idle part.
The simulated network and simulation perfomer.
void setNetObject(GUIGlObject *object)
Sets the given object as the "network" object.
static OptionsCont & getOptions()
Retrieves the options.
Representation of a lane in the micro simulation (gui-version)
T get(const std::string &id) const
Retrieves an item.
double getVehicleMeanSpeedRelative() const
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Logics2WrapperMap myLogics2Wrapper
The traffic light-to-wrapper map.
double getUPS() const
Returns the update per seconds rate.
A road/street connecting two junctions (gui-version)
const std::string & getID() const
Returns the id.
long long int myVehiclesMoved
The overall number of vehicle movements.
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
double getWidth() const
Returns the width of the boudary (x-axis)
std::vector< GUIGlID > getJunctionIDs(bool includeInternal) const
std::vector< LinkVector > LinkVectorVector
Definition of a list that holds lists of links that do have the same attribute.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
std::vector< GUIDetectorWrapper * > myDetectorWrapper
A detector dictionary.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
double getHeight() const
Returns the height of the boundary (y-axis)
A point in 2D or 3D with translation and scaling methods.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
MSDetectorControl * myDetectorControl
Controls detectors;.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
double getVehicleMeanSpeed() const
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
double getAvgWaitingTime() const
int getLinkTLIndex(MSLink *link) const
static void clearDictionary()
Clears the dictionary (the objects will not be deleted)
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
int getHaltingVehicleNumber() const
count number of standing vehicles in the network
double getRTFactor() const
Returns the simulation speed as a factor to real time.
Boundary & grow(double by)
extends the boundary by the given amount
double getAvgRouteLength() const
MSTransportableControl & getPersonControl()
Returns the person control.
void unlock()
release mutex lock
void setSimDuration(int val)
Sets the duration of the last step's simulation part.
static std::vector< GUIGlID > getIDs(bool includeInternal)
std::vector< GUIEdge * > myEdgeWrapper
Wrapped MS-edges.
const std::vector< SumoXMLTag > getAvailableTypes() const
Returns the list of available detector types.
void Insert(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Insert entry (delegate to appropriate layer)
double getAvgTimeLoss() const
MSTransportableControl * myContainerControl
Controls container building and deletion;.
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
A MSNet extended by some values for usage within the gui.
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
MSTransportableControl * myPersonControl
Controls person building and deletion;.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
double xmin() const
Returns minimum x-coordinate.
int getLoadedVehicleNo() const
Returns the number of build vehicles.
long myOverallSimDuration
int getSimDuration() const
Returns the duration of the last step's simulation part (in ms)
GUIVehicleControl * getGUIVehicleControl()
Returns the vehicle control.
std::vector< GUIGlID > getTLSIDs() const
Returns the gl-ids of all traffic light logics within the net.
bool vehicleExists(const std::string &name) const
returns the information whether the vehicle still exists
double ymin() const
Returns minimum y-coordinate.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
int getJammedNumber() const
Returns the number of times a transportables was jammed.
std::vector< MSTrafficLightLogic * > myTLLogicWrapper
Wrapped TL-Logics.
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)
bool logSimulationDuration() const
Returns whether duration shall be logged.
The class responsible for building and deletion of vehicles.
std::vector< MSEdge * > MSEdgeVector
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
void simulationStep()
Performs a single simulation step.
double getAvgTripSpeed() const
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
GUINet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents)
Constructor.
static double getTotalLength(bool includeInternal, bool eachLane)
void guiSimulationStep()
Some further steps needed for gui processing.
int getWholeDuration() const
Returns the duration of the last step (sim+visualisation+idle) (in ms)
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
A window containing a gl-object's parameter.
Stores time-dependant events and executes them at the proper time.
long myLastVehicleMovementCount
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
MSTransportableControl & getContainerControl()
Returns the container control.
const Position & getPosition() const
int size() const
Returns the number of stored 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. ...