#include <GUINet.h>

This gui version of the network allows the retrieval of some more information than the normal network version does. Due to this, not only these retrieval, but also some further initialisation methods must have been implemented. Nonethenless, this class has almost the same functions as the MSNet-class.
Some microsimulation items are wrapped in certain classes to allow their drawing and their enumerated access. This enumeration is realised by inserting the wrapped items into vectors and is needed to fasten the network's drawing as only visible items are being drawn.
Definition at line 87 of file GUINet.h.
Notification about vehicle state changes | |
| void | addVehicleStateListener (VehicleStateListener *listener) throw () |
| Adds a vehicle states listener. | |
| void | informVehicleStateListener (const MSVehicle *const vehicle, VehicleState to) throw () |
| Informs all added listeners about a vehicle's state change. | |
| void | removeVehicleStateListener (VehicleStateListener *listener) throw () |
| Removes a vehicle states listener. | |
| enum | VehicleState { VEHICLE_STATE_BUILT, VEHICLE_STATE_DEPARTED, VEHICLE_STATE_STARTING_TELEPORT, VEHICLE_STATE_ENDING_TELEPORT, VEHICLE_STATE_ARRIVED } |
| Definition of a vehicle state. More... | |
Public Types | |
| enum | SimulationState { SIMSTATE_RUNNING, SIMSTATE_END_STEP_REACHED, SIMSTATE_NO_FURTHER_VEHICLES, SIMSTATE_CONNECTION_CLOSED, SIMSTATE_ERROR_IN_SIM, SIMSTATE_TOO_MANY_VEHICLES } |
| Possible states of a simulation - running or stopped with different reasons. More... | |
Public Member Functions | |
| virtual bool | active () const throw () |
| Returns the information whether this object is still active. | |
| void | closeBuilding (MSEdgeControl *edges, MSJunctionControl *junctions, MSRouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles) throw () |
| Closes the network's building process. | |
| void | closeSimulation (SUMOTime start) |
| Closes the simulation (all files, connections, etc.). | |
| const Boundary & | getBoundary () const |
| returns the bounder of the network | |
| SUMOTime | getCurrentTimeStep () const |
| Returns the current simulation step (in s). | |
| Boundary | getEdgeBoundary (const std::string &name) const |
| returns the boundary of an edge | |
| Position2D | getJunctionPosition (const std::string &name) const |
| returns the position of a junction | |
| GUINet (MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *emissionEvents) throw (ProcessError) | |
| Constructor. | |
| void | guiSimulationStep () |
| Some further steps needed for gui processing. | |
| void | initGUIStructures () |
| Initialises gui wrappers. | |
| bool | logSimulationDuration () const throw () |
| Returns whether duration shall be logged. | |
| int | simulate (SUMOTime start, SUMOTime stop) |
| Simulates from timestep start to stop. | |
| SimulationState | simulationState (SUMOTime stopTime) const throw () |
| Called after a simulation step, this method returns the current simulation state. | |
| void | simulationStep () |
| Performs a single simulation step. | |
| bool | vehicleExists (const std::string &name) const |
| returns the information whether the vehicle still exists | |
| void | writeOutput () |
| Write netstate, emission and detector output. | |
| ~GUINet () throw () | |
| Destructor. | |
Insertion and retrieval of bus stops | |
| bool | addBusStop (MSBusStop *busStop) throw () |
| Adds a bus stop. | |
| MSBusStop * | getBusStop (const std::string &id) throw () |
| Returns the named bus stop. | |
| std::string | getBusStopID (const MSLane *lane, const SUMOReal pos) throw () |
| Returns the bus stop close to the given position. | |
inherited from GUIGlObject | |
| void | drawGL (const GUIVisualizationSettings &s) const throw () |
| Draws the object. | |
| Boundary | getCenteringBoundary () const throw () |
| Returns the boundary to which the view shall be centered in order to show the object. | |
| const std::string & | getMicrosimID () const throw () |
| Returns the id of the object as known to microsim. | |
| GUIParameterTableWindow * | getParameterWindow (GUIMainWindow &app, GUISUMOAbstractView &parent) throw () |
| Returns an own parameter window. | |
| GUIGLObjectPopupMenu * | getPopUpMenu (GUIMainWindow &app, GUISUMOAbstractView &parent) throw () |
| Returns an own popup-menu. | |
| GUIGlObjectType | getType () const throw () |
| Returns the type of the object as coded in GUIGlObjectType. | |
Retrieval of references to substructures | |
| MSEventControl & | getBeginOfTimestepEvents () throw () |
| Returns the event control for events executed at the begin of a time step. | |
| MSDetectorControl & | getDetectorControl () throw () |
| Returns the detector control. | |
| MSEdgeControl & | getEdgeControl () throw () |
| Returns the edge control. | |
| MSEventControl & | getEmissionEvents () throw () |
| Returns the event control for emission events. | |
| MSEmitControl & | getEmitControl () throw () |
| Returns the emission control. | |
| MSEventControl & | getEndOfTimestepEvents () throw () |
| Returns the event control for events executed at the end of a time step. | |
| MSJunctionControl & | getJunctionControl () throw () |
| Returns the junctions control. | |
| MSPersonControl & | getPersonControl () throw () |
| Returns the person control. | |
| ShapeContainer & | getShapeContainer () throw () |
| Returns the shapes container. | |
| MSTLLogicControl & | getTLSControl () throw () |
| Returns the tls logics control. | |
| MSVehicleControl & | getVehicleControl () throw () |
| Returns the vehicle control. | |
| MSEdgeWeightsStorage & | getWeightsStorage () throw () |
| Returns the net's internal edge travel times/efforts container. | |
Atomar getter methods | |
| const std::string & | getFullName () const throw () |
| Returns the full name appearing in the tool tip. | |
| GLuint | getGlID () const throw () |
| Returns the numerical id of the object. | |
functions for performance measurements | |
| unsigned int | getIdleDuration () const throw () |
| Returns the duration of the last step's idle part (in ms). | |
| unsigned int | getLinkTLID (MSLink *link) const |
| int | getLinkTLIndex (MSLink *link) const |
| SUMOReal | getMeanRTFactor (int duration) const |
| Returns the simulation speed as a factor to real time. | |
| SUMOReal | getMeanUPS () const |
| Returns the update per seconds rate. | |
| SUMOReal | getRTFactor () const |
| Returns the simulation speed as a factor to real time. | |
| unsigned int | getSimDuration () const throw () |
| Returns the duration of the last step's simulation part (in ms). | |
| SUMOReal | getUPS () const |
| Returns the update per seconds rate. | |
| unsigned int | getWholeDuration () const throw () |
| Returns the duration of the last step (sim+visualisation+idle) (in ms). | |
| void | setIdleDuration (int val) |
| Sets the duration of the last step's idle part. | |
| void | setSimDuration (int val) |
| Sets the duration of the last step's simulation part. | |
locator-methods | |
| std::vector< GLuint > | getJunctionIDs () const |
| Returns the gl-ids of all junctions within the net. | |
| std::vector< GLuint > | getShapeIDs () const |
| Returns the gl-ids of all shapes within the net. | |
| std::vector< GLuint > | getTLSIDs () const |
| Returns the gl-ids of all traffic light logics within the net. | |
Output during the simulation | |
| void | postSimStepOutput () const throw () |
| Prints the statistics of the step at its end. | |
| void | preSimStepOutput () const throw () |
| Prints the current step number. | |
Static Public Member Functions | |
| static void | clearAll () |
| Clears all dictionaries. | |
| static MSNet * | getInstance () throw (ProcessError) |
| Returns the pointer to the unique instance of MSNet (singleton). | |
| static std::string | getStateMessage (SimulationState state) throw () |
| Returns the message to show if a certain state occurs. | |
Protected Types | |
| typedef std::map< std::string, MSBusStop * > | BusStopDictType |
| Bus stop dictionary type. | |
| typedef std::map< MSLink *, std::string > | Links2LogicMap |
| Definition of a link-to-logic-id map. | |
| typedef std::map < MSTrafficLightLogic *, GUITrafficLightLogicWrapper * > | Logics2WrapperMap |
| Definition of a traffic light-to-wrapper map. | |
Protected Member Functions | |
helper methods for building popup-menus | |
| void | buildCenterPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds an entry which allows to center to the object. | |
| void | buildNameCopyPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds entries which allow to copy the name / typed name into the clipboard. | |
| void | buildPopupHeader (GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true) throw () |
| Builds the header. | |
| void | buildPositionCopyEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds an entry which allows to copy the cursor position. | |
| void | buildSelectionPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds an entry which allows to (de)select the object. | |
| void | buildShowManipulatorPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds an entry which allows to open the manipulator window. | |
| void | buildShowParamsPopupEntry (GUIGLObjectPopupMenu *ret, bool addSeparator=true) throw () |
| Builds an entry which allows to open the parameter window. | |
Protected Attributes | |
| Boundary | myBoundary |
| the networks boundary | |
| BusStopDictType | myBusStopDict |
| Dictionary of bus stops. | |
| std::map< std::string, GUIDetectorWrapper * > | myDetectorDict |
| A detector dictionary. | |
| std::vector< GUIEdge * > | myEdgeWrapper |
| Wrapped MS-edges. | |
| SUMORTree * | myGrid |
| The visualization speed-up. | |
| std::vector< GUIJunctionWrapper * > | myJunctionWrapper |
| Wrapped MS-junctions. | |
| unsigned int | myLastIdleDuration |
| unsigned int | myLastSimDuration |
| The step durations (simulation, /*visualisation, */idle). | |
| long | myLastVehicleMovementCount |
| Links2LogicMap | myLinks2Logic |
| The link-to-logic-id map. | |
| Logics2WrapperMap | myLogics2Wrapper |
| The traffic light-to-wrapper map. | |
| long | myOverallSimDuration |
| long | myOverallVehicleCount |
| MSRouteLoaderControl * | myRouteLoaders |
| Route loader for dynamic loading of routes. | |
| SUMOTime | myStep |
| Current time step. | |
| std::vector < MSTrafficLightLogic * > | myTLLogicWrappers |
| Wrapped TL-Logics. | |
| int | myTooManyVehicles |
| Storage for maximum vehicle number. | |
| std::vector < VehicleStateListener * > | myVehicleStateListeners |
| Container for vehicle state listener. | |
Substructures | |
| MSEventControl * | myBeginOfTimestepEvents |
| Controls events executed at the begin of a time step;. | |
| MSDetectorControl * | myDetectorControl |
| Controls detectors;. | |
| MSEdgeControl * | myEdges |
| Controls edges, performs vehicle movement;. | |
| MSEdgeWeightsStorage * | myEdgeWeights |
| The net's knowledge about edge efforts/travel times;. | |
| MSEventControl * | myEmissionEvents |
| Controls emission events;. | |
| MSEmitControl * | myEmitter |
| Controls vehicle emissions;. | |
| MSEventControl * | myEndOfTimestepEvents |
| Controls events executed at the end of a time step;. | |
| MSJunctionControl * | myJunctions |
| Controls junctions, realizes right-of-way rules;. | |
| MSTLLogicControl * | myLogics |
| Controls tls logics, realizes waiting on tls rules;. | |
| MSPersonControl * | myPersonControl |
| Controls person building and deletion;. | |
| ShapeContainer * | myShapeContainer |
| A container for geometrical shapes;. | |
| MSVehicleControl * | myVehicleControl |
| Controls vehicle building and deletion;. | |
data needed for computing performance values | |
| bool | myLogExecutionTime |
| Information whether the simulation duration shall be logged. | |
| bool | myLogStepNumber |
| Information whether the number of the simulation step shall be logged. | |
| long | mySimBeginMillis |
| The overall simulation duration. | |
| long | mySimStepBegin |
| The last simulation step begin, end and duration. | |
| long | mySimStepDuration |
| long | mySimStepEnd |
| long | myVehiclesMoved |
| The overall number of vehicle movements. | |
State output variables | |
| std::vector< std::string > | myStateDumpFiles |
| The names for the state files. | |
| std::vector< SUMOTime > | myStateDumpTimes |
| Times at which a state shall be written. | |
Static Protected Attributes | |
| static MSNet * | myInstance = 0 |
| Unique instance of MSNet. | |
Private Member Functions | |
| void | initDetectors () |
| Initialises the detector wrappers. | |
| void | initTLMap () |
| Initialises the tl-logic map and wrappers. | |
Friends | |
| class | GUIGlObjectStorage |
| Needed to set the id. | |
| class | GUIViewTraffic |
typedef std::map< std::string, MSBusStop* > MSNet::BusStopDictType [protected, inherited] |
typedef std::map<MSLink*, std::string> GUINet::Links2LogicMap [protected] |
typedef std::map<MSTrafficLightLogic*, GUITrafficLightLogicWrapper*> GUINet::Logics2WrapperMap [protected] |
enum MSNet::SimulationState [inherited] |
Possible states of a simulation - running or stopped with different reasons.
Definition at line 89 of file MSNet.h.
00089 { 00091 SIMSTATE_RUNNING, 00093 SIMSTATE_END_STEP_REACHED, 00095 SIMSTATE_NO_FURTHER_VEHICLES, 00097 SIMSTATE_CONNECTION_CLOSED, 00099 SIMSTATE_ERROR_IN_SIM, 00101 SIMSTATE_TOO_MANY_VEHICLES 00102 };
enum MSNet::VehicleState [inherited] |
Definition of a vehicle state.
Definition at line 436 of file MSNet.h.
00436 { 00438 VEHICLE_STATE_BUILT, 00440 VEHICLE_STATE_DEPARTED, 00442 VEHICLE_STATE_STARTING_TELEPORT, 00444 VEHICLE_STATE_ENDING_TELEPORT, 00446 VEHICLE_STATE_ARRIVED 00447 };
| GUINet::GUINet | ( | MSVehicleControl * | vc, | |
| MSEventControl * | beginOfTimestepEvents, | |||
| MSEventControl * | endOfTimestepEvents, | |||
| MSEventControl * | emissionEvents | |||
| ) | throw (ProcessError) |
Constructor.
| [in] | vc | The vehicle control to use |
| [in] | beginOfTimestepEvents | The event control to use for simulation step begin events |
| [in] | endOfTimestepEvents | The event control to use for simulation step end events |
| [in] | emissionEvents | The event control to use for emission events |
| ProcessError | If a network was already constructed |
Definition at line 75 of file GUINet.cpp.
References MSCORN::CORN_VEH_SAVEREROUTING, GUIGlObjectStorage::gIDStorage, GUIGlObjectStorage::setNetObject(), and MSCORN::setWished().
00077 : MSNet(vc, beginOfTimestepEvents, endOfTimestepEvents, emissionEvents, new GUIShapeContainer()), 00078 GUIGlObject(GUIGlObjectStorage::gIDStorage, "network"), 00079 myGrid(new SUMORTree(&GUIGlObject::drawGL)), 00080 myLastSimDuration(0), /*myLastVisDuration(0),*/ myLastIdleDuration(0), 00081 myLastVehicleMovementCount(0), myOverallVehicleCount(0), myOverallSimDuration(0) { 00082 GUIGlObjectStorage::gIDStorage.setNetObject(this); 00083 // as it is possible to show all vehicle routes, we have to store them... (bug [ 2519761 ]) 00084 MSCORN::setWished(MSCORN::CORN_VEH_SAVEREROUTING); 00085 }
| GUINet::~GUINet | ( | ) | throw () |
Destructor.
Definition at line 88 of file GUINet.cpp.
References GUIGlObjectStorage::clear(), GUIGlObject_AbstractAdd::clearDictionary(), GUIGlObjectStorage::gIDStorage, myDetectorDict, myGrid, myJunctionWrapper, and myLogics2Wrapper.
00088 { 00089 GUIGlObjectStorage::gIDStorage.clear(); 00090 // delete allocated wrappers 00091 // of junctions 00092 for (std::vector<GUIJunctionWrapper*>::iterator i1=myJunctionWrapper.begin(); i1!=myJunctionWrapper.end(); i1++) { 00093 delete(*i1); 00094 } 00095 // of addition structures 00096 GUIGlObject_AbstractAdd::clearDictionary(); 00097 // of tl-logics 00098 for (Logics2WrapperMap::iterator i3=myLogics2Wrapper.begin(); i3!=myLogics2Wrapper.end(); i3++) { 00099 delete(*i3).second; 00100 } 00101 // of detectors 00102 for (std::map<std::string, GUIDetectorWrapper*>::iterator i=myDetectorDict.begin(); i!=myDetectorDict.end(); ++i) { 00103 delete(*i).second; 00104 } 00105 // the visualization tree 00106 delete myGrid; 00107 }
| virtual bool GUIGlObject::active | ( | ) | const throw () [inline, virtual, inherited] |
Returns the information whether this object is still active.
Reimplemented in GUIVehicle.
Definition at line 171 of file GUIGlObject.h.
Referenced by GLObjectValuePassConnector< std::pair< int, MSPhaseDefinition > >::updateEachTimestep().
Adds a bus stop.
If another bus stop with the same id exists, false is returned. Otherwise, the bus stop is added to the internal bus stop container "myBusStopDict".
This control get responsible for deletion of the added bus stop.
| [in] | busStop | The bus stop to add |
Definition at line 392 of file MSNet.h.
References MSNet::myBusStopDict.
00392 { 00393 if (myBusStopDict.find(busStop->getID()) == myBusStopDict.end()) { 00394 myBusStopDict[busStop->getID()] = busStop; 00395 return true; 00396 } 00397 return false; 00398 }
| void MSNet::addVehicleStateListener | ( | VehicleStateListener * | listener | ) | throw () [inherited] |
Adds a vehicle states listener.
| [in] | listener | The listener to add |
Definition at line 617 of file MSNet.cpp.
References MSNet::myVehicleStateListeners.
Referenced by traci::TraCIServer::TraCIServer().
00617 { 00618 if (find(myVehicleStateListeners.begin(), myVehicleStateListeners.end(), listener)==myVehicleStateListeners.end()) { 00619 myVehicleStateListeners.push_back(listener); 00620 } 00621 }
| void GUIGlObject::buildCenterPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to center to the object.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 86 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_RECENTERVIEW, and MID_CENTER.
Referenced by GUIVehicle::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon2D::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and GUIBusStop::getPopUpMenu().
00087 { 00088 new FXMenuCommand(ret, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), ret, MID_CENTER); 00089 if (addSeparator) { 00090 new FXMenuSeparator(ret); 00091 } 00092 }
| void GUIGlObject::buildNameCopyPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds entries which allow to copy the name / typed name into the clipboard.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 96 of file GUIGlObject.cpp.
References MID_COPY_NAME, and MID_COPY_TYPED_NAME.
Referenced by GUIVehicle::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon2D::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and GUIBusStop::getPopUpMenu().
00097 { 00098 new FXMenuCommand(ret, "Copy name to clipboard", 0, ret, MID_COPY_NAME); 00099 new FXMenuCommand(ret, "Copy typed name to clipboard", 0, ret, MID_COPY_TYPED_NAME); 00100 if (addSeparator) { 00101 new FXMenuSeparator(ret); 00102 } 00103 }
| void GUIGlObject::buildPopupHeader | ( | GUIGLObjectPopupMenu * | ret, | |
| GUIMainWindow & | app, | |||
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds the header.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 75 of file GUIGlObject.cpp.
References GUIGlObject::getFullName().
Referenced by GUIVehicle::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon2D::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and GUIBusStop::getPopUpMenu().
00077 { 00078 new MFXMenuHeader(ret, app.getBoldFont(), getFullName().c_str(), 0, 0, 0); 00079 if (addSeparator) { 00080 new FXMenuSeparator(ret); 00081 } 00082 }
| void GUIGlObject::buildPositionCopyEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to copy the cursor position.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 131 of file GUIGlObject.cpp.
References MID_COPY_CURSOR_POSITION.
Referenced by GUIVehicle::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon2D::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and GUIBusStop::getPopUpMenu().
00132 { 00133 new FXMenuCommand(ret, "Copy cursor position to clipboard", 0, ret, MID_COPY_CURSOR_POSITION); 00134 if (addSeparator) { 00135 new FXMenuSeparator(ret); 00136 } 00137 }
| void GUIGlObject::buildSelectionPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to (de)select the object.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 107 of file GUIGlObject.cpp.
References GUIGlObject::getGlID(), GUIIconSubSys::getIcon(), GUIGlObject::getType(), gSelected, ICON_FLAG_MINUS, ICON_FLAG_PLUS, GUISelectedStorage::isSelected(), MID_ADDSELECT, and MID_REMOVESELECT.
Referenced by GUIVehicle::getPopUpMenu(), GUITriggeredRerouter::getPopUpMenu(), GUITrafficLightLogicWrapper::getPopUpMenu(), GUIPolygon2D::getPopUpMenu(), GUIPointOfInterest::getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIJunctionWrapper::getPopUpMenu(), GUIEmitter::getPopUpMenu(), GUIEdge::getPopUpMenu(), GUIDetectorWrapper::getPopUpMenu(), and GUIBusStop::getPopUpMenu().
00108 { 00109 if (gSelected.isSelected(getType(), getGlID())) { 00110 new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), ret, MID_REMOVESELECT); 00111 } else { 00112 new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(ICON_FLAG_PLUS), ret, MID_ADDSELECT); 00113 } 00114 if (addSeparator) { 00115 new FXMenuSeparator(ret); 00116 } 00117 }
| void GUIGlObject::buildShowManipulatorPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to open the manipulator window.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 141 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_MANIP, and MID_MANIP.
Referenced by GUITriggeredRerouter::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), and GUIEmitter::getPopUpMenu().
00142 { 00143 new FXMenuCommand(ret, "Open Manipulator...", 00144 GUIIconSubSys::getIcon(ICON_MANIP), ret, MID_MANIP); 00145 if (addSeparator) { 00146 new FXMenuSeparator(ret); 00147 } 00148 }
| void GUIGlObject::buildShowParamsPopupEntry | ( | GUIGLObjectPopupMenu * | ret, | |
| bool | addSeparator = true | |||
| ) | throw () [protected, inherited] |
Builds an entry which allows to open the parameter window.
| in,filled] | ret The popup menu to add the entry to | |
| [in] | app | The application, needed for callbacks |
| [in] | addSeparator | Whether a separator shall be added, too |
Definition at line 121 of file GUIGlObject.cpp.
References GUIIconSubSys::getIcon(), ICON_APP_TABLE, and MID_SHOWPARS.
Referenced by GUIVehicle::getPopUpMenu(), getPopUpMenu(), GUILaneWrapper::getPopUpMenu(), GUILaneSpeedTrigger::getPopUpMenu(), GUIEdge::getPopUpMenu(), and GUIDetectorWrapper::getPopUpMenu().
00122 { 00123 new FXMenuCommand(ret, "Show Parameter", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPARS); 00124 if (addSeparator) { 00125 new FXMenuSeparator(ret); 00126 } 00127 }
| void MSNet::clearAll | ( | ) | [static, inherited] |
Clears all dictionaries.
Definition at line 465 of file MSNet.cpp.
References MSRoute::clear(), MSLane::clear(), MSEdge::clear(), and MSVehicleTransfer::getInstance().
Referenced by GUILoadThread::run(), and MSNet::~MSNet().
00465 { 00466 // clear container 00467 MSEdge::clear(); 00468 MSLane::clear(); 00469 MSRoute::clear(); 00470 delete MSVehicleTransfer::getInstance(); 00471 }
| void MSNet::closeBuilding | ( | MSEdgeControl * | edges, | |
| MSJunctionControl * | junctions, | |||
| MSRouteLoaderControl * | routeLoaders, | |||
| MSTLLogicControl * | tlc, | |||
| std::vector< SUMOTime > | stateDumpTimes, | |||
| std::vector< std::string > | stateDumpFiles | |||
| ) | throw () [inherited] |
Closes the network's building process.
Assigns the structures built while loading to this network.
| [in] | edges | The control of edges which belong to this network |
| [in] | junctions | The control of junctions which belong to this network |
| [in] | routeLoaders | The route loaders used |
| [in] | tlc | The control of traffic lights which belong to this network |
| [in] | stateDumpTimes | List of time steps at which state shall be written |
| [in] | stateDumpFiles | Filenames for states |
Definition at line 191 of file MSNet.cpp.
References MSCORN::CORN_OUT_EMISSIONS, MSCORN::CORN_OUT_OLDROUTES, MSCORN::CORN_OUT_TAZ, MSCORN::CORN_OUT_TRIPDURATIONS, MSCORN::CORN_OUT_VEHROUTES, MSCORN::CORN_VEH_SAVE_EDGE_EXIT, SysUtils::getCurrentMillis(), OptionsCont::getOptions(), MSNet::myEdges, MSNet::myJunctions, MSNet::myLogExecutionTime, MSNet::myLogics, MSNet::myRouteLoaders, MSNet::mySimBeginMillis, MSNet::myStateDumpFiles, MSNet::myStateDumpTimes, MSJunctionControl::postloadInitContainer(), and MSCORN::setWished().
Referenced by NLBuilder::buildNet().
00195 { 00196 myEdges = edges; 00197 myJunctions = junctions; 00198 myRouteLoaders = routeLoaders; 00199 myLogics = tlc; 00200 // save the time the network state shall be saved at 00201 myStateDumpTimes = stateDumpTimes; 00202 myStateDumpFiles = stateDumpFiles; 00203 00204 // set requests/responses 00205 myJunctions->postloadInitContainer(); 00206 // initialise outputs 00207 if (OptionsCont::getOptions().isSet("emissions-output")) { 00208 MSCORN::setWished(MSCORN::CORN_OUT_EMISSIONS); 00209 } 00210 if (OptionsCont::getOptions().isSet("tripinfo-output")) { 00211 MSCORN::setWished(MSCORN::CORN_OUT_TRIPDURATIONS); 00212 } 00213 if (OptionsCont::getOptions().isSet("vehroute-output")) { 00214 MSCORN::setWished(MSCORN::CORN_OUT_VEHROUTES); 00215 if (OptionsCont::getOptions().getBool("vehroute-output.exit-times")) { 00216 MSCORN::setWished(MSCORN::CORN_VEH_SAVE_EDGE_EXIT); 00217 } 00218 if (!OptionsCont::getOptions().getBool("vehroute-output.last-route")) { 00219 MSCORN::setWished(MSCORN::CORN_OUT_OLDROUTES); 00220 } 00221 if (OptionsCont::getOptions().getBool("device.routing.with-taz")) { 00222 MSCORN::setWished(MSCORN::CORN_OUT_TAZ); 00223 } 00224 } 00225 00226 // initialise performance computation 00227 if (myLogExecutionTime) { 00228 mySimBeginMillis = SysUtils::getCurrentMillis(); 00229 } 00230 }
| void MSNet::closeSimulation | ( | SUMOTime | start | ) | [inherited] |
Closes the simulation (all files, connections, etc.).
Writes also performance output
| [in] | start | The step the simulation was started with |
Definition at line 302 of file MSNet.cpp.
References traci::TraCIServer::close(), MSDetectorControl::close(), SysUtils::getCurrentMillis(), MSVehicleControl::getEmittedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), MSEmitControl::getWaitingVehicleNo(), MSNet::myDetectorControl, MSNet::myEmitter, MSNet::myLogExecutionTime, MSNet::mySimBeginMillis, MSNet::myStep, MSNet::myVehicleControl, MSNet::myVehiclesMoved, SUMOReal, and WRITE_MESSAGE.
Referenced by GUIRunThread::deleteSim(), and MSNet::simulate().
00302 { 00303 if (myLogExecutionTime) { 00304 long duration = SysUtils::getCurrentMillis() - mySimBeginMillis; 00305 std::ostringstream msg; 00306 msg << "Performance: " << "\n" << " Duration: " << duration << " ms" << "\n"; 00307 if (duration!=0) { 00308 msg << " Real time factor: " << ((SUMOReal)(myStep-start)*1000./(SUMOReal)duration) << "\n"; 00309 msg.setf(std::ios::fixed , std::ios::floatfield); // use decimal format 00310 msg.setf(std::ios::showpoint); // print decimal point 00311 msg << " UPS: " << ((SUMOReal) myVehiclesMoved * 1000. / (SUMOReal) duration) << "\n"; 00312 } 00313 msg << "Vehicles: " << "\n" 00314 << " Emitted: " << myVehicleControl->getEmittedVehicleNo() << "\n" 00315 << " Running: " << myVehicleControl->getRunningVehicleNo() << "\n" 00316 << " Waiting: " << myEmitter->getWaitingVehicleNo() << "\n"; 00317 WRITE_MESSAGE(msg.str()); 00318 } 00319 myDetectorControl->close(myStep); 00320 #ifndef NO_TRACI 00321 traci::TraCIServer::close(); 00322 #endif 00323 }
| void GUINet::drawGL | ( | const GUIVisualizationSettings & | s | ) | const throw () [virtual] |
Draws the object.
| [in] | s | The settings for the current view (may influence drawing) |
Implements GUIGlObject.
Definition at line 509 of file GUINet.cpp.
| MSEventControl& MSNet::getBeginOfTimestepEvents | ( | ) | throw () [inline, inherited] |
Returns the event control for events executed at the begin of a time step.
Definition at line 333 of file MSNet.h.
References MSNet::myBeginOfTimestepEvents.
Referenced by NLTriggerBuilder::buildVaporizer(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTLLogicControl::closeWAUT(), MSDevice_Routing::enterLaneAtEmit(), MSLaneSpeedTrigger::init(), and MSTrafficLightLogic::MSTrafficLightLogic().
00333 { 00334 return *myBeginOfTimestepEvents; 00335 }
| const Boundary & GUINet::getBoundary | ( | ) | const |
returns the bounder of the network
Definition at line 111 of file GUINet.cpp.
References myBoundary.
Referenced by getCenteringBoundary().
00111 { 00112 return myBoundary; 00113 }
| MSBusStop* MSNet::getBusStop | ( | const std::string & | id | ) | throw () [inline, inherited] |
Returns the named bus stop.
| [in] | id | The id of the bus stop to return. |
Definition at line 405 of file MSNet.h.
References MSNet::myBusStopDict.
Referenced by MSVehicle::addStop(), and MSRouteHandler::myStartElement().
00405 { 00406 BusStopDictType::iterator it = myBusStopDict.find(id); 00407 if (it == myBusStopDict.end()) { 00408 return 0; 00409 } 00410 return it->second; 00411 }
| std::string MSNet::getBusStopID | ( | const MSLane * | lane, | |
| const SUMOReal | pos | |||
| ) | throw () [inline, inherited] |
Returns the bus stop close to the given position.
| [in] | lane | the lane of the bus stop to return. |
| [in] | pos | the position of the bus stop to return. |
Definition at line 419 of file MSNet.h.
References MSBusStop::getEndLanePosition(), Named::getID(), MSBusStop::getLane(), MSNet::myBusStopDict, and POSITION_EPS.
Referenced by MSVehicle::addTraciStop().
00419 { 00420 for (BusStopDictType::iterator it = myBusStopDict.begin(); it != myBusStopDict.end(); ++it) { 00421 MSBusStop *stop = it->second; 00422 if (&stop->getLane() == lane && fabs(stop->getEndLanePosition() - pos) < POSITION_EPS) { 00423 return stop->getID(); 00424 } 00425 } 00426 return ""; 00427 }
| Boundary GUINet::getCenteringBoundary | ( | ) | const throw () [virtual] |
Returns the boundary to which the view shall be centered in order to show the object.
Implements GUIGlObject.
Definition at line 513 of file GUINet.cpp.
References getBoundary().
00513 { 00514 return getBoundary(); 00515 }
| SUMOTime MSNet::getCurrentTimeStep | ( | ) | const [inherited] |
Returns the current simulation step (in s).
Definition at line 475 of file MSNet.cpp.
References MSNet::myStep.
Referenced by MSVehicle::adaptSpeed(), traci::TraCIServer::addSubscription(), MSTLLogicControl::addWAUTJunction(), NLDetectorBuilder::buildE2Detector(), MSEmitter::childCheckEmit(), MSCalibrator::childCheckEmit(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSTLLogicControl::closeWAUT(), MSInductLoop::collectVehiclesOnDet(), traci::TraCIServer::commandAddVehicle(), traci::TraCIServer::commandChangeRoute(), traci::TraCIServer::commandChangeTarget(), traci::TraCIServer::commandDistanceRequest(), traci::TraCIServer::commandSlowDown(), MSVehicle::enterLaneAtLaneChange(), MSPersonControl::erase(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSUnboundActuatedTrafficLightLogic::gapControl(), MSActuatedTrafficLightLogic::gapControl(), MSInductLoop::getCurrentOccupancy(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), MSEventControl::getCurrentTimeStep(), GUIApplicationWindow::handleEvent_SimulationLoaded(), GUIApplicationWindow::handleEvent_SimulationStep(), MSLaneSpeedTrigger::init(), MSTLLogicControl::initWautSwitch(), MSLane::isEmissionSuccess(), MSE3Collector::MSE3LeaveReminder::isStillActive(), MSE3Collector::MSE3EntryReminder::isStillActive(), main(), GUIRunThread::makeStep(), MSVehicle::moveFirstChecked(), MSVehicle::moveRegardingCritical(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSTriggeredXMLReader::myInit(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), MSVehicle::onDepart(), MSVehicle::onRemovalFromNet(), MSDevice_Routing::onTryEmit(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_TLS::processSet(), MSTriggeredRerouter::reroute(), GUIRunThread::run(), MSVehicleControl::scheduleVehicleRemoval(), MSVehicle::startLaneChange(), MSUnboundActuatedTrafficLightLogic::trySwitch(), MSSimpleTrafficLightLogic::trySwitch(), and MSActuatedTrafficLightLogic::trySwitch().
00475 { 00476 return myStep; 00477 }
| MSDetectorControl& MSNet::getDetectorControl | ( | ) | throw () [inline, inherited] |
Returns the detector control.
Definition at line 303 of file MSNet.h.
References MSNet::myDetectorControl.
Referenced by NLDetectorBuilder::buildE2Detector(), NLDetectorBuilder::buildInductLoop(), NLDetectorBuilder::buildRouteProbe(), NLDetectorBuilder::createEdgeLaneMeanData(), NLDetectorBuilder::endE3Detector(), MSMeanData_Harmonoise::MSMeanData_Harmonoise(), TraCIServerAPI_MeMeDetector::processGet(), and TraCIServerAPI_InductionLoop::processGet().
00303 { 00304 return *myDetectorControl; 00305 }
| Boundary GUINet::getEdgeBoundary | ( | const std::string & | name | ) | const |
returns the boundary of an edge
Definition at line 217 of file GUINet.cpp.
References MSEdge::dictionary(), and GUIEdge::getBoundary().
00217 { 00218 GUIEdge *edge = static_cast<GUIEdge*>(MSEdge::dictionary(name)); 00219 return edge->getBoundary(); 00220 }
| MSEdgeControl& MSNet::getEdgeControl | ( | ) | throw () [inline, inherited] |
Returns the edge control.
Definition at line 283 of file MSNet.h.
References MSNet::myEdges.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSDevice_Routing::buildVehicleDevices(), traci::TraCIServer::convertCartesianToRoadMap(), traci::TraCIServer::getNetBoundary(), and MSLane::isEmissionSuccess().
00283 { 00284 return *myEdges; 00285 }
| MSEventControl& MSNet::getEmissionEvents | ( | ) | throw () [inline, inherited] |
Returns the event control for emission events.
Definition at line 353 of file MSNet.h.
References MSNet::myEmissionEvents.
Referenced by FXIMPLEMENT(), MSEmitter::MSEmitter_FileTriggeredChild::inputEndReached(), MSCalibrator::MSCalibrator_FileTriggeredChild::inputEndReached(), MSCalibrator::MSCalibrator(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), and MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement().
00353 { 00354 return *myEmissionEvents; 00355 }
| MSEmitControl& MSNet::getEmitControl | ( | ) | throw () [inline, inherited] |
Returns the emission control.
Definition at line 293 of file MSNet.h.
References MSNet::myEmitter.
Referenced by MSRouteHandler::closeFlow(), MSRouteHandler::closeVehicle(), getParameterWindow(), and MSPerson::MSPersonStage_Driving::proceed().
00293 { 00294 return *myEmitter; 00295 }
| MSEventControl& MSNet::getEndOfTimestepEvents | ( | ) | throw () [inline, inherited] |
Returns the event control for events executed at the end of a time step.
Definition at line 343 of file MSNet.h.
References MSNet::myEndOfTimestepEvents.
Referenced by MSDevice_Routing::buildVehicleDevices(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), MSDevice_HBEFA::enterLaneAtEmit(), and MSVTypeProbe::MSVTypeProbe().
00343 { 00344 return *myEndOfTimestepEvents; 00345 }
| const std::string& GUIGlObject::getFullName | ( | ) | const throw () [inline, inherited] |
Returns the full name appearing in the tool tip.
Definition at line 95 of file GUIGlObject.h.
References GUIGlObject::myFullName.
Referenced by GUIGlObject::buildPopupHeader(), GUIGLObjectPopupMenu::onCmdCopyTypedName(), GUIParam_PopupMenuInterface::onCmdOpenTracker(), GUIGLObjectToolTip::onPaint(), GUITriggeredRerouter::openManipulator(), GUILaneSpeedTrigger::openManipulator(), GUIEmitter::openManipulator(), GUIDialog_GLChosenEditor::rebuildList(), GUISelectedStorage::save(), and GUISelectedStorage::SingleTypeSelections::save().
00095 { 00096 return myFullName; 00097 }
| GLuint GUIGlObject::getGlID | ( | ) | const throw () [inline, inherited] |
Returns the numerical id of the object.
Definition at line 103 of file GUIGlObject.h.
References GUIGlObject::myGlID.
Referenced by GUIGlObject::buildSelectionPopupEntry(), GUIViewTraffic::drawBestLanes(), GUIVehicle::drawGL(), GUITriggeredRerouter::drawGL(), GUIPolygon2D::drawGL(), GUIPointOfInterest::drawGL(), GUILaneWrapper::drawGL(), GUILaneSpeedTrigger::drawGL(), GUIJunctionWrapper::drawGL(), GUIInductLoop::MyWrapper::drawGL(), GUIEmitter::drawGL(), GUIE3Collector::MyWrapper::drawGL(), GUIBusStop::drawGL(), GUI_E2_ZS_Collector::MyWrapper::drawGL(), GUIViewTraffic::drawRoute(), FXIMPLEMENT(), GUILaneWrapper::Colorer::getColorValue(), GUISUMOAbstractView::getObjectUnderCursor(), GUIVehicle::getPopUpMenu(), GUIGLObjectPopupMenu::onCmdAddSelected(), GUIGLObjectPopupMenu::onCmdRemoveSelected(), GUIVehicle::GUIVehiclePopupMenu::onCmdStartTrack(), and ROWdrawAction_drawLinkRules().
00103 { 00104 return myGlID; 00105 }
| unsigned int GUINet::getIdleDuration | ( | ) | const throw () |
Returns the duration of the last step's idle part (in ms).
Definition at line 420 of file GUINet.cpp.
References myLastIdleDuration.
Referenced by getParameterWindow().
00420 { 00421 return myLastIdleDuration; 00422 }
| MSNet * MSNet::getInstance | ( | void | ) | throw (ProcessError) [static, inherited] |
Returns the pointer to the unique instance of MSNet (singleton).
| ProcessError | If a network was not yet constructed |
Definition at line 144 of file MSNet.cpp.
References MSNet::myInstance.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSVehicle::adaptSpeed(), MSEmitControl::add(), MSVehicle::addStop(), traci::TraCIServer::addSubscription(), MSVehicle::addTraciStop(), MSVehicleTransfer::addVeh(), MSTLLogicControl::addWAUTJunction(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSEmitter::MSEmitter_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), NLTriggerBuilder::buildVaporizer(), MSVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSDevice_Routing::buildVehicleDevices(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSVehicleTransfer::checkEmissions(), MSEmitControl::checkFlows(), GUISUMOAbstractView::checkSnapshots(), MSEmitter::childCheckEmit(), MSRouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closeRoute(), MSRouteHandler::closeVehicle(), MSRouteHandler::closeVehicleTypeDistribution(), MSTLLogicControl::closeWAUT(), MSInductLoop::collectVehiclesOnDet(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), traci::TraCIServer::commandAddVehicle(), traci::TraCIServer::commandChangeRoute(), traci::TraCIServer::commandChangeTarget(), traci::TraCIServer::commandDistanceRequest(), traci::TraCIServer::commandGetAllTLIds(), traci::TraCIServer::commandSlowDown(), traci::TraCIServer::convertCartesianToRoadMap(), NLDetectorBuilder::createEdgeLaneMeanData(), MSLane::detectCollisions(), GUITriggeredRerouter::drawGL(), GUILaneWrapper::drawGL(), MSDevice_Routing::enterLaneAtEmit(), MSDevice_HBEFA::enterLaneAtEmit(), MSVehicle::enterLaneAtLaneChange(), MSPersonControl::erase(), MSVTypeProbe::execute(), MSCalibrator::execute(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), FXIMPLEMENT(), MSUnboundActuatedTrafficLightLogic::gapControl(), MSActuatedTrafficLightLogic::gapControl(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), MSEventControl::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), TraCIDijkstraRouter< E >::getEffort(), traci::TraCIServer::getNetBoundary(), MSInductLoop::getNVehContributed(), MSTLLogicControl::getPhaseDef(), traci::TraCIServer::getPoiByExtId(), traci::TraCIServer::getPolygonByExtId(), MSInductLoop::getTimestepsSinceLastDetection(), traci::TraCIServer::getTLLogicByExtId(), traci::TraCIServer::getVehicleByExtId(), guiSimulationStep(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), traci::TraCIServer::handleRoadMapDomain(), traci::TraCIServer::handleTrafficLightDomain(), traci::TraCIServer::handleVehicleDomain(), MSLaneSpeedTrigger::init(), MSTLLogicControl::initWautSwitch(), MSEmitter::MSEmitter_FileTriggeredChild::inputEndReached(), MSCalibrator::MSCalibrator_FileTriggeredChild::inputEndReached(), MSLane::isEmissionSuccess(), MSInductLoop::isStillActive(), MSE3Collector::MSE3LeaveReminder::isStillActive(), MSE3Collector::MSE3EntryReminder::isStillActive(), MSLane::moveCritical(), MSVehicle::moveFirstChecked(), MSVehicle::moveRegardingCritical(), MSVehicle::moveRoutePointer(), MSCalibrator::MSCalibrator(), MSInductLoop::MSInductLoop(), MSMeanData_Harmonoise::MSMeanData_Harmonoise(), MSTrafficLightLogic::MSTrafficLightLogic(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSVehicle::MSVehicle(), MSVTypeProbe::MSVTypeProbe(), MSRouteHandler::myEndElement(), MSTriggeredXMLReader::myInit(), MSRouteHandler::myStartElement(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), MSVehicle::onDepart(), GUIViewTraffic::onGamingClick(), MSVehicle::onRemovalFromNet(), MSDevice_Routing::onTryEmit(), MSRouteHandler::openVehicleTypeDistribution(), traci::TraCIServer::postProcessSimulationStep(), traci::TraCIServer::postProcessSimulationStep2(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Edge::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Edge::processSet(), MSLane::push(), MSVehicle::reroute(), MSTriggeredRerouter::reroute(), MSVehicleControl::scheduleVehicleRemoval(), MSLane::setCritical(), GUIVehicle::Colorer::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), MSVehicle::startLaneChange(), traci::TraCIServer::TraCIServer(), MSUnboundActuatedTrafficLightLogic::trySwitch(), MSSimpleTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSVehicleControl::vehicleEmitted(), GUIEmitter::GUIEmitterChild_UserTriggeredChild::wrappedExecute(), MSVehicle::~MSVehicle(), and traci::TraCIServer::~TraCIServer().
00144 { 00145 if (myInstance != 0) { 00146 return myInstance; 00147 } 00148 throw ProcessError("A network was not yet constructed."); 00149 }
| MSJunctionControl& MSNet::getJunctionControl | ( | ) | throw () [inline, inherited] |
Returns the junctions control.
Definition at line 323 of file MSNet.h.
References MSNet::myJunctions.
Referenced by traci::TraCIServer::handleTrafficLightDomain(), and TraCIServerAPI_Junction::processGet().
00323 { 00324 return *myJunctions; 00325 }
| std::vector< GLuint > GUINet::getJunctionIDs | ( | ) | const |
Returns the gl-ids of all junctions within the net.
Definition at line 257 of file GUINet.cpp.
References myJunctionWrapper.
00257 { 00258 std::vector<GLuint> ret; 00259 for (std::vector<GUIJunctionWrapper*>::const_iterator i=myJunctionWrapper.begin(); i!=myJunctionWrapper.end(); ++i) { 00260 ret.push_back((*i)->getGlID()); 00261 } 00262 return ret; 00263 }
| Position2D GUINet::getJunctionPosition | ( | const std::string & | name | ) | const |
returns the position of a junction
Definition at line 204 of file GUINet.cpp.
References NamedObjectCont< T >::get(), MSJunction::getPosition(), and MSNet::myJunctions.
00204 { 00205 // !!! no check for existance! 00206 return myJunctions->get(name)->getPosition(); 00207 }
| unsigned int GUINet::getLinkTLID | ( | MSLink * | link | ) | const |
Returns the gl-id of the traffic light that controls the given link valid only if the link is controlled by a tls
Definition at line 224 of file GUINet.cpp.
References MSTLLogicControl::getActive(), myLinks2Logic, MSNet::myLogics, and myLogics2Wrapper.
Referenced by GUILaneWrapper::getLinkTLID().
00224 { 00225 Links2LogicMap::const_iterator i = myLinks2Logic.find(link); 00226 if (i==myLinks2Logic.end()) { 00227 return -1; 00228 } 00229 if (myLogics2Wrapper.find(myLogics->getActive((*i).second))==myLogics2Wrapper.end()) { 00230 return -1; 00231 } 00232 return myLogics2Wrapper.find(myLogics->getActive((*i).second))->second->getGlID(); 00233 }
| int GUINet::getLinkTLIndex | ( | MSLink * | link | ) | const |
Returns the index of the link within the junction that controls the given link; Returns -1 if the link is not controlled by a tls
Definition at line 237 of file GUINet.cpp.
References MSTLLogicControl::getActive(), myLinks2Logic, MSNet::myLogics, and myLogics2Wrapper.
Referenced by GUILaneWrapper::getLinkTLIndex().
00237 { 00238 Links2LogicMap::const_iterator i = myLinks2Logic.find(link); 00239 if (i==myLinks2Logic.end()) { 00240 return -1; 00241 } 00242 if (myLogics2Wrapper.find(myLogics->getActive((*i).second))==myLogics2Wrapper.end()) { 00243 return -1; 00244 } 00245 return myLogics2Wrapper.find(myLogics->getActive((*i).second))->second->getLinkIndex(link); 00246 }
| SUMOReal GUINet::getMeanRTFactor | ( | int | duration | ) | const |
Returns the simulation speed as a factor to real time.
Definition at line 402 of file GUINet.cpp.
References myOverallSimDuration, and SUMOReal.
00402 { 00403 if (myOverallSimDuration==0) { 00404 return -1; 00405 } 00406 return ((SUMOReal)(duration)*(SUMOReal) 1000./(SUMOReal)myOverallSimDuration); 00407 }
| SUMOReal GUINet::getMeanUPS | ( | ) | const |
Returns the update per seconds rate.
Definition at line 411 of file GUINet.cpp.
References myOverallSimDuration, MSNet::myVehiclesMoved, and SUMOReal.
Referenced by getParameterWindow().
00411 { 00412 if (myOverallSimDuration==0) { 00413 return -1; 00414 } 00415 return ((SUMOReal)myVehiclesMoved / (SUMOReal)myOverallSimDuration *(SUMOReal) 1000.); 00416 }
| const std::string & GUINet::getMicrosimID | ( | ) | const throw () [virtual] |
Returns the id of the object as known to microsim.
Implements GUIGlObject.
Definition at line 503 of file GUINet.cpp.
References StringUtils::emptyString.
00503 { 00504 return StringUtils::emptyString; 00505 }
| GUIParameterTableWindow * GUINet::getParameterWindow | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [virtual] |
Returns an own parameter window.
| [in] | app | The application needed to build the parameter window |
| [in] | parent | The parent window needed to build the parameter window |
Implements GUIGlObject.
Definition at line 460 of file GUINet.cpp.
References GUIParameterTableWindow::closeBuilding(), MSNet::getEmitControl(), MSVehicleControl::getEmittedVehicleNo(), MSVehicleControl::getEndedVehicleNo(), getIdleDuration(), MSVehicleControl::getLoadedVehicleNo(), getMeanUPS(), OptionsCont::getOptions(), getRTFactor(), MSVehicleControl::getRunningVehicleNo(), getSimDuration(), getUPS(), MSNet::getVehicleControl(), MSEmitControl::getWaitingVehicleNo(), getWholeDuration(), MSNet::logSimulationDuration(), and GUIParameterTableWindow::mkItem().
00461 { 00462 GUIParameterTableWindow *ret = 00463 new GUIParameterTableWindow(app, *this, 13); 00464 // add items 00465 ret->mkItem("vehicles running [#]", true, 00466 new FunctionBinding<MSVehicleControl, unsigned int>(&getVehicleControl(), &MSVehicleControl::getRunningVehicleNo)); 00467 ret->mkItem("vehicles ended [#]", true, 00468 new FunctionBinding<MSVehicleControl, unsigned int>(&getVehicleControl(), &MSVehicleControl::getEndedVehicleNo)); 00469 ret->mkItem("vehicles emitted [#]", true, 00470 new FunctionBinding<MSVehicleControl, unsigned int>(&getVehicleControl(), &MSVehicleControl::getEmittedVehicleNo)); 00471 ret->mkItem("vehicles loaded [#]", true, 00472 new FunctionBinding<MSVehicleControl, unsigned int>(&getVehicleControl(), &MSVehicleControl::getLoadedVehicleNo)); 00473 ret->mkItem("vehicles waiting [#]", true, 00474 new FunctionBinding<MSEmitControl, unsigned int>(&getEmitControl(), &MSEmitControl::getWaitingVehicleNo)); 00475 ret->mkItem("end time [s]", false, OptionsCont::getOptions().getString("end")); 00476 ret->mkItem("begin time [s]", false, OptionsCont::getOptions().getString("begin")); 00477 // ret->mkItem("time step [s]", true, new FunctionBinding<GUINet, SUMOTime>(this, &GUINet::getCurrentTimeStep)); 00478 if (logSimulationDuration()) { 00479 ret->mkItem("step duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getWholeDuration)); 00480 ret->mkItem("simulation duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getSimDuration)); 00481 /* 00482 ret->mkItem("visualisation duration [ms]", true, 00483 new CastingFunctionBinding<GUINet, SUMOReal, int>( 00484 &(getNet()), &GUINet::getVisDuration)); 00485 */ 00486 ret->mkItem("idle duration [ms]", true, new FunctionBinding<GUINet, unsigned int>(this, &GUINet::getIdleDuration)); 00487 ret->mkItem("duration factor []", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getRTFactor)); 00488 /* 00489 ret->mkItem("mean duration factor []", true, 00490 new FuncBinding_IntParam<GUINet, SUMOReal>( 00491 &(getNet()), &GUINet::getMeanRTFactor), 1); 00492 */ 00493 ret->mkItem("ups [#]", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getUPS)); 00494 ret->mkItem("mean ups [#]", true, new FunctionBinding<GUINet, SUMOReal>(this, &GUINet::getMeanUPS)); 00495 } 00496 // close building 00497 ret->closeBuilding(); 00498 return ret; 00499 }
| MSPersonControl & MSNet::getPersonControl | ( | ) | throw () [inherited] |
Returns the person control.
If the person control does not exist, yet, it is created.
Definition at line 564 of file MSNet.cpp.
References MSNet::myPersonControl.
Referenced by MSRouteHandler::closePerson(), MSPerson::proceed(), MSPerson::MSPersonStage_Waiting::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPerson::MSPersonStage_Walking::proceed(), and MSVehicle::processNextStop().
00564 { 00565 if (myPersonControl==0) { 00566 myPersonControl = new MSPersonControl(); 00567 } 00568 return *myPersonControl; 00569 }
| GUIGLObjectPopupMenu * GUINet::getPopUpMenu | ( | GUIMainWindow & | app, | |
| GUISUMOAbstractView & | parent | |||
| ) | throw () [virtual] |
Returns an own popup-menu.
| [in] | app | The application needed to build the popup-menu |
| [in] | parent | The parent window needed to build the popup-menu |
Implements GUIGlObject.
Definition at line 448 of file GUINet.cpp.
References GUIGlObject::buildCenterPopupEntry(), GUIGlObject::buildPopupHeader(), GUIGlObject::buildPositionCopyEntry(), and GUIGlObject::buildShowParamsPopupEntry().
00449 { 00450 GUIGLObjectPopupMenu *ret = new GUIGLObjectPopupMenu(app, parent, *this); 00451 buildPopupHeader(ret, app); 00452 buildCenterPopupEntry(ret); 00453 buildShowParamsPopupEntry(ret); 00454 buildPositionCopyEntry(ret, false); 00455 return ret; 00456 }
| SUMOReal GUINet::getRTFactor | ( | ) | const |
Returns the simulation speed as a factor to real time.
Definition at line 384 of file GUINet.cpp.
References myLastSimDuration, and SUMOReal.
Referenced by getParameterWindow().
00384 { 00385 if (myLastSimDuration==0) { 00386 return -1; 00387 } 00388 return (SUMOReal) 1000. / (SUMOReal) myLastSimDuration; 00389 }
| ShapeContainer& MSNet::getShapeContainer | ( | ) | throw () [inline, inherited] |
Returns the shapes container.
Definition at line 363 of file MSNet.h.
References MSNet::myShapeContainer.
Referenced by traci::TraCIServer::getPoiByExtId(), traci::TraCIServer::getPolygonByExtId(), traci::TraCIServer::handlePoiDomain(), traci::TraCIServer::handlePolygonDomain(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), and traci::TraCIServer::TraCIServer().
00363 { 00364 return *myShapeContainer; 00365 }
| std::vector< GLuint > GUINet::getShapeIDs | ( | ) | const |
Returns the gl-ids of all shapes within the net.
Definition at line 283 of file GUINet.cpp.
References ShapeContainer::getMaxLayer(), ShapeContainer::getMinLayer(), ShapeContainer::getPOICont(), ShapeContainer::getPolygonCont(), and MSNet::myShapeContainer.
00283 { 00284 std::vector<GLuint> ret; 00285 if (myShapeContainer!=0) { 00286 int minLayer = myShapeContainer->getMinLayer(); 00287 int maxLayer = myShapeContainer->getMaxLayer(); 00288 for (int j=minLayer; j<=maxLayer; ++j) { 00289 const std::map<std::string, Polygon2D*> &pol = myShapeContainer->getPolygonCont(j).getMyMap(); 00290 for (std::map<std::string, Polygon2D*>::const_iterator i=pol.begin(); i!=pol.end(); ++i) { 00291 ret.push_back(static_cast<GUIPolygon2D*>((*i).second)->getGlID()); 00292 } 00293 const std::map<std::string, PointOfInterest*> &poi = myShapeContainer->getPOICont(j).getMyMap(); 00294 for (std::map<std::string, PointOfInterest*>::const_iterator i=poi.begin(); i!=poi.end(); ++i) { 00295 ret.push_back(static_cast<GUIPointOfInterest*>((*i).second)->getGlID()); 00296 } 00297 } 00298 } 00299 return ret; 00300 }
| unsigned int GUINet::getSimDuration | ( | ) | const throw () |
Returns the duration of the last step's simulation part (in ms).
Definition at line 370 of file GUINet.cpp.
References myLastSimDuration.
Referenced by getParameterWindow().
00370 { 00371 return myLastSimDuration; 00372 }
| std::string MSNet::getStateMessage | ( | MSNet::SimulationState | state | ) | throw () [static, inherited] |
Returns the message to show if a certain state occurs.
Definition at line 444 of file MSNet.cpp.
References MSNet::SIMSTATE_CONNECTION_CLOSED, MSNet::SIMSTATE_END_STEP_REACHED, MSNet::SIMSTATE_ERROR_IN_SIM, MSNet::SIMSTATE_NO_FURTHER_VEHICLES, MSNet::SIMSTATE_RUNNING, and MSNet::SIMSTATE_TOO_MANY_VEHICLES.
Referenced by GUIApplicationWindow::handleEvent_SimulationEnded(), and MSNet::simulate().
00444 { 00445 switch (state) { 00446 case MSNet::SIMSTATE_RUNNING: 00447 return ""; 00448 case MSNet::SIMSTATE_END_STEP_REACHED: 00449 return "The final simulation step has been reached."; 00450 case MSNet::SIMSTATE_NO_FURTHER_VEHICLES: 00451 return "All vehicles have left the simulation."; 00452 case MSNet::SIMSTATE_CONNECTION_CLOSED: 00453 return "TraCI requested termination."; 00454 case MSNet::SIMSTATE_ERROR_IN_SIM: 00455 return "Reason: An error occured (see log)."; 00456 case MSNet::SIMSTATE_TOO_MANY_VEHICLES: 00457 return "Too many vehicles."; 00458 default: 00459 return "Unknown reason."; 00460 } 00461 }
| MSTLLogicControl& MSNet::getTLSControl | ( | ) | throw () [inline, inherited] |
Returns the tls logics control.
Definition at line 313 of file MSNet.h.
References MSNet::myLogics.
Referenced by NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), traci::TraCIServer::commandGetAllTLIds(), traci::TraCIServer::getTLLogicByExtId(), NLJunctionControlBuilder::getTLLogicControlToUse(), traci::TraCIServer::handleTrafficLightDomain(), initTLMap(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_TLS::processSet(), and traci::TraCIServer::TraCIServer().
00313 { 00314 return *myLogics; 00315 }
| std::vector< GLuint > GUINet::getTLSIDs | ( | ) | const |
Returns the gl-ids of all traffic light logics within the net.
Definition at line 267 of file GUINet.cpp.
References myLogics2Wrapper.
00267 { 00268 std::vector<GLuint> ret; 00269 std::vector<std::string> ids; 00270 for (std::map<MSTrafficLightLogic*, GUITrafficLightLogicWrapper*>::const_iterator i=myLogics2Wrapper.begin(); i!=myLogics2Wrapper.end(); ++i) { 00271 size_t nid = (*i).second->getGlID(); 00272 std::string sid = (*i).second->getMicrosimID(); 00273 if (find(ids.begin(), ids.end(), sid)==ids.end()) { 00274 ret.push_back(nid); 00275 ids.push_back(sid); 00276 } 00277 } 00278 return ret; 00279 }
| GUIGlObjectType GUINet::getType | ( | ) | const throw () [inline, virtual] |
Returns the type of the object as coded in GUIGlObjectType.
Implements GUIGlObject.
Definition at line 144 of file GUINet.h.
References GLO_NETWORK.
00144 { 00145 return GLO_NETWORK; 00146 }
| SUMOReal GUINet::getUPS | ( | ) | const |
Returns the update per seconds rate.
Definition at line 393 of file GUINet.cpp.
References myLastSimDuration, myLastVehicleMovementCount, and SUMOReal.
Referenced by getParameterWindow().
00393 { 00394 if (myLastSimDuration==0) { 00395 return -1; 00396 } 00397 return (SUMOReal) myLastVehicleMovementCount / (SUMOReal) myLastSimDuration *(SUMOReal) 1000.; 00398 }
| MSVehicleControl& MSNet::getVehicleControl | ( | ) | throw () [inline, inherited] |
Returns the vehicle control.
Definition at line 262 of file MSNet.h.
References MSNet::myVehicleControl.
Referenced by MSEmitControl::add(), MSVehicleTransfer::addVeh(), MSEmitter::MSEmitter_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSVehicleTransfer::checkEmissions(), MSEmitControl::checkFlows(), MSEmitter::childCheckEmit(), MSCalibrator::childCheckEmit(), MSRouteHandler::closeVehicle(), traci::TraCIServer::commandAddVehicle(), MSVTypeProbe::execute(), MSCalibrator::execute(), FXIMPLEMENT(), getParameterWindow(), traci::TraCIServer::getVehicleByExtId(), traci::TraCIServer::handleVehicleDomain(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), MSVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), traci::TraCIServer::postProcessSimulationStep(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), MSLane::push(), MSLane::setCritical(), setSimDuration(), GUIEmitter::setUserFlow(), and GUIEmitter::GUIEmitterChild_UserTriggeredChild::wrappedExecute().
00262 { 00263 return *myVehicleControl; 00264 }
| MSEdgeWeightsStorage & MSNet::getWeightsStorage | ( | ) | throw () [inherited] |
Returns the net's internal edge travel times/efforts container.
If the net does not have such a container, it is built.
Definition at line 573 of file MSNet.cpp.
References MSNet::myEdgeWeights.
Referenced by traci::TraCIServer::commandChangeRoute(), traci::TraCIServer::commandChangeTarget(), traci::TraCIServer::postProcessSimulationStep(), TraCIServerAPI_Vehicle::processSet(), and TraCIServerAPI_Edge::processSet().
00573 { 00574 if (myEdgeWeights==0) { 00575 myEdgeWeights = new MSEdgeWeightsStorage(); 00576 } 00577 return *myEdgeWeights; 00578 }
| unsigned int GUINet::getWholeDuration | ( | ) | const throw () |
Returns the duration of the last step (sim+visualisation+idle) (in ms).
Definition at line 364 of file GUINet.cpp.
References myLastIdleDuration, and myLastSimDuration.
Referenced by getParameterWindow().
00364 { 00365 return myLastSimDuration+/*myLastVisDuration+*/myLastIdleDuration; 00366 }
| void GUINet::guiSimulationStep | ( | ) |
Some further steps needed for gui processing.
Definition at line 250 of file GUINet.cpp.
References MSNet::getInstance().
Referenced by GUIRunThread::makeStep().
00250 { 00251 MSUpdateEachTimestepContainer<MSUpdateEachTimestep<GLObjectValuePassConnector<SUMOReal> > >::getInstance()->updateAll(); 00252 MSUpdateEachTimestepContainer<MSUpdateEachTimestep<GLObjectValuePassConnector<std::pair<SUMOTime, MSPhaseDefinition> > > >::getInstance()->updateAll(); 00253 }
| void MSNet::informVehicleStateListener | ( | const MSVehicle *const | vehicle, | |
| VehicleState | to | |||
| ) | throw () [inherited] |
Informs all added listeners about a vehicle's state change.
| [in] | vehicle | The vehicle which changed its state |
| [in] | to | The state the vehicle has changed to |
Definition at line 634 of file MSNet.cpp.
References MSNet::myVehicleStateListeners.
Referenced by MSVehicleTransfer::addVeh(), MSVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSVehicleTransfer::checkEmissions(), MSVehicleControl::scheduleVehicleRemoval(), and MSVehicleControl::vehicleEmitted().
00634 { 00635 for (std::vector<VehicleStateListener*>::iterator i=myVehicleStateListeners.begin(); i!=myVehicleStateListeners.end(); ++i) { 00636 (*i)->vehicleStateChanged(vehicle, to); 00637 } 00638 }
| void GUINet::initDetectors | ( | ) | [private] |
Initialises the detector wrappers.
Definition at line 117 of file GUINet.cpp.
References MSDetectorControl::getE2Detectors(), MSDetectorControl::getE2OLDetectors(), MSDetectorControl::getE3Detectors(), MSLane::getEdge(), MSDetectorControl::getInductLoops(), MSMoveReminder::getLane(), GUIEdge::getLaneGeometry(), GUIGlObject::getMicrosimID(), GUIGlObjectStorage::gIDStorage, MSNet::myDetectorControl, and myDetectorDict.
Referenced by initGUIStructures().
00117 { 00118 // e2-detectors 00119 const std::map<std::string, MSE2Collector*> &e2 = myDetectorControl->getE2Detectors().getMyMap(); 00120 for (std::map<std::string, MSE2Collector*>::const_iterator i2=e2.begin(); i2!=e2.end(); i2++) { 00121 MSE2Collector *const e2i = (*i2).second; 00122 const MSLane *lane = e2i->getLane(); 00123 GUIEdge &edge = static_cast<GUIEdge&>(lane->getEdge()); 00124 /* 00125 // build the wrapper 00126 if ((*i2)->getUsageType()==DU_SUMO_INTERNAL 00127 || 00128 (*i2)->getUsageType()==DU_TL_CONTROL) { 00129 continue; 00130 } 00131 */ 00132 GUIDetectorWrapper *wrapper = 00133 static_cast<GUI_E2_ZS_Collector*>(e2i)->buildDetectorWrapper(GUIGlObjectStorage::gIDStorage, edge.getLaneGeometry(lane)); 00134 // add to dictionary 00135 myDetectorDict[wrapper->getMicrosimID()] = wrapper; 00136 } 00137 // e2 over lanes -detectors 00138 const std::map<std::string, MS_E2_ZS_CollectorOverLanes*> &e2ol = myDetectorControl->getE2OLDetectors().getMyMap(); 00139 for (std::map<std::string, MS_E2_ZS_CollectorOverLanes*>::const_iterator i2=e2ol.begin(); i2!=e2ol.end(); i2++) { 00140 MS_E2_ZS_CollectorOverLanes * const e2oli = (*i2).second; 00141 // build the wrapper 00142 GUIDetectorWrapper *wrapper = 00143 static_cast<GUI_E2_ZS_CollectorOverLanes*>(e2oli)->buildDetectorWrapper( 00144 GUIGlObjectStorage::gIDStorage); 00145 // add to dictionary 00146 myDetectorDict[wrapper->getMicrosimID()] = wrapper; 00147 } 00148 // induction loops 00149 const std::map<std::string, MSInductLoop*> &e1 = myDetectorControl->getInductLoops().getMyMap(); 00150 for (std::map<std::string, MSInductLoop*>::const_iterator i2=e1.begin(); i2!=e1.end(); i2++) { 00151 MSInductLoop *const e1i = (*i2).second; 00152 const MSLane *lane = e1i->getLane(); 00153 GUIEdge &edge = static_cast<GUIEdge&>(lane->getEdge()); 00154 // build the wrapper 00155 GUIDetectorWrapper *wrapper = static_cast<GUIInductLoop*>(e1i)->buildDetectorWrapper(GUIGlObjectStorage::gIDStorage, edge.getLaneGeometry(lane)); 00156 // add to dictionary 00157 myDetectorDict[wrapper->getMicrosimID()] = wrapper; 00158 } 00159 // e3-detectors 00160 const std::map<std::string, MSE3Collector*> &e3 = myDetectorControl->getE3Detectors().getMyMap(); 00161 for (std::map<std::string, MSE3Collector*>::const_iterator i2=e3.begin(); i2!=e3.end(); i2++) { 00162 MSE3Collector *const e3i = (*i2).second; 00163 // build the wrapper 00164 GUIDetectorWrapper *wrapper = 00165 static_cast<GUIE3Collector*>(e3i)->buildDetectorWrapper(GUIGlObjectStorage::gIDStorage); 00166 // add to dictionary 00167 myDetectorDict[wrapper->getMicrosimID()] = wrapper; 00168 } 00169 }
| void GUINet::initGUIStructures | ( | ) |
Initialises gui wrappers.
Definition at line 304 of file GUINet.cpp.
References Boundary::add(), GUIEdge::fill(), GUIJunctionWrapper::getBoundary(), GUIGlObject::getCenteringBoundary(), MSEdge::getLanes(), NamedObjectCont< T >::getMyMap(), GUIGlObject_AbstractAdd::getObjectList(), GUIGlObjectStorage::gIDStorage, Boundary::grow(), initDetectors(), initTLMap(), RTree< DATATYPE, DATATYPENP, ELEMTYPE, NUMDIMS, CONTEXT, ELEMTYPEREAL, TMAXNODES, TMINNODES >::Insert(), myBoundary, myEdgeWrapper, myGrid, MSNet::myJunctions, myJunctionWrapper, NamedObjectCont< T >::size(), size, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by GUILoadThread::run().
00304 { 00305 // initialise detector storage for gui 00306 initDetectors(); 00307 // initialise the tl-map 00308 initTLMap(); 00309 // initialise edge storage for gui 00310 GUIEdge::fill(myEdgeWrapper); 00311 // initialise junction storage for gui 00312 size_t size = myJunctions->size(); 00313 myJunctionWrapper.reserve(size); 00314 const std::map<std::string, MSJunction*> &junctions = myJunctions->getMyMap(); 00315 for (std::map<std::string, MSJunction*>::const_iterator i=junctions.begin(); i!=junctions.end(); ++i) { 00316 myJunctionWrapper.push_back(new GUIJunctionWrapper(GUIGlObjectStorage::gIDStorage, *(*i).second)); 00317 } 00318 // build the visualization tree 00319 float *cmin = new float[2]; 00320 float *cmax = new float[2]; 00321 for (std::vector<GUIEdge*>::iterator i=myEdgeWrapper.begin(); i!=myEdgeWrapper.end(); ++i) { 00322 GUIEdge *edge = *i; 00323 Boundary b; 00324 const std::vector<MSLane*> &lanes = edge->getLanes(); 00325 for (std::vector<MSLane*>::const_iterator j=lanes.begin(); j!=lanes.end(); ++j) { 00326 b.add((*j)->getShape().getBoxBoundary()); 00327 } 00328 b.grow(2.); 00329 cmin[0] = b.xmin(); 00330 cmin[1] = b.ymin(); 00331 cmax[0] = b.xmax(); 00332 cmax[1] = b.ymax(); 00333 myGrid->Insert(cmin, cmax, edge); 00334 myBoundary.add(b); 00335 } 00336 for (std::vector<GUIJunctionWrapper*>::iterator i=myJunctionWrapper.begin(); i!=myJunctionWrapper.end(); ++i) { 00337 GUIJunctionWrapper *junction = *i; 00338 Boundary b = junction->getBoundary(); 00339 b.grow(2.); 00340 cmin[0] = b.xmin(); 00341 cmin[1] = b.ymin(); 00342 cmax[0] = b.xmax(); 00343 cmax[1] = b.ymax(); 00344 myGrid->Insert(cmin, cmax, junction); 00345 myBoundary.add(b); 00346 } 00347 const std::vector<GUIGlObject_AbstractAdd*> &a = GUIGlObject_AbstractAdd::getObjectList(); 00348 for (std::vector<GUIGlObject_AbstractAdd*>::const_iterator i=a.begin(); i!=a.end(); ++i) { 00349 GUIGlObject_AbstractAdd *o = *i; 00350 Boundary b = o->getCenteringBoundary(); 00351 cmin[0] = b.xmin(); 00352 cmin[1] = b.ymin(); 00353 cmax[0] = b.xmax(); 00354 cmax[1] = b.ymax(); 00355 myGrid->Insert(cmin, cmax, o); 00356 } 00357 delete[] cmin; 00358 delete[] cmax; 00359 myGrid->add(myBoundary); 00360 }
| void GUINet::initTLMap | ( | ) | [private] |
Initialises the tl-logic map and wrappers.
Definition at line 173 of file GUINet.cpp.
References MSTLLogicControl::getAllLogics(), MSTrafficLightLogic::getID(), MSTrafficLightLogic::getLinks(), MSNet::getTLSControl(), GUIGlObjectStorage::gIDStorage, myLinks2Logic, MSNet::myLogics, myLogics2Wrapper, and myTLLogicWrappers.
Referenced by initGUIStructures().
00173 { 00174 // get the list of loaded tl-logics 00175 const std::vector<MSTrafficLightLogic*> &logics = getTLSControl().getAllLogics(); 00176 // allocate storage for the wrappers 00177 myTLLogicWrappers.reserve(logics.size()); 00178 // go through the logics 00179 for (std::vector<MSTrafficLightLogic*>::const_iterator i=logics.begin(); i!=logics.end(); ++i) { 00180 // get the logic 00181 MSTrafficLightLogic *tll = (*i); 00182 // get the links 00183 const MSTrafficLightLogic::LinkVectorVector &links = tll->getLinks(); 00184 if (links.size()==0) { 00185 continue; 00186 } 00187 // build the wrapper 00188 GUITrafficLightLogicWrapper *tllw = 00189 new GUITrafficLightLogicWrapper(GUIGlObjectStorage::gIDStorage, *myLogics, *tll); 00190 // build the association link->wrapper 00191 MSTrafficLightLogic::LinkVectorVector::const_iterator j; 00192 for (j=links.begin(); j!=links.end(); j++) { 00193 MSTrafficLightLogic::LinkVector::const_iterator j2; 00194 for (j2=(*j).begin(); j2!=(*j).end(); j2++) { 00195 myLinks2Logic[*j2] = tll->getID(); 00196 } 00197 } 00198 myLogics2Wrapper[tll] = tllw; 00199 } 00200 }
| bool MSNet::logSimulationDuration | ( | ) | const throw () [inherited] |
Returns whether duration shall be logged.
Definition at line 513 of file MSNet.cpp.
References MSNet::myLogExecutionTime.
Referenced by getParameterWindow().
00513 { 00514 return myLogExecutionTime; 00515 }
| void MSNet::postSimStepOutput | ( | ) | const throw () [inherited] |
Prints the statistics of the step at its end.
Called on the end of a simulation step
Definition at line 589 of file MSNet.cpp.
References DELTA_T, MSVehicleControl::getEmittedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), MSNet::myLogExecutionTime, MSNet::mySimStepDuration, MSNet::myStep, MSNet::myVehicleControl, OUTPUT_ACCURACY, SUMOReal, and time2string().
Referenced by MSNet::simulate().
00589 { 00590 if (myLogExecutionTime) { 00591 std::string msg; 00592 std::ostringstream oss; 00593 oss.setf(std::ios::fixed , std::ios::floatfield); // use decimal format 00594 oss.setf(std::ios::showpoint); // print decimal point 00595 oss << std::setprecision(OUTPUT_ACCURACY); 00596 if (mySimStepDuration!=0) { 00597 oss << " (" << mySimStepDuration << "ms ~= " 00598 << (1000./ (SUMOReal) mySimStepDuration) << "*RT, ~" 00599 << ((SUMOReal) myVehicleControl->getRunningVehicleNo()/(SUMOReal) mySimStepDuration*1000.); 00600 } else { 00601 oss << " (0ms ?*RT. ?"; 00602 } 00603 oss << "UPS, vehicles" 00604 << " TOT " << myVehicleControl->getEmittedVehicleNo() 00605 << " ACT " << myVehicleControl->getRunningVehicleNo() 00606 << ") "; 00607 msg = oss.str(); 00608 std::string prev = "Step #" + time2string(myStep-DELTA_T); 00609 msg = msg.substr(0, 78 - prev.length()); 00610 std::cout << msg; 00611 } 00612 std::cout << (char) 13; 00613 }
| void MSNet::preSimStepOutput | ( | ) | const throw () [inherited] |
Prints the current step number.
Called on the begin of a simulation step
Definition at line 582 of file MSNet.cpp.
References MSNet::myStep, OUTPUT_ACCURACY, and time2string().
Referenced by MSNet::simulate().
00582 { 00583 std::cout << std::setprecision(OUTPUT_ACCURACY); 00584 std::cout << "Step #" << time2string(myStep); 00585 }
| void MSNet::removeVehicleStateListener | ( | VehicleStateListener * | listener | ) | throw () [inherited] |
Removes a vehicle states listener.
| [in] | listener | The listener to remove |
Definition at line 625 of file MSNet.cpp.
References MSNet::myVehicleStateListeners.
Referenced by traci::TraCIServer::~TraCIServer().
00625 { 00626 std::vector<VehicleStateListener*>::iterator i= find(myVehicleStateListeners.begin(), myVehicleStateListeners.end(), listener); 00627 if (i!=myVehicleStateListeners.end()) { 00628 myVehicleStateListeners.erase(i); 00629 } 00630 }
| void GUINet::setIdleDuration | ( | int | val | ) |
Sets the duration of the last step's idle part.
Definition at line 442 of file GUINet.cpp.
References myLastIdleDuration.
Referenced by GUIRunThread::run().
00442 { 00443 myLastIdleDuration = val; 00444 }
| void GUINet::setSimDuration | ( | int | val | ) |
Sets the duration of the last step's simulation part.
Definition at line 426 of file GUINet.cpp.
References MSVehicleControl::getRunningVehicleNo(), MSNet::getVehicleControl(), myLastSimDuration, myLastVehicleMovementCount, myOverallSimDuration, and myOverallVehicleCount.
Referenced by GUIRunThread::run().
00426 { 00427 myLastSimDuration = val; 00428 myOverallSimDuration += val; 00429 myLastVehicleMovementCount = getVehicleControl().getRunningVehicleNo(); 00430 myOverallVehicleCount += myLastVehicleMovementCount; 00431 }
Simulates from timestep start to stop.
| [in] | start | The begin time step of the simulation |
| [in] | stop | The end time step of the simulation |
Definition at line 270 of file MSNet.cpp.
References MSNet::closeSimulation(), OptionsCont::getOptions(), MSNet::getStateMessage(), MSNet::myLogStepNumber, MSNet::myStep, MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), MSNet::SIMSTATE_RUNNING, MSNet::simulationState(), MSNet::simulationStep(), traci::TraCIServer::wasClosed(), and WRITE_MESSAGE.
Referenced by main().
00270 { 00271 // the simulation loop 00272 std::string quitMessage = ""; 00273 myStep = start; 00274 do { 00275 if (myLogStepNumber) { 00276 preSimStepOutput(); 00277 } 00278 simulationStep(); 00279 if (myLogStepNumber) { 00280 postSimStepOutput(); 00281 } 00282 MSNet::SimulationState state = simulationState(stop); 00283 #ifndef NO_TRACI 00284 if (state!=SIMSTATE_RUNNING) { 00285 if (OptionsCont::getOptions().getInt("remote-port")!=0&&!traci::TraCIServer::wasClosed()) { 00286 state = SIMSTATE_RUNNING; 00287 } 00288 } 00289 #endif 00290 if (state!=SIMSTATE_RUNNING) { 00291 quitMessage = "Simulation End: " + getStateMessage(state); 00292 } 00293 } while (quitMessage==""); 00294 WRITE_MESSAGE(quitMessage); 00295 // exit simulation loop 00296 closeSimulation(start); 00297 return 0; 00298 }
| MSNet::SimulationState MSNet::simulationState | ( | SUMOTime | stopTime | ) | const throw () [inherited] |
Called after a simulation step, this method returns the current simulation state.
| [in] | stopTime | The time the simulation shall stop at |
Definition at line 420 of file MSNet.cpp.
References OptionsCont::getInt(), OptionsCont::getOptions(), MSVehicleControl::getRunningVehicleNo(), MSEmitControl::hasPendingFlows(), MSVehicleControl::haveAllVehiclesQuit(), MSEventControl::isEmpty(), MSNet::myEmissionEvents, MSNet::myEmitter, MSNet::myStep, MSNet::myTooManyVehicles, MSNet::myVehicleControl, MSNet::SIMSTATE_CONNECTION_CLOSED, MSNet::SIMSTATE_END_STEP_REACHED, MSNet::SIMSTATE_NO_FURTHER_VEHICLES, MSNet::SIMSTATE_RUNNING, MSNet::SIMSTATE_TOO_MANY_VEHICLES, and traci::TraCIServer::wasClosed().
Referenced by GUIRunThread::makeStep(), and MSNet::simulate().
00420 { 00421 if (myTooManyVehicles>0&&(int) myVehicleControl->getRunningVehicleNo()>myTooManyVehicles) { 00422 return SIMSTATE_TOO_MANY_VEHICLES; 00423 } 00424 #ifndef NO_TRACI 00425 if (traci::TraCIServer::wasClosed()) { 00426 return SIMSTATE_CONNECTION_CLOSED; 00427 } 00428 if (stopTime < 0 && OptionsCont::getOptions().getInt("remote-port") == 0 && myVehicleControl->haveAllVehiclesQuit() && !myEmitter->hasPendingFlows()) { 00429 #else 00430 if (stopTime < 0 && myVehicleControl->haveAllVehiclesQuit() && !myEmitter->hasPendingFlows()) { 00431 #endif 00432 if (myEmissionEvents->isEmpty()) { 00433 return SIMSTATE_NO_FURTHER_VEHICLES; 00434 } 00435 } 00436 if (stopTime >= 0 && myStep >= stopTime) { 00437 return SIMSTATE_END_STEP_REACHED; 00438 } 00439 return SIMSTATE_RUNNING; 00440 }
| void MSNet::simulationStep | ( | ) | [inherited] |
Performs a single simulation step.
Definition at line 327 of file MSNet.cpp.
References MSEdgeControl::changeLanes(), MSTLLogicControl::check2Switch(), MSVehicleTransfer::checkEmissions(), DELTA_T, MSEdgeControl::detectCollisions(), MSEmitControl::emitVehicles(), MSEventControl::execute(), MSGlobals::gCheck4Accidents, SysUtils::getCurrentMillis(), MSVehicleTransfer::getInstance(), MSVehicleControl::getRunningVehicleNo(), MSPersonControl::hasArrivedPersons(), MSRouteLoaderControl::loadNext(), MSEdgeControl::moveCritical(), MSEdgeControl::moveFirst(), MSNet::myBeginOfTimestepEvents, MSNet::myEdges, MSNet::myEmissionEvents, MSNet::myEmitter, MSNet::myEndOfTimestepEvents, MSNet::myJunctions, MSNet::myLogExecutionTime, MSNet::myLogics, MSNet::myPersonControl, MSNet::myRouteLoaders, MSNet::mySimStepBegin, MSNet::mySimStepDuration, MSNet::mySimStepEnd, MSNet::myStateDumpFiles, MSNet::myStateDumpTimes, MSNet::myStep, MSNet::myVehicleControl, MSNet::myVehiclesMoved, MSEdgeControl::patchActiveLanes(), MSPersonControl::popArrivedPersons(), traci::TraCIServer::processCommandsUntilSimStep(), MSJunctionControl::setAllowed(), MSTLLogicControl::setTrafficLightSignals(), and MSNet::writeOutput().
Referenced by GUIRunThread::makeStep(), and MSNet::simulate().
00327 { 00328 #ifndef NO_TRACI 00329 traci::TraCIServer::processCommandsUntilSimStep(myStep); 00330 #endif 00331 // execute beginOfTimestepEvents 00332 if (myLogExecutionTime) { 00333 mySimStepBegin = SysUtils::getCurrentMillis(); 00334 } 00335 #ifdef HAVE_MESOSIM 00336 // netstate output 00337 std::vector<SUMOTime>::iterator timeIt = find(myStateDumpTimes.begin(), myStateDumpTimes.end(), myStep); 00338 if (timeIt!=myStateDumpTimes.end()) { 00339 const int dist = distance(myStateDumpTimes.begin(), timeIt); 00340 std::ofstream strm(myStateDumpFiles[dist].c_str(), std::fstream::out|std::fstream::binary); 00341 saveState(strm); 00342 } 00343 #endif 00344 myBeginOfTimestepEvents->execute(myStep); 00345 if (MSGlobals::gCheck4Accidents) { 00346 myEdges->detectCollisions(myStep); 00347 } 00348 #ifdef HAVE_MESOSIM 00349 if (MSGlobals::gUseMesoSim) { 00350 myJunctions->setAllowed(); 00351 MSGlobals::gMesoNet->simulate(myStep); 00352 } else { 00353 #endif 00354 // check whether the tls shall be switched 00355 myLogics->check2Switch(myStep); 00356 // set information about which vehicles may drive at all 00357 myLogics->setTrafficLightSignals(); 00358 00359 00360 // assure all lanes with vehicles are 'active' 00361 myEdges->patchActiveLanes(); 00362 00363 // move vehicles 00364 // precompute possible positions for vehicles that do interact with 00365 // their lane's end 00366 myEdges->moveCritical(myStep); 00367 00368 // move vehicles which do interact with their lane's end 00369 // (it is now known whether they may drive 00370 myEdges->moveFirst(myStep); 00371 if (MSGlobals::gCheck4Accidents) { 00372 myEdges->detectCollisions(myStep); 00373 } 00374 00375 // Vehicles change Lanes (maybe) 00376 myEdges->changeLanes(myStep); 00377 00378 if (MSGlobals::gCheck4Accidents) { 00379 myEdges->detectCollisions(myStep); 00380 } 00381 #ifdef HAVE_MESOSIM 00382 } 00383 #endif 00384 // load routes 00385 myRouteLoaders->loadNext(myStep, myEmitter); 00386 00387 // persons 00388 if (myPersonControl!=0) { 00389 while (myPersonControl->hasArrivedPersons(myStep)) { 00390 const MSPersonControl::PersonVector &persons = myPersonControl->popArrivedPersons(myStep); 00391 for (MSPersonControl::PersonVector::const_iterator i=persons.begin(); i!=persons.end(); ++i) { 00392 (*i)->proceed(this, myStep); 00393 } 00394 } 00395 } 00396 // emit Vehicles 00397 myEmitter->emitVehicles(myStep); 00398 if (MSGlobals::gCheck4Accidents) { 00399 myEdges->detectCollisions(myStep); 00400 } 00401 MSVehicleTransfer::getInstance()->checkEmissions(myStep); 00402 myEmissionEvents->execute(myStep); 00403 00404 // execute endOfTimestepEvents 00405 myEndOfTimestepEvents->execute(myStep); 00406 00407 // update and write (if needed) detector values 00408 writeOutput(); 00409 00410 if (myLogExecutionTime) { 00411 mySimStepEnd = SysUtils::getCurrentMillis(); 00412 mySimStepDuration = mySimStepEnd - mySimStepBegin; 00413 myVehiclesMoved += myVehicleControl->getRunningVehicleNo(); 00414 } 00415 myStep += DELTA_T; 00416 }
| bool GUINet::vehicleExists | ( | const std::string & | name | ) | const |
returns the information whether the vehicle still exists
Definition at line 211 of file GUINet.cpp.
References MSVehicleControl::getVehicle(), and MSNet::myVehicleControl.
00211 { 00212 return myVehicleControl->getVehicle(name)!=0; 00213 }
| void MSNet::writeOutput | ( | ) | [inherited] |
Write netstate, emission and detector output.
Definition at line 481 of file MSNet.cpp.
References DELTA_T, OutputDevice::getDeviceByOption(), MSVehicleControl::getEmittedVehicleNo(), MSVehicleControl::getEndedVehicleNo(), MSVehicleControl::getLoadedVehicleNo(), MSVehicleControl::getMeanTravelTime(), MSVehicleControl::getMeanWaitingTime(), OptionsCont::getOptions(), MSVehicleControl::getRunningVehicleNo(), MSEmitControl::getWaitingVehicleNo(), MSNet::myDetectorControl, MSNet::myEdges, MSNet::myEmitter, MSNet::myLogExecutionTime, MSNet::mySimStepDuration, MSNet::myStep, MSNet::myVehicleControl, time2string(), MSDetectorControl::updateDetectors(), MSXMLRawOut::write(), and MSDetectorControl::writeOutput().
Referenced by MSNet::simulationStep().
00481 { 00482 // update detector values 00483 myDetectorControl->updateDetectors(myStep); 00484 // check state dumps 00485 if (OptionsCont::getOptions().isSet("netstate-dump")) { 00486 MSXMLRawOut::write(OutputDevice::getDeviceByOption("netstate-dump"), *myEdges, myStep); 00487 } 00488 // emission output 00489 if (OptionsCont::getOptions().isSet("emissions-output")) { 00490 std::string wt = myVehicleControl->getMeanWaitingTime() ? "-1.00" : time2string((SUMOTime) myVehicleControl->getMeanWaitingTime()); 00491 std::string tt = myVehicleControl->getMeanTravelTime()<0 ? "-1.00" : time2string((SUMOTime) myVehicleControl->getMeanTravelTime()); 00492 OutputDevice::getDeviceByOption("emissions-output") 00493 << " <emission-state time=\"" << time2string(myStep) << "\" " 00494 << "loaded=\"" << myVehicleControl->getLoadedVehicleNo() << "\" " 00495 << "emitted=\"" << myVehicleControl->getEmittedVehicleNo() << "\" " 00496 << "running=\"" << myVehicleControl->getRunningVehicleNo() << "\" " 00497 << "waiting=\"" << myEmitter->getWaitingVehicleNo() << "\" " 00498 << "ended=\"" << myVehicleControl->getEndedVehicleNo() << "\" " 00499 << "meanWaitingTime=\"" << wt << "\" " 00500 << "meanTravelTime=\"" << tt << "\" "; 00501 if (myLogExecutionTime) { 00502 OutputDevice::getDeviceByOption("emissions-output") 00503 << "duration=\"" << mySimStepDuration << "\" "; 00504 } 00505 OutputDevice::getDeviceByOption("emissions-output") << "/>\n"; 00506 } 00507 // write detector values 00508 myDetectorControl->writeOutput(myStep + DELTA_T, false); 00509 }
friend class GUIGlObjectStorage [friend, inherited] |
Needed to set the id.
Reimplemented in GUI_E2_ZS_CollectorOverLanes::MyWrapper.
Definition at line 111 of file GUIGlObject.h.
friend class GUIViewTraffic [friend] |
MSEventControl* MSNet::myBeginOfTimestepEvents [protected, inherited] |
Controls events executed at the begin of a time step;.
Definition at line 601 of file MSNet.h.
Referenced by MSNet::getBeginOfTimestepEvents(), MSNet::MSNet(), MSNet::simulationStep(), and MSNet::~MSNet().
Boundary GUINet::myBoundary [protected] |
the networks boundary
Definition at line 266 of file GUINet.h.
Referenced by getBoundary(), and initGUIStructures().
BusStopDictType MSNet::myBusStopDict [protected, inherited] |
Dictionary of bus stops.
Definition at line 652 of file MSNet.h.
Referenced by MSNet::addBusStop(), MSNet::getBusStop(), and MSNet::getBusStopID().
MSDetectorControl* MSNet::myDetectorControl [protected, inherited] |
Controls detectors;.
Definition at line 599 of file MSNet.h.
Referenced by MSNet::closeSimulation(), MSNet::getDetectorControl(), initDetectors(), MSNet::MSNet(), MSNet::writeOutput(), and MSNet::~MSNet().
std::map<std::string, GUIDetectorWrapper*> GUINet::myDetectorDict [protected] |
A detector dictionary.
Definition at line 278 of file GUINet.h.
Referenced by initDetectors(), and ~GUINet().
MSEdgeControl* MSNet::myEdges [protected, inherited] |
Controls edges, performs vehicle movement;.
Definition at line 591 of file MSNet.h.
Referenced by MSNet::closeBuilding(), MSNet::getEdgeControl(), MSNet::MSNet(), MSNet::simulationStep(), MSNet::writeOutput(), and MSNet::~MSNet().
MSEdgeWeightsStorage* MSNet::myEdgeWeights [protected, inherited] |
The net's knowledge about edge efforts/travel times;.
Definition at line 609 of file MSNet.h.
Referenced by MSNet::getWeightsStorage(), MSNet::MSNet(), and MSNet::~MSNet().
std::vector<GUIEdge*> GUINet::myEdgeWrapper [protected] |
MSEventControl* MSNet::myEmissionEvents [protected, inherited] |
Controls emission events;.
Definition at line 605 of file MSNet.h.
Referenced by MSNet::getEmissionEvents(), MSNet::MSNet(), MSNet::simulationState(), MSNet::simulationStep(), and MSNet::~MSNet().
MSEmitControl* MSNet::myEmitter [protected, inherited] |
Controls vehicle emissions;.
Definition at line 597 of file MSNet.h.
Referenced by MSNet::closeSimulation(), MSNet::getEmitControl(), MSNet::MSNet(), MSNet::simulationState(), MSNet::simulationStep(), MSNet::writeOutput(), and MSNet::~MSNet().
MSEventControl* MSNet::myEndOfTimestepEvents [protected, inherited] |
Controls events executed at the end of a time step;.
Definition at line 603 of file MSNet.h.
Referenced by MSNet::getEndOfTimestepEvents(), MSNet::MSNet(), MSNet::simulationStep(), and MSNet::~MSNet().
SUMORTree* GUINet::myGrid [protected] |
The visualization speed-up.
Definition at line 263 of file GUINet.h.
Referenced by initGUIStructures(), and ~GUINet().
MSNet * MSNet::myInstance = 0 [static, protected, inherited] |
Unique instance of MSNet.
Definition at line 573 of file MSNet.h.
Referenced by MSNet::getInstance(), MSNet::MSNet(), and MSNet::~MSNet().
MSJunctionControl* MSNet::myJunctions [protected, inherited] |
Controls junctions, realizes right-of-way rules;.
Definition at line 593 of file MSNet.h.
Referenced by MSNet::closeBuilding(), MSNet::getJunctionControl(), getJunctionPosition(), initGUIStructures(), MSNet::MSNet(), MSNet::simulationStep(), and MSNet::~MSNet().
std::vector<GUIJunctionWrapper*> GUINet::myJunctionWrapper [protected] |
Wrapped MS-junctions.
Definition at line 272 of file GUINet.h.
Referenced by getJunctionIDs(), initGUIStructures(), and ~GUINet().
unsigned int GUINet::myLastIdleDuration [protected] |
Definition at line 294 of file GUINet.h.
Referenced by getIdleDuration(), getWholeDuration(), and setIdleDuration().
unsigned int GUINet::myLastSimDuration [protected] |
The step durations (simulation, /*visualisation, */idle).
Definition at line 294 of file GUINet.h.
Referenced by getRTFactor(), getSimDuration(), getUPS(), getWholeDuration(), and setSimDuration().
long GUINet::myLastVehicleMovementCount [protected] |
Links2LogicMap GUINet::myLinks2Logic [protected] |
The link-to-logic-id map.
Definition at line 284 of file GUINet.h.
Referenced by getLinkTLID(), getLinkTLIndex(), and initTLMap().
bool MSNet::myLogExecutionTime [protected, inherited] |
Information whether the simulation duration shall be logged.
Definition at line 618 of file MSNet.h.
Referenced by MSNet::closeBuilding(), MSNet::closeSimulation(), MSNet::logSimulationDuration(), MSNet::MSNet(), MSNet::postSimStepOutput(), MSNet::simulationStep(), and MSNet::writeOutput().
MSTLLogicControl* MSNet::myLogics [protected, inherited] |
Controls tls logics, realizes waiting on tls rules;.
Definition at line 595 of file MSNet.h.
Referenced by MSNet::closeBuilding(), getLinkTLID(), getLinkTLIndex(), MSNet::getTLSControl(), initTLMap(), MSNet::MSNet(), MSNet::simulationStep(), and MSNet::~MSNet().
Logics2WrapperMap GUINet::myLogics2Wrapper [protected] |
The traffic light-to-wrapper map.
Definition at line 290 of file GUINet.h.
Referenced by getLinkTLID(), getLinkTLIndex(), getTLSIDs(), initTLMap(), and ~GUINet().
bool MSNet::myLogStepNumber [protected, inherited] |
Information whether the number of the simulation step shall be logged.
Definition at line 621 of file MSNet.h.
Referenced by MSNet::MSNet(), and MSNet::simulate().
long GUINet::myOverallSimDuration [protected] |
Definition at line 297 of file GUINet.h.
Referenced by getMeanRTFactor(), getMeanUPS(), and setSimDuration().
long GUINet::myOverallVehicleCount [protected] |
MSPersonControl* MSNet::myPersonControl [protected, inherited] |
Controls person building and deletion;.
Definition at line 589 of file MSNet.h.
Referenced by MSNet::getPersonControl(), MSNet::MSNet(), and MSNet::simulationStep().
MSRouteLoaderControl* MSNet::myRouteLoaders [protected, inherited] |
Route loader for dynamic loading of routes.
Definition at line 576 of file MSNet.h.
Referenced by MSNet::closeBuilding(), MSNet::MSNet(), MSNet::simulationStep(), and MSNet::~MSNet().
ShapeContainer* MSNet::myShapeContainer [protected, inherited] |
A container for geometrical shapes;.
Definition at line 607 of file MSNet.h.
Referenced by MSNet::getShapeContainer(), getShapeIDs(), MSNet::MSNet(), and MSNet::~MSNet().
long MSNet::mySimBeginMillis [protected, inherited] |
The overall simulation duration.
Definition at line 627 of file MSNet.h.
Referenced by MSNet::closeBuilding(), and MSNet::closeSimulation().
long MSNet::mySimStepBegin [protected, inherited] |
The last simulation step begin, end and duration.
Definition at line 624 of file MSNet.h.
Referenced by MSNet::simulationStep().
long MSNet::mySimStepDuration [protected, inherited] |
Definition at line 624 of file MSNet.h.
Referenced by MSNet::postSimStepOutput(), MSNet::simulationStep(), and MSNet::writeOutput().
long MSNet::mySimStepEnd [protected, inherited] |
std::vector<std::string> MSNet::myStateDumpFiles [protected, inherited] |
The names for the state files.
Definition at line 641 of file MSNet.h.
Referenced by MSNet::closeBuilding(), and MSNet::simulationStep().
std::vector<SUMOTime> MSNet::myStateDumpTimes [protected, inherited] |
Times at which a state shall be written.
Definition at line 639 of file MSNet.h.
Referenced by MSNet::closeBuilding(), and MSNet::simulationStep().
SUMOTime MSNet::myStep [protected, inherited] |
Current time step.
Definition at line 579 of file MSNet.h.
Referenced by MSNet::closeSimulation(), MSNet::getCurrentTimeStep(), MSNet::MSNet(), MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), MSNet::simulate(), MSNet::simulationState(), MSNet::simulationStep(), and MSNet::writeOutput().
std::vector<MSTrafficLightLogic*> GUINet::myTLLogicWrappers [protected] |
int MSNet::myTooManyVehicles [protected, inherited] |
Storage for maximum vehicle number.
Definition at line 646 of file MSNet.h.
Referenced by MSNet::MSNet(), and MSNet::simulationState().
MSVehicleControl* MSNet::myVehicleControl [protected, inherited] |
Controls vehicle building and deletion;.
Definition at line 587 of file MSNet.h.
Referenced by MSNet::closeSimulation(), MSNet::getVehicleControl(), MSNet::MSNet(), MSNet::postSimStepOutput(), MSNet::simulationState(), MSNet::simulationStep(), vehicleExists(), MSNet::writeOutput(), and MSNet::~MSNet().
long MSNet::myVehiclesMoved [protected, inherited] |
The overall number of vehicle movements.
Definition at line 630 of file MSNet.h.
Referenced by MSNet::closeSimulation(), getMeanUPS(), and MSNet::simulationStep().
std::vector<VehicleStateListener*> MSNet::myVehicleStateListeners [protected, inherited] |
Container for vehicle state listener.
Definition at line 655 of file MSNet.h.
Referenced by MSNet::addVehicleStateListener(), MSNet::informVehicleStateListener(), and MSNet::removeVehicleStateListener().
1.5.6