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