Eclipse SUMO - Simulation of Urban MObility
SUMOTime.h File Reference
#include <limits>
#include <string>
#include "UtilExceptions.h"
Include dependency graph for SUMOTime.h:

Go to the source code of this file.

Macros

#define ACCEL2DIST(x)   ((x)*TS*TS)
 
#define ACCEL2SPEED(x)   ((x)*TS)
 
#define DIST2SPEED(x)   ((x)/TS)
 
#define SIMSTEP   MSNet::getInstance()->getCurrentTimeStep()
 
#define SIMTIME   STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep())
 
#define SPEED2ACCEL(x)   ((x)/TS)
 
#define SPEED2DIST(x)   ((x)*TS)
 
#define STEPFLOOR(x)   (int(x/DELTA_T)*DELTA_T)
 
#define STEPS2MS(x)   (x)
 
#define STEPS2TIME(x)   (static_cast<double>((x)/1000.))
 
#define SUMOTime_MAX   std::numeric_limits<SUMOTime>::max()
 
#define SUMOTIME_MAXSTRING   "9223372036854774"
 
#define SUMOTime_MIN   std::numeric_limits<SUMOTime>::min()
 
#define TIME2STEPS(x)   (static_cast<SUMOTime>((x) * 1000. + ((x) >= 0 ? 0.5 : -0.5)))
 
#define TS   (static_cast<double>(DELTA_T/1000.))
 

Typedefs

typedef long long int SUMOTime
 

Functions

bool checkStepLengthMultiple (const SUMOTime t, const std::string &error="")
 
SUMOTime string2time (const std::string &r)
 
std::string time2string (SUMOTime t)
 

Variables

SUMOTime DELTA_T
 

Detailed Description

Author
Daniel Krajzewicz
Jakob Erdmann
Michael Behrisch
Date
Fri, 29.04.2005

Definition in file SUMOTime.h.

Macro Definition Documentation

◆ ACCEL2DIST

#define ACCEL2DIST (   x)    ((x)*TS*TS)

Definition at line 50 of file SUMOTime.h.

◆ ACCEL2SPEED

#define ACCEL2SPEED (   x)    ((x)*TS)

Definition at line 52 of file SUMOTime.h.

◆ DIST2SPEED

#define DIST2SPEED (   x)    ((x)/TS)

Definition at line 48 of file SUMOTime.h.

◆ SIMSTEP

#define SIMSTEP   MSNet::getInstance()->getCurrentTimeStep()

Definition at line 62 of file SUMOTime.h.

◆ SIMTIME

#define SIMTIME   STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep())

Definition at line 63 of file SUMOTime.h.

◆ SPEED2ACCEL

#define SPEED2ACCEL (   x)    ((x)/TS)

Definition at line 54 of file SUMOTime.h.

◆ SPEED2DIST

#define SPEED2DIST (   x)    ((x)*TS)

Definition at line 46 of file SUMOTime.h.

◆ STEPFLOOR

#define STEPFLOOR (   x)    (int(x/DELTA_T)*DELTA_T)

Definition at line 59 of file SUMOTime.h.

◆ STEPS2MS

#define STEPS2MS (   x)    (x)

Definition at line 60 of file SUMOTime.h.

◆ STEPS2TIME

#define STEPS2TIME (   x)    (static_cast<double>((x)/1000.))

Definition at line 56 of file SUMOTime.h.

◆ SUMOTime_MAX

#define SUMOTime_MAX   std::numeric_limits<SUMOTime>::max()

Definition at line 35 of file SUMOTime.h.

◆ SUMOTIME_MAXSTRING

#define SUMOTIME_MAXSTRING   "9223372036854774"

Definition at line 37 of file SUMOTime.h.

◆ SUMOTime_MIN

#define SUMOTime_MIN   std::numeric_limits<SUMOTime>::min()

Definition at line 36 of file SUMOTime.h.

◆ TIME2STEPS

#define TIME2STEPS (   x)    (static_cast<SUMOTime>((x) * 1000. + ((x) >= 0 ? 0.5 : -0.5)))

Definition at line 58 of file SUMOTime.h.

◆ TS

#define TS   (static_cast<double>(DELTA_T/1000.))

Definition at line 43 of file SUMOTime.h.

Typedef Documentation

◆ SUMOTime

typedef long long int SUMOTime

Definition at line 34 of file SUMOTime.h.

Function Documentation

◆ checkStepLengthMultiple()

bool checkStepLengthMultiple ( const SUMOTime  t,
const std::string &  error = "" 
)

◆ string2time()

SUMOTime string2time ( const std::string &  r)

Definition at line 44 of file SUMOTime.cpp.

References StringTokenizer::getVector(), STEPS2TIME, string2time(), SUMOTime_MAX, TIME2STEPS, and StringUtils::toDouble().

Referenced by ODMatrix::add(), MSDetectorControl::add(), MSDetectorControl::addDetectorAndInterval(), NLHandler::addEdgeLaneMeanData(), NLBuilder::build(), MSTransportableDevice_Routing::buildDevices(), NLBuilder::buildRouteLoaderControl(), MELoop::buildSegmentsFor(), NLTriggerBuilder::buildVaporizer(), MSDevice_Routing::buildVehicleDevices(), MSFrame::checkOptions(), MSDevice_Routing::checkOptions(), TraCIServer::cleanup(), MSNet::closeBuilding(), MSRouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closePersonFlow(), MSRouteHandler::closeVehicle(), computeRoutes(), SUMOSAXAttributes::getOptSUMOTimeReporting(), GNEStopFrame::getStopParameter(), SUMOSAXAttributes::getSUMOTimeReporting(), GUIApplicationWindow::handleEvent_SimulationLoaded(), MSPhaseDefinition::init(), MSLane::initCollisionOptions(), MSRoutingEngine::initRouter(), MSRoutingEngine::initWeightUpdate(), GUISettingsHandler::loadBreakpoints(), main(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSNet::MSNet(), MSPModel_Striping::MSPModel_Striping(), SUMORouteHandler::myEndElement(), MSStateHandler::myStartElement(), GUIDialog_Breakpoints::onCmdEditTable(), ROLoader::openRoutes(), TraCIServer::openSocket(), SUMOVehicleParameter::parseDepart(), SUMOVehicleParserHelper::parseVTypeEmbedded(), readDetectorFlows(), GUILoadThread::run(), GNEPerson::setAttribute(), GNEStop::setAttribute(), GNEVehicle::setAttribute(), GNEVehicleType::setAttribute(), MSFrame::setMSGlobals(), signalHandler(), startComputation(), string2time(), and MSFCDExport::write().

◆ time2string()

std::string time2string ( SUMOTime  t)

Definition at line 67 of file SUMOTime.cpp.

References gHumanReadableTime, gPrecision, MAX2(), MIN2(), TIME2STEPS, and TS.

Referenced by libsumo::Person::add(), MSVehicleTransfer::add(), MSPModel_Striping::add(), IntermodalNetwork< E, L, N, V >::addSchedule(), AGActivityTripWriter::addTrip(), GUIRunThread::begin(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Walking::beginEventOutput(), NLBuilder::build(), CHBuilder< E, V >::buildContractionHierarchy(), NLBuilder::buildNet(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSDeterministicHiLevelTrafficLightLogic::canRelease(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSSwarmTrafficLightLogic::canRelease(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), GUIApplicationWindow::checkGamingEventsDRT(), MSVehicleTransfer::checkInsertions(), checkStepLengthMultiple(), AStarRouter< E, V >::compute(), NBOwnTLDef::computeLogicAndConts(), computeRoutes(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), GUIVehicle::drawRouteHelper(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GUITLLogicPhasesTrackerWindow::drawValues(), GUIDialog_Breakpoints::encode2TXT(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSPerson::MSPersonStage_Walking::endEventOutput(), METriggeredCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), MSVTypeProbe::execute(), MSCalibrator::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSDevice_Tripinfo::generateOutput(), GNECalibrator::getAttribute(), GNECalibratorFlow::getAttribute(), GNEChargingStation::getAttribute(), GNEDetectorE1::getAttribute(), GNEDetectorE2::getAttribute(), GNEDetectorE3::getAttribute(), GNERerouter::getAttribute(), GNERerouterInterval::getAttribute(), GNERouteProbe::getAttribute(), GNEVaporizer::getAttribute(), GNEPerson::getAttribute(), GNEStop::getAttribute(), GNEVehicle::getAttribute(), GNEVehicleType::getAttribute(), MSVehicle::getBackPositionOnLane(), SUMOVehicleParameter::getDepart(), IntermodalTrip< E, N, V >::getID(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), MSPModel_Striping::getNextLane(), MSDevice_Routing::getParameter(), MSTransportableDevice_Routing::getParameter(), GUICalibrator::getParameterWindow(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEVehicle::getParameterWindow(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), MSTransportable::Stage_Waiting::getStageSummary(), MSPerson::MSPersonStage_Driving::getStageSummary(), GUIVehicle::getStopInfo(), MSLane::handleCollisionBetween(), GUIApplicationWindow::handleEvent_SimulationEnded(), MSVehicle::haveValidStopEdges(), ROMAAssignments::incremental(), MSVehicle::Influencer::influenceChangeDecision(), MSActuatedTrafficLightLogic::init(), MSEdge::insertVehicle(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSAbstractLaneChangeModel::laneChangeOutput(), MSVehicle::leaveLane(), GUIRunThread::makeStep(), MSPModel_Striping::moveInDirectionOnLane(), MSLaneSpeedTrigger::myStartElement(), MSCalibrator::VehicleRemover::notifyEnter(), MSTriggeredRerouter::notifyEnter(), GUIDialog_ViewSettings::onCmdExportSetting(), MSMeanData::openInterval(), ROLoader::openRoutes(), MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), MSVehicle::processLaneAdvances(), ROLoader::processRoutes(), ODMatrix::readTime(), GUIDialog_Breakpoints::rebuildList(), MSVehicle::rerouteParkingArea(), MSContainer::routeOutput(), MSTransportable::Stage_Waiting::routeOutput(), MSPerson::MSPersonStage_Walking::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), MSPerson::routeOutput(), ROPerson::Ride::saveAsXML(), MSStateHandler::saveState(), MSNet::simulate(), MSNet::simulationStep(), MSStopOut::stopEnded(), MSStopOut::stopStarted(), MSLane::succLinkSec(), MELoop::teleportVehicle(), MSContainer::tripInfoOutput(), MSPerson::tripInfoOutput(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Tranship::tripInfoOutput(), MSTransportable::Stage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateDecayThreshold(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSAbstractLaneChangeModel::updateShadowLane(), MSVehicle::updateState(), MSPModel_Striping::PState::walk(), MSVehicle::Stop::write(), SUMOVehicleParameter::Stop::write(), MSXMLRawOut::write(), MSFullExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), ODMatrix::write(), MSLink::writeApproaching(), MSChargingStation::writeChargingStationOutput(), GNEPerson::writeDemandElement(), GNEVehicle::writeDemandElement(), RODFDetector::writeEmitterDefinition(), ODMatrix::writeFlows(), writeInterval(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), RODFDetector::writeSingleSpeedTrigger(), ROLoader::writeStats(), TrajectoriesHandler::writeXMLEmissions(), MEInductLoop::writeXMLOutput(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), MSCalibrator::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

Variable Documentation

◆ DELTA_T

SUMOTime DELTA_T
extern

Definition at line 36 of file SUMOTime.cpp.

Referenced by MSCFModel_CC::_consensus(), MSCFModel_CC::_v(), MSVehicle::Influencer::GapControlState::activate(), MSRoutingEngine::adaptEdgeEfforts(), MSPModel_Striping::add(), MSTransportableControl::add(), GUITLLogicPhasesTrackerWindow::addValue(), MSDevice_ToC::awarenessRecoveryStep(), MSTransportableControl::boardAnyWaiting(), MSFrame::buildStreams(), MSVehicleType::check(), MSInsertionControl::checkCandidates(), MSLaneChanger::checkChange(), RONet::checkFlows(), GUIApplicationWindow::checkGamingEvents(), GUIApplicationWindow::checkGamingEventsDRT(), MSE2Collector::checkJam(), GUIViewTraffic::checkSnapshots(), GUISUMOAbstractView::checkSnapshots(), checkStepLengthMultiple(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSInsertionControl::computeRandomDepartOffset(), MSSOTLTrafficLightLogic::computeReturnTime(), MSSwarmTrafficLightLogic::computeReturnTime(), MSPModel_NonInteracting::PState::computeWalkingTime(), MSLane::detectCollisionBetween(), MSE3Collector::detectorUpdate(), MSMeanData::detectorUpdate(), MSInsertionControl::determineCandidates(), TraCIServer::dispatchCommand(), MSVehicle::enterLaneAtInsertion(), METriggeredCalibrator::execute(), Command_SaveTLSProgram::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSPModel_Striping::MovePedestrians::execute(), MSCalibrator::execute(), MSEventControl::execute(), MSPModel_Remote::execute(), MSVehicle::executeMove(), TrackerValueDesc::getAggregationSpan(), MEVehicle::getConservativeSpeed(), libsumo::InductionLoop::getLastStepMeanLength(), libsumo::InductionLoop::getLastStepMeanSpeed(), libsumo::InductionLoop::getLastStepVehicleIDs(), libsumo::InductionLoop::getLastStepVehicleNumber(), MSInductLoop::getOccupancy(), GUINet::getRTFactor(), MSLeaderInfo::getSubLanes(), libsumo::InductionLoop::getVehicleData(), MSVehicle::Influencer::influenceSpeed(), MSVehicle::keepStopping(), MSAbstractLaneChangeModel::laneChangeOutput(), GUIRunThread::makeStep(), MSCFModel_Rail::maxNextSpeed(), MSCFModel_Rail::minNextSpeed(), MSPModel_Striping::moveInDirectionOnLane(), MSDevice_ToC::MRMExecutionStep(), MSPModel_Remote::MSPModel_Remote(), MSRailSignal::MSRailSignal(), MSDevice_Tripinfo::notifyMove(), MSVehicleContainer::DepartFinder::operator()(), NLTriggerBuilder::parseAndBuildCalibrator(), SUMOVehicleParserHelper::parseVTypeEmbedded(), MSVehicle::planMoveInternal(), MSNet::postSimStepOutput(), MSDevice_Routing::preInsertionReroute(), MSLCM_LC2013::prepareStep(), SUMOVehicleParserHelper::processActionStepLength(), TraCIServerAPI_Vehicle::processSet(), MSDevice_ToC::requestToC(), GUIRunThread::run(), TrackerValueDesc::setAggregationSpan(), MSFrame::setMSGlobals(), libsumo::Vehicle::setSpeed(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSTransportableControl::setWaitEnd(), MELoop::simulate(), MSNet::simulationStep(), MSLaneChangerSublane::startChangeSublane(), MSAbstractLaneChangeModel::startLaneChangeManeuver(), MSDevice_ToC::ToCPreparationStep(), MSDevice_ToC::triggerDownwardToC(), MSDevice_ToC::triggerMRM(), MSInsertionControl::tryInsert(), MSOffTrafficLightLogic::trySwitch(), MSRailSignal::trySwitch(), MSAbstractLaneChangeModel::unchanged(), PolygonDynamics::update(), MSRailCrossing::updateCurrentPhase(), GUIApplicationWindow::updateTimeLCD(), MSVehicle::updateWaitingTime(), MSPModel_Striping::PState::walk(), ODMatrix::write(), MSNet::writeOutput(), and MSMeanData::writeXMLOutput().