Skip to content

Commit

Permalink
trying to fix time offset in gui tests, refs #21
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@15328 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
behrisch committed Dec 15, 2013
1 parent e413ba8 commit 76c5d83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions sumo/src/gui/GUIRunThread.cpp
Expand Up @@ -100,6 +100,7 @@ GUIRunThread::init(GUINet* net, SUMOTime start, SUMOTime end) {
// preload the routes especially for TraCI
mySimulationLock.lock();
try {
net->setCurrentTimeStep(start);
net->loadRoutes();
} catch (ProcessError& e2) {
if (std::string(e2.what()) != std::string("Process Error") && std::string(e2.what()) != std::string("")) {
Expand Down
6 changes: 0 additions & 6 deletions sumo/src/microsim/MSNet.cpp
Expand Up @@ -513,12 +513,6 @@ MSNet::clearAll() {
}


SUMOTime
MSNet::getCurrentTimeStep() const {
return myStep;
}


void
MSNet::writeOutput() {
// update detector values
Expand Down
14 changes: 12 additions & 2 deletions sumo/src/microsim/MSNet.h
Expand Up @@ -204,10 +204,20 @@ class MSNet {
static std::string getStateMessage(SimulationState state);


/** @brief Returns the current simulation step (in s)
/** @brief Returns the current simulation step
* @return the current simulation step
*/
SUMOTime getCurrentTimeStep() const;
inline SUMOTime getCurrentTimeStep() const {
return myStep;
}


/** @brief Sets the current simulation step (used by state loading)
* @param step the current simulation step
*/
inline void setCurrentTimeStep(const SUMOTime step) {
myStep = step;
}


/** @brief Write netstate, summary and detector output
Expand Down

0 comments on commit 76c5d83

Please sign in to comment.