 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
56 myNet(nullptr), myHalting(true), myQuit(false), mySimulationInProgress(false), myOk(true), myHaveSignaledEnd(false),
57 mySimDelay(simDelay), myEventQue(eq), myEventThrow(ev) {
96 if (std::string(e2.what()) != std::string(
"Process Error") && std::string(e2.what()) != std::string(
"")) {
217 if (std::string(e2.what()) != std::string(
"Process Error") && std::string(e2.what()) != std::string(
"")) {
274 return myNet !=
nullptr;
287 if (
myNet !=
nullptr) {
344 window->getView()->waitForSnapshots(snapshotTime);
void setIdleDuration(int val)
Sets the duration of the last step's idle part.
SUMOTime mySimStartTime
the times the simulation starts and ends with
virtual bool simulationIsStopable() const
static void sleep(long ms)
FXMutex myBreakpointLock
Lock for modifying the list of breakpoints.
static void closeAll(bool keepErrorRetrievers=false)
bool myHaveSignaledEnd
whether the simulation already ended
The message is only something to show.
SimulationState simulationState(SUMOTime stopTime) const
Called after a simulation step, this method returns the current simulation state.
Encapsulates an object's method for using it as a message retriever.
The message is a warning.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
virtual ~GUIRunThread()
destructor
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
static OptionsCont & getOptions()
Retrieves the options.
bool myHalting
information whether the simulation is halting (is not being executed)
virtual bool simulationIsStartable() const
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
static void cleanupOnEnd()
Removes pending handler.
Event sent when the the simulation is over.
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
static long getCurrentMillis()
Returns the current time in milliseconds.
The simulation does not contain further vehicles.
std::vector< std::string > & getLoadArgs()
SimulationState
Possible states of a simulation - running or stopped with different reasons.
bool simulationAvailable() const
bool mySimulationInProgress
static GUIMainWindow * getInstance()
The final simulation step has been performed.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
OutputDevice * myWarningRetriever
GUINet * myNet
the loaded simulation network
An error occurred during the simulation step.
virtual bool simulationIsStepable() const
OutputDevice * myMessageRetriever
std::string time2string(SUMOTime t)
The simulation is loading.
void loadRoutes()
loads routes for the next few steps
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
const std::vector< GUIGlChildWindow * > & getViews() const
std::vector< SUMOTime > myBreakpoints
List of breakpoints.
void waitForSnapshots(const SUMOTime snapshotTime)
The connection to a client was closed by the client.
FXSynchQue< GUIEvent * > & myEventQue
The simulation is running.
FXEX::FXThreadEvent & myEventThrow
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static TraCIServer * getInstance()
static bool wasClosed()
check whether close was requested
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
A MSNet extended by some values for usage within the gui.
void simulationStep()
Performs a single simulation step (locking the simulation)
void setSimDuration(int val)
Sets the duration of the last step's simulation part.
The simulation had too many teleports.
virtual FXint run()
starts the execution
void guiSimulationStep()
Some further steps needed for gui processing.
#define WRITE_MESSAGE(msg)
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
void prepareDestruction()
void clear()
Clears this container.
GUIRunThread(FXApp *app, MFXInterThreadEventClient *mw, double &simDelay, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.