SUMO - Simulation of Urban MObility
SUMOTime.h File Reference
#include <config.h>
#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 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<SUMOReal>((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))
 
#define TS   (static_cast<SUMOReal>(DELTA_T/1000.))
 

Typedefs

typedef long long int SUMOTime
 

Functions

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
Version
Id
SUMOTime.cpp 20433 2016-04-13 08:00:14Z behrisch
Author
Daniel Krajzewicz
Jakob Erdmann
Michael Behrisch
Date
Fri, 29.04.2005
Version
Id
SUMOTime.h 20433 2016-04-13 08:00:14Z behrisch

Definition in file SUMOTime.h.

Macro Definition Documentation

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

Definition at line 59 of file SUMOTime.h.

Referenced by MSCFModel::freeSpeed(), and MSLCM_DK2008::informBlocker().

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

Definition at line 67 of file SUMOTime.h.

Referenced by MSVehicleControl::vehicleDeparted().

#define STEPS2MS (   x)    (x)

Definition at line 68 of file SUMOTime.h.

Referenced by MSFrame::buildStreams(), and MSAmitranTrajectories::writeVehicle().

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

Definition at line 65 of file SUMOTime.h.

Referenced by MSLCM_JE2013::_patchSpeed(), MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSDevice_Routing::adaptEdgeEfforts(), PublicTransportEdge< E, L, N, V >::addSchedule(), IntermodalRouter< E, L, N, V >::addSchedule(), MSBaseVehicle::addStops(), CHRouter< E, V, PF >::buildContractionHierarchy(), LogitCalculator< R, E, V >::calculateProbabilities(), MSVehicle::Influencer::changeRequestRemainingSeconds(), MSLaneChanger::checkChange(), MSNet::closeSimulation(), MSInductLoop::collectVehiclesOnDet(), ROJTRRouter::compute(), DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::compute(), IntermodalRouter< E, L, N, V >::compute(), MSVehicle::computeAngle(), MSPerson::MSPersonStage_Walking::computeAverageSpeed(), NBOwnTLDef::computeLogicAndConts(), MSE3Collector::detectorUpdate(), GUIBaseVehicle::drawLinkItem(), GUITLLogicPhasesTrackerWindow::drawValues(), MSE3Collector::enter(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSVehicle::getAccumulatedWaitingSeconds(), MEVehicle::getAverageSpeed(), MSDevice_Tripinfo::getAvgDepartDelay(), MSDevice_Tripinfo::getAvgDuration(), MSDevice_Tripinfo::getAvgTimeLoss(), MSDevice_Tripinfo::getAvgWaitingTime(), MEVehicle::getBlockTimeSeconds(), GUIMEVehicle::getColorValue(), GUIVehicle::getColorValue(), MEVehicle::getConservativeSpeed(), MSInductLoop::getCurrentOccupancy(), MEVehicle::getEventTimeSeconds(), MESegment::getEventTimeSeconds(), MSPModel_Striping::PState::getImpatience(), MEVehicle::getLastEntryTimeSeconds(), GUIVehicle::getLastLaneChangeOffset(), GUILane::getLoadedEdgeWeight(), GUICalibrator::getParameterWindow(), CState::getPosition(), GUILane::getStoredEdgeTravelTime(), MSInductLoop::getTimestepsSinceLastDetection(), PublicTransportEdge< E, L, N, V >::getTravelTime(), PedestrianEdge< E, L, N, V >::getTravelTime(), MSTransportable::getWaitingSeconds(), MEVehicle::getWaitingSeconds(), MSVehicle::getWaitingSeconds(), MSLink::getZipperSpeed(), ROMAAssignments::incremental(), MSVehicle::Influencer::influenceSpeed(), MSLCM_JE2013::inform(), MSLCM_JE2013::informFollower(), MSLCM_JE2013::informLeader(), MSTrafficLightLogic::initMesoTLSPenalties(), GNETLSEditor::initPhaseTable(), MESegment::jamThresholdForSpeed(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), TrajectoriesHandler::myStartElement(), MESegment::newArrival(), MSInductLoop::notifyEnter(), MSInstantInductLoop::notifyMove(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSInductLoop::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), GNETLSEditor::onCmdDefSwitch(), GNETLSEditor::onCmdPhaseEdit(), MSMeanData_Amitran::openInterval(), MSMeanData::openInterval(), MSLCM_JE2013::patchSpeed(), MSVehicle::planMoveInternal(), TraCIServerAPI_Vehicle::processSet(), CHRouterWrapper< E, V, PF >::recomputeCosts(), DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > >::recomputeCosts(), CHRouter< E, V, PF >::recomputeCosts(), ROMAAssignments::resetFlows(), MSLCM_JE2013::saveBlockerLength(), MSVehicleControl::scheduleVehicleRemoval(), MSLCM_JE2013::slowDownForBlocked(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), string2time(), ROMAAssignments::sue(), time2string(), MSCalibrator::totalWished(), GNETLSEditor::updateCycleDuration(), MSMoveReminder::updateDetector(), MSSwarmTrafficLightLogic::updateSensitivities(), GUIApplicationWindow::updateTimeLCD(), MSVehicleControl::vehicleDeparted(), MSLCM_JE2013::wantsChange(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSMeanData_Harmonoise::MSLaneMeanDataValues::write(), MSMeanData_Net::MSLaneMeanDataValues::write(), SUMOVehicleParameter::Stop::write(), writeInterval(), MSNet::writeOutput(), NWWriter_SUMO::writeSUMOTime(), MSInductLoop::writeTypedXMLOutput(), RORoute::writeXMLDefinition(), MSCalibrator::writeXMLOutput(), MSE2Collector::writeXMLOutput(), and MSE3Collector::writeXMLOutput().

#define SUMOTIME_MAXSTRING   "9223372036854774"

Definition at line 46 of file SUMOTime.h.

Referenced by ROMAFrame::addImportOptions(), ROFrame::fillOptions(), and fillOptions().

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

Definition at line 45 of file SUMOTime.h.

Referenced by MEVehicle::hasArrived(), MSLink::isTLSControlled(), and MEVehicle::loadState().

#define TIME2STEPS (   x)    (static_cast<SUMOTime>((x)*1000))

Definition at line 66 of file SUMOTime.h.

Referenced by MSTLLogicControl::WAUTSwitchProcedure_GSP::adaptLogic(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::adaptLogic(), MSVehicleTransfer::add(), NLHandler::addE2Detector(), NBOwnTLDef::addPedestrianPhases(), NBOwnTLDef::addPedestrianScramble(), NIImporter_SUMO::addPhase(), ODMatrix::applyCurve(), NLHandler::beginE3Detector(), NLBuilder::buildNet(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), PedestrianRouter< E, L, N, V, DijkstraRouterTT< IntermodalEdge< E, L, N, V >, IntermodalTrip< E, N, V >, prohibited_withPermissions< IntermodalEdge< E, L, N, V >, IntermodalTrip< E, N, V > > > >::compute(), IntermodalRouter< E, L, N, V >::compute(), NBOwnTLDef::computeLogicAndConts(), CState::computeTranshipTime(), MSPModel_NonInteracting::PState::computeWalkingTime(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::cutLogic(), GUITLLogicPhasesTrackerWindow::drawValues(), MSActuatedTrafficLightLogic::duration(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSLane::getCriticalLeader(), MSLane::getLeaderOnConsecutive(), MSLink::getLeaveTime(), MESegment::getNextInsertionTime(), GNETLSEditor::getSUMOTime(), SUMOSAXAttributes::getSUMOTimeReporting(), PublicTransportEdge< E, L, N, V >::getTravelTime(), MSTrafficLightLogic::initMesoTLSPenalties(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), MSLane::isInsertionSuccess(), MSTLLogicControl::WAUTSwitchProcedure::isPosAtGSP(), MSVehicle::Influencer::isVTDAffected(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSOffTrafficLightLogic::MSOffTrafficLightLogic(), NBLoadedTLDef::myCompute(), MESegment::newArrival(), MSDevice_Tripinfo::notifyMove(), MSDevice_Tripinfo::notifyMoveInternal(), GUIParameterTracker::onCmdChangeAggregation(), NIImporter_VISUM::parse_TrafficLights(), SUMOVehicleParserHelper::parseFlowAttributes(), ODMatrix::parseSingleTime(), SUMOVehicleParserHelper::parseVTypeEmbedded(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSVehicle::planMoveInternal(), MSOffTrafficLightLogic::rebuildPhase(), MESegment::receive(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::stretchLogic(), string2time(), MELoop::teleportVehicle(), MSTLLogicControl::WAUTSwitchProcedure_GSP::trySwitch(), and MSTLLogicControl::WAUTSwitchProcedure_Stretch::trySwitch().

Typedef Documentation

typedef long long int SUMOTime

Definition at line 43 of file SUMOTime.h.

Function Documentation

std::string time2string ( SUMOTime  t)

Definition at line 59 of file SUMOTime.cpp.

References OUTPUT_ACCURACY, and STEPS2TIME.

Referenced by MSVehicleTransfer::add(), GUIRunThread::begin(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Waiting::beginEventOutput(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NLBuilder::build(), CHRouter< E, V, PF >::buildContractionHierarchy(), NLBuilder::buildNet(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSDeterministicHiLevelTrafficLightLogic::canRelease(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSSwarmTrafficLightLogic::canRelease(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), NBOwnTLDef::computeLogicAndConts(), computeRoutes(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), GUITLLogicPhasesTrackerWindow::drawValues(), GUIDialog_Breakpoints::encode2TXT(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Waiting::endEventOutput(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSContainerControl::erase(), MSPersonControl::erase(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSDevice_Vehroutes::generateOutput(), MSDevice_Tripinfo::generateOutput(), MSE2Collector::getEstimateQueueLength(), IntermodalTrip< E, N, V >::getID(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), MSPModel_Striping::getNextLane(), GUICalibrator::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GUIVehicle::getParameterWindow(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), GUIVehicle::getStopInfo(), MSLane::handleCollision(), GUIApplicationWindow::handleEvent_SimulationEnded(), ROMAAssignments::incremental(), MSVehicle::Influencer::influenceChangeDecision(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSVehicle::leaveLane(), GUIRunThread::makeStep(), MSPModel_Striping::moveInDirectionOnLane(), MSLaneSpeedTrigger::myStartElement(), MSCalibrator::VehicleRemover::notifyEnter(), MSE2Collector::notifyEnter(), MSE2Collector::notifyMove(), ROLoader::openRoutes(), MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), ROLoader::processRoutes(), GUIDialog_Breakpoints::rebuildList(), MSPerson::MSPersonStage_Walking::routeOutput(), MSContainer::MSContainerStage_Waiting::routeOutput(), MSPerson::MSPersonStage_Waiting::routeOutput(), MSStateHandler::saveState(), MSBaseVehicle::saveState(), MSNet::simulate(), MSLane::succLinkSec(), MELoop::teleportVehicle(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSContainer::MSContainerStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Waiting::tripInfoOutput(), MSPerson::MSPersonStage_Driving::tripInfoOutput(), MSContainer::MSContainerStage_Tranship::tripInfoOutput(), MSPerson::MSPersonStage_Waiting::tripInfoOutput(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateDecayThreshold(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSPModel_Striping::PState::walk(), MSQueueExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), MSFullExport::write(), MSFCDExport::write(), MSXMLRawOut::write(), ODMatrix::write(), SUMOVehicleParameter::write(), MSLink::writeApproaching(), RODFDetector::writeEmitterDefinition(), ODMatrix::writeFlows(), writeInterval(), MSNet::writeOutput(), RODFDetector::writeSingleSpeedTrigger(), ROLoader::writeStats(), MSInductLoop::writeTypedXMLOutput(), TrajectoriesHandler::writeXMLEmissions(), MEInductLoop::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().

Variable Documentation

SUMOTime DELTA_T

Definition at line 39 of file SUMOTime.cpp.

Referenced by MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSDevice_Routing::adaptEdgeEfforts(), GUITLLogicPhasesTrackerWindow::addValue(), MSPersonControl::boardAnyWaiting(), MSFrame::buildStreams(), MSInsertionControl::checkCandidates(), MSLaneChanger::checkChange(), RONet::checkFlows(), GUIApplicationWindow::checkGamingEvents(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSVehicleControl::computeRandomDepartOffset(), MSSOTLTrafficLightLogic::computeReturnTime(), MSSwarmTrafficLightLogic::computeReturnTime(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), MSE2Collector::detectorUpdate(), MSMeanData::detectorUpdate(), MSInsertionControl::determineCandidates(), TraCIServer::dispatchCommand(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSEventControl::execute(), MSDevice_BTreceiver::BTreceiverUpdate::execute(), MSPModel_Striping::MovePedestrians::execute(), MSVehicle::executeMove(), TrackerValueDesc::getAggregationSpan(), MEVehicle::getConservativeSpeed(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSInductLoop::getCurrentSpeed(), MSInductLoop::getCurrentVehicleIDs(), MSLane::handleCollision(), MSVehicle::Influencer::influenceSpeed(), GUIRunThread::makeStep(), MSPModel_Striping::MSPModel_Striping(), MSRailSignal::MSRailSignal(), MSInstantInductLoop::notifyMove(), MSDevice_Tripinfo::notifyMoveInternal(), MSVehicleContainer::DepartFinder::operator()(), NLTriggerBuilder::parseAndBuildCalibrator(), SUMOVehicleParserHelper::parseVTypeEmbedded(), MSVehicle::planMoveInternal(), MSNet::postSimStepOutput(), MSDevice_Routing::preInsertionReroute(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Simulation::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TrackerValueDesc::setAggregationSpan(), MSContainerControl::setDeparture(), MSPersonControl::setDeparture(), MSFrame::setMSGlobals(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSContainerControl::setWaitEnd(), MSPersonControl::setWaitEnd(), MELoop::simulate(), MSNet::simulationStep(), MSAbstractLaneChangeModel::startLaneChangeManeuver(), MSInsertionControl::tryInsert(), MSOffTrafficLightLogic::trySwitch(), MSRailSignal::trySwitch(), MSAbstractLaneChangeModel::unchanged(), MSLaneChanger::updateChanger(), MSRailCrossing::updateCurrentPhase(), MSRailSignal::updateCurrentPhase(), MSDevice_Tripinfo::updateStatistics(), GUIApplicationWindow::updateTimeLCD(), MSPModel_Striping::PState::walk(), ODMatrix::write(), MSNet::writeOutput(), and MSMeanData::writeXMLOutput().