Definition in file SUMOTime.h.
#include <config.h>
#include <string>
#include "UtilExceptions.h"
Go to the source code of this file.
Defines | |
| #define | ACCEL2DIST(x) (x) |
| #define | ACCEL2SPEED(x) (x) |
| #define | DELTA_T 1 |
| #define | DIST2SPEED(x) (x) |
| #define | SPEED2ACCEL(x) (x) |
| #define | SPEED2DIST(x) (x) |
| #define | STEPS2TIME(x) (static_cast<SUMOReal>(x)) |
| #define | SUMOTime_MAX INT_MAX |
| #define | TIME2STEPS(x) (static_cast<SUMOTime>(x)) |
| #define | TS (static_cast<SUMOReal>(1.)) |
Typedefs | |
| typedef int | SUMOTime |
Functions | |
| SUMOTime | string2time (const std::string &r) throw (EmptyData, NumberFormatException) |
| std::string | time2string (SUMOTime t) throw () |
| #define ACCEL2DIST | ( | x | ) | (x) |
| #define ACCEL2SPEED | ( | x | ) | (x) |
Definition at line 55 of file SUMOTime.h.
Referenced by MSCFModel_IDM::_updateSpeed(), MSCFModel_Kerner::_v(), MSCFModel_PWag2009::dawdle(), MSCFModel_KraussOrig1::dawdle(), MSCFModel_Krauss::dawdle(), MSCFModel::getSpeedAfterMaxDecel(), MSCFModel::maxNextSpeed(), MSCFModel_PWag2009::moveHelper(), MSCFModel_KraussOrig1::moveHelper(), MSCFModel_Krauss::moveHelper(), MSCFModel_Kerner::moveHelper(), MSCFModel_IDM::moveHelper(), MSLCM_DK2004::wantsChangeToLeft(), and MSLCM_DK2004::wantsChangeToRight().
| #define DELTA_T 1 |
Definition at line 44 of file SUMOTime.h.
Referenced by RORDGenerator_ODAmounts::FlowDef::addRoutes(), RORDGenerator_ODAmounts::buildRoutes(), MSLaneChanger::change(), MSEmitControl::checkFlows(), traci::TraCIServer::commandGetTLStatus(), traci::TraCIServer::dispatchCommand(), MSE3Collector::enter(), MSEventControl::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSState::execute(), RORDGenerator_ODAmounts::FlowDef::FlowDef(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSInductLoop::getCurrentSpeed(), MSInductLoop::getCurrentVehicleIDs(), MSInductLoop::getNVehContributed(), MSMeanData_Net::MSLaneMeanDataValues::isStillActive(), MSMeanData_HBEFA::MSLaneMeanDataValues::isStillActive(), MSE3Collector::leave(), GUIRunThread::makeStep(), MSVehicle::moveFirstChecked(), MSVehicleContainer::DepartFinder::operator()(), NLTriggerBuilder::parseAndBuildCalibrator(), MSNet::postSimStepOutput(), MSVehicle::processNextStop(), ROLoader::processRoutesStepWise(), TraCIServerAPI_TLS::processSet(), MSPersonControl::setArrival(), MSFrame::setMSGlobals(), MSNet::simulationStep(), MSOffTrafficLightLogic::trySwitch(), MSDevice_HBEFA::wrappedComputeCommandExecute(), MSTriggeredReader::wrappedExecute(), MSNet::writeOutput(), and MSMeanData::writeXMLOutput().
| #define DIST2SPEED | ( | x | ) | (x) |
Definition at line 51 of file SUMOTime.h.
| #define SPEED2ACCEL | ( | x | ) | (x) |
Definition at line 57 of file SUMOTime.h.
Referenced by MSCFModel_PWag2009::moveHelper(), MSCFModel_KraussOrig1::moveHelper(), MSCFModel_Krauss::moveHelper(), MSCFModel_Kerner::moveHelper(), and MSCFModel_IDM::moveHelper().
| #define SPEED2DIST | ( | x | ) | (x) |
Definition at line 49 of file SUMOTime.h.
Referenced by MSCFModel_Kerner::_v(), getMaxSpeedRegardingNextLanes(), MSLaneChanger::getRealFollower(), MSCFModel_PWag2009::hasSafeGap(), MSCFModel_KraussOrig1::hasSafeGap(), MSCFModel_Krauss::hasSafeGap(), MSCFModel_Kerner::hasSafeGap(), MSCFModel_IDM::hasSafeGap(), MSLCM_DK2004::informBlocker(), MSCFModel_PWag2009::interactionGap(), MSCFModel_KraussOrig1::interactionGap(), MSCFModel_Krauss::interactionGap(), MSCFModel_Kerner::interactionGap(), MSCFModel_IDM::interactionGap(), MSLane::isEmissionSuccess(), MSMeanData_Net::MSLaneMeanDataValues::isStillActive(), MSMeanData_HBEFA::MSLaneMeanDataValues::isStillActive(), MSMeanData_Harmonoise::MSLaneMeanDataValues::isStillActive(), MSVehicle::moveFirstChecked(), MSVehicle::onRemovalFromNet(), MSLane::pop(), MSLane::push(), and MSVehicle::vsafeCriticalCont().
| #define STEPS2TIME | ( | x | ) | (static_cast<SUMOReal>(x)) |
Definition at line 59 of file SUMOTime.h.
Referenced by MSInductLoop::collectVehiclesOnDet(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getTimestepsSinceLastDetection(), MSVehicle::getWaitingSeconds(), MSInductLoop::isStillActive(), MSInductLoop::MSInductLoop(), MSMeanData_Net::MSLaneMeanDataValues::write(), MSMeanData_HBEFA::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), and MSInductLoop::writeXMLOutput().
| #define SUMOTime_MAX INT_MAX |
Definition at line 40 of file SUMOTime.h.
Referenced by traci::TraCIServer::commandChangeRoute(), NLDetectorBuilder::createEdgeLaneMeanData(), FXIMPLEMENT(), traci::TraCIHandler::openVehicleTag(), SUMOVehicleParserHelper::parseFlowAttributes(), and ROLoader::processAllRoutes().
| #define TIME2STEPS | ( | x | ) | (static_cast<SUMOTime>(x)) |
Definition at line 60 of file SUMOTime.h.
Referenced by NLHandler::addE2Detector(), NLHandler::beginE3Detector(), NLBuilder::buildNet(), MSLane::isEmissionSuccess(), MSLink::opened(), and MSVehicle::vsafeCriticalCont().
| #define TS (static_cast<SUMOReal>(1.)) |
Definition at line 46 of file SUMOTime.h.
Referenced by MSInductLoop::getCurrentOccupancy(), MSMeanData_Harmonoise::MSLaneMeanDataValues::isStillActive(), MSE3Collector::update(), and MSMeanData_Harmonoise::MSLaneMeanDataValues::write().
| typedef int SUMOTime |
Definition at line 39 of file SUMOTime.h.
| SUMOTime string2time | ( | const std::string & | r | ) | throw (EmptyData, NumberFormatException) |
Definition at line 45 of file SUMOTime.cpp.
References TplConvert< E >::_2int().
Referenced by MSDetectorControl::addDetectorAndInterval(), NLHandler::addEdgeLaneMeanData(), ROLoader::buildNamedHandler(), NLTriggerBuilder::buildVaporizer(), MSDevice_Routing::buildVehicleDevices(), MSRouteHandler::closeFlow(), MSRouteHandler::closeVehicle(), traci::TraCIServer::commandChangeRoute(), computeRoutes(), FXIMPLEMENT(), main(), MSNet::MSNet(), MSPhaseDefinition::MSPhaseDefinition(), ROLoader::openRoutes(), traci::TraCIHandler::openVehicleTag(), SUMOVehicleParserHelper::parseFlowAttributes(), readDetectorFlows(), testclient::TraCITestClient::run(), GUILoadThread::run(), MSFrame::setMSGlobals(), NLHandler::setOffset(), and startComputation().
00045 { 00046 size_t idx = r.find('.'); 00047 if (idx==std::string::npos) { 00048 // no sub-seconds 00049 return TplConvert<char>::_2int(r.c_str())*1000; 00050 } 00051 int secs = idx>0 ? TplConvert<char>::_2int(r.substr(0, idx).c_str()) : 0; 00052 int subsecs = TplConvert<char>::_2int((r.substr(idx+1)+"0000").substr(0,3).c_str()) * 10; 00053 do { 00054 subsecs = subsecs / 10; 00055 } while (idx<r.length()&&r[idx]=='0'); 00056 return secs*1000 + subsecs; 00057 }
| std::string time2string | ( | SUMOTime | t | ) | throw () |
Definition at line 61 of file SUMOTime.cpp.
References SUMOReal.
Referenced by testclient::TraCITestClient::commandChangeLane(), testclient::TraCITestClient::commandGetTLStatus(), testclient::TraCITestClient::commandSimulationStep(), testclient::TraCITestClient::commandSlowDown(), testclient::TraCITestClient::commandStopNode(), MSPersonControl::erase(), MSVTypeProbe::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSState::execute(), GUIVehicle::getParameterWindow(), GUIApplicationWindow::handleEvent_SimulationLoaded(), GUIApplicationWindow::handleEvent_SimulationStep(), main(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), ROLoader::openRoutes(), MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), ROLoader::processRoutesStepWise(), MSVehicleControl::scheduleVehicleRemoval(), MSPerson::MSPersonStage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), testclient::TraCITestClient::validateGetTLStatus(), testclient::TraCITestClient::validateSimulationStep(), testclient::TraCITestClient::validateStopNode(), MSXMLRawOut::write(), SUMOVehicleParameter::writeAs(), MSNet::writeOutput(), ROLoader::writeStats(), MSRouteProbe::writeXMLOutput(), MSMeanData::writeXMLOutput(), MSInductLoop::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSE2Collector::writeXMLOutput(), and MSVehicle::writeXMLRoute().
00061 { 00062 std::ostringstream oss; 00063 oss << ((SUMOReal) t / 1000.); 00064 std::string ret = oss.str(); 00065 size_t idx = ret.find('.'); 00066 if (idx==std::string::npos) { 00067 return ret + ".00"; 00068 } 00069 return (ret+"00").substr(0, idx+3); 00070 }
1.5.6