![]() |
Eclipse SUMO - Simulation of Urban MObility
|
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_MAX_PERIOD (SUMOTime_MAX - SUMOTime_MAX % DELTA_T) |
#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 deltaT=DELTA_T) |
check if given SUMOTime is multiple of the step length More... | |
std::string | elapsedMs2string (long long int t) |
convert ms to string for log output More... | |
SUMOTime | string2time (const std::string &r) |
convert string to SUMOTime More... | |
std::string | time2string (SUMOTime t) |
convert SUMOTime to string More... | |
Variables | |
SUMOTime | DELTA_T |
Definition in file SUMOTime.h.
Definition at line 48 of file SUMOTime.h.
#define ACCEL2SPEED | ( | x | ) | ((x)*TS) |
Definition at line 50 of file SUMOTime.h.
#define DIST2SPEED | ( | x | ) | ((x)/TS) |
Definition at line 46 of file SUMOTime.h.
#define SIMSTEP MSNet::getInstance()->getCurrentTimeStep() |
Definition at line 60 of file SUMOTime.h.
#define SIMTIME STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) |
Definition at line 61 of file SUMOTime.h.
#define SPEED2ACCEL | ( | x | ) | ((x)/TS) |
Definition at line 52 of file SUMOTime.h.
#define SPEED2DIST | ( | x | ) | ((x)*TS) |
Definition at line 44 of file SUMOTime.h.
Definition at line 57 of file SUMOTime.h.
#define STEPS2MS | ( | x | ) | (x) |
Definition at line 58 of file SUMOTime.h.
#define STEPS2TIME | ( | x | ) | (static_cast<double>(x)/1000.) |
Definition at line 54 of file SUMOTime.h.
#define SUMOTime_MAX std::numeric_limits<SUMOTime>::max() |
Definition at line 33 of file SUMOTime.h.
#define SUMOTime_MAX_PERIOD (SUMOTime_MAX - SUMOTime_MAX % DELTA_T) |
Definition at line 35 of file SUMOTime.h.
#define SUMOTime_MIN std::numeric_limits<SUMOTime>::min() |
Definition at line 34 of file SUMOTime.h.
#define TIME2STEPS | ( | x | ) | (static_cast<SUMOTime>((x) * 1000. + ((x) >= 0 ? 0.5 : -0.5))) |
Definition at line 56 of file SUMOTime.h.
#define TS (static_cast<double>(DELTA_T)/1000.) |
Definition at line 41 of file SUMOTime.h.
typedef long long int SUMOTime |
Definition at line 32 of file SUMOTime.h.
bool checkStepLengthMultiple | ( | const SUMOTime | t, |
const std::string & | error = "" , |
||
SUMOTime | deltaT = DELTA_T |
||
) |
check if given SUMOTime is multiple of the step length
Definition at line 123 of file SUMOTime.cpp.
References time2string(), and WRITE_WARNING.
Referenced by MSFrame::checkOptions(), NLDetectorBuilder::checkSampleInterval(), and NLDetectorBuilder::createEdgeLaneMeanData().
std::string elapsedMs2string | ( | long long int | t | ) |
convert ms to string for log output
Definition at line 110 of file SUMOTime.cpp.
References gHumanReadableTime, STEPS2TIME, time2string(), and toString().
Referenced by MSNet::generateStatistics(), and SUMOAbstractRouter< E, V >::~SUMOAbstractRouter().
SUMOTime string2time | ( | const std::string & | r | ) |
convert string to SUMOTime
Definition at line 45 of file SUMOTime.cpp.
References StringTokenizer::getVector(), STEPS2TIME, string2time(), SUMOTime_MAX, TIME2STEPS, and StringUtils::toDouble().
Referenced by MSNet::adaptIntermodalRouter(), RONet::adaptIntermodalRouter(), ODMatrix::add(), MSDetectorControl::add(), MSDetectorControl::addDetectorAndInterval(), NLHandler::addEdgeLaneMeanData(), NLHandler::addPhase(), NLBuilder::build(), GNEAdditionalFrame::buildAdditionalOverView(), GNETLSEditorFrame::TLSPhases::buildDefaultPhase(), MSTransportableDevice_Routing::buildDevices(), NLBuilder::buildNet(), NLBuilder::buildRouteLoaderControl(), NLTriggerBuilder::buildVaporizer(), MSDevice_Routing::buildVehicleDevices(), MSFrame::checkOptions(), MSDevice_Routing::checkOptions(), TraCIServer::cleanup(), MSNet::closeBuilding(), MSRouteHandler::closeFlow(), MSRouteHandler::closeTransportable(), MSRouteHandler::closeTransportableFlow(), MSRouteHandler::closeVehicle(), computeRoutes(), LIBSUMO_NAMESPACE::Simulation::getEndTime(), MSTLLogicControl::WAUTSwitchProcedure::getGSPTime(), MSNet::getIntermodalRouter(), MSNet::getMesoType(), SUMOSAXAttributes::getOptPeriod(), SUMOSAXAttributes::getOptSUMOTimeReporting(), SUMOSAXAttributes::getPeriod(), SUMOSAXAttributes::getSUMOTimeReporting(), MSDevice::getTimeParam(), GUIMessageWindow::getTimeString(), GUIApplicationWindow::handleEvent_SimulationLoaded(), MSRailCrossing::init(), MSActuatedTrafficLightLogic::init(), MSLane::initCollisionOptions(), MSDevice_Taxi::initDispatch(), MSRoutingEngine::initRouter(), MSRoutingEngine::initWeightUpdate(), LIBSUMO_NAMESPACE::Simulation::load(), GUISettingsHandler::loadBreakpoints(), GUINet::loadEdgeData(), main(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDevice_Taxi::MSDevice_Taxi(), MSNet::MSNet(), MSPModel_Striping::MSPModel_Striping(), MSTransportableControl::MSTransportableControl(), MSTriggeredRerouter::myEndElement(), SUMORouteHandler::myEndElement(), MSStateHandler::MSStateTimeHandler::myStartElement(), MSStateHandler::myStartElement(), GUIDialog_Breakpoints::onCmdEditTable(), ROLoader::openRoutes(), TraCIServer::openSocket(), SUMOVehicleParserHelper::parseAngleTimesMap(), SUMOVehicleParameter::parseDepart(), MSNet::quickReload(), readDetectorFlows(), GUILoadThread::run(), GNECalibratorFlow::setAttribute(), GNEInductionLoopDetector::setAttribute(), GNELaneAreaDetector::setAttribute(), GNEMultiEntryExitDetector::setAttribute(), GNERouteProbe::setAttribute(), GNEVariableSpeedSignStep::setAttribute(), GNEContainer::setAttribute(), GNEPerson::setAttribute(), GNERoute::setAttribute(), GNEStop::setAttribute(), GNEVehicle::setAttribute(), GNEVType::setAttribute(), MSFrame::setMSGlobals(), MSRailCrossing::setParameter(), MSActuatedTrafficLightLogic::setParameter(), MSSimpleTrafficLightLogic::setParameter(), LIBSUMO_NAMESPACE::Vehicle::setStopParameter(), signalHandler(), startComputation(), string2time(), GNERouteHandler::transformToFlow(), GNERouteHandler::transformToRouteFlow(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::WAUTSwitchProcedure_Stretch(), MSQueueExport::write(), MSFCDExport::write(), MSEmissionExport::write(), and MSNet::writeSummaryOutput().
std::string time2string | ( | SUMOTime | t | ) |
convert SUMOTime to string
Definition at line 68 of file SUMOTime.cpp.
References gHumanReadableTime, gPrecision, MAX2(), MIN2(), SUMOTime_MAX, TIME2STEPS, and TS.
Referenced by RailwayRouter< E, V >::_compute(), MSTransportable::abortStage(), LIBSUMO_NAMESPACE::Person::add(), MSVehicleTransfer::add(), MSPModel_Striping::add(), MSTriggeredRerouter::addParkValues(), MSDispatch::addReservation(), IntermodalNetwork< E, L, N, V >::addSchedule(), MSBaseVehicle::addStop(), AGActivityTripWriter::addTrip(), GNEDemandElement::adjustDefaultFlowAttributes(), GUIRunThread::begin(), NLBuilder::build(), CHBuilder< E, V >::buildContractionHierarchy(), NLBuilder::buildNet(), MSBaseVehicle::calculateArrivalParams(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSDeterministicHiLevelTrafficLightLogic::canRelease(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSSwarmTrafficLightLogic::canRelease(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), GUIApplicationWindow::checkGamingEventsDRT(), MSVehicleTransfer::checkInsertions(), MSFrame::checkOptions(), checkStepLengthMultiple(), MEVehicle::checkStop(), MSNet::closeSimulation(), DijkstraRouter< E, V >::compute(), MSDispatch_Greedy::computeDispatch(), MSDispatch_GreedyClosest::computeDispatch(), NBOwnTLDef::computeLogicAndConts(), computeRoutes(), MSDevice_Taxi::customerArrived(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSSOTLPolicy::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), MSDispatch_GreedyShared::dispatch(), MSDispatch_RouteExtension::dispatch(), MSDevice_Taxi::dispatchShared(), GUIBaseVehicle::drawParkingInfo(), GUIBaseVehicle::drawStopLabels(), GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), elapsedMs2string(), GUIDialog_Breakpoints::encode2TXT(), MSParkingArea::enter(), MSDevice_SSM::estimateConflictTimes(), METriggeredCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitches::execute(), Command_SaveTLSSwitchStates::execute(), Command_RouteReplacement::execute(), MSVTypeProbe::execute(), MSCalibrator::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSDevice_Taxi::generateOutput(), MSDevice_Tripinfo::generateOutput(), CommonXMLStructure::SumoBaseObject::getAllAttributes(), GNECalibrator::getAttribute(), GNECalibratorFlow::getAttribute(), GNEChargingStation::getAttribute(), GNEInductionLoopDetector::getAttribute(), GNELaneAreaDetector::getAttribute(), GNEMultiEntryExitDetector::getAttribute(), GNERerouter::getAttribute(), GNERerouterInterval::getAttribute(), GNERouteProbe::getAttribute(), GNEVaporizer::getAttribute(), GNEVariableSpeedSignStep::getAttribute(), GNEContainer::getAttribute(), GNEPerson::getAttribute(), GNERoute::getAttribute(), GNEStop::getAttribute(), GNEVehicle::getAttribute(), GNEVType::getAttribute(), MSVehicle::getBackPositionOnLane(), GNEContainer::getBegin(), GNEPerson::getBegin(), GNEVehicle::getBegin(), SUMOVehicleParameter::getDepart(), MSRailSignal::LinkInfo::getDriveWay(), IntermodalTrip< E, N, V >::getID(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), MSPModel_Striping::getNextLane(), MSDevice_Routing::getParameter(), MSTransportableDevice_Routing::getParameter(), GUICalibrator::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIMEVehicle::getParameterWindow(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), MSStageDriving::getStageSummary(), MSStageWaiting::getStageSummary(), GUIVehicle::getStopInfo(), LIBSUMO_NAMESPACE::Vehicle::getStopParameter(), MSLane::handleCollisionBetween(), GUIApplicationWindow::handleEvent_SimulationEnded(), MSBaseVehicle::haveValidStopEdges(), MSIdling_Stop::idle(), MSVehicle::Influencer::implicitDeltaPosRemote(), ROMAAssignments::incremental(), MSVehicle::Influencer::influenceChangeDecision(), MSActuatedTrafficLightLogic::init(), MSEdge::insertVehicle(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSVehicle::joinTrainPartFront(), MSAbstractLaneChangeModel::laneChangeOutput(), MSVehicle::leaveLane(), LIBSUMO_NAMESPACE::Simulation::load(), GUINet::loadEdgeData(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveTo(), MSPModel_Striping::PState::moveToXY(), MSLaneSpeedTrigger::myStartElement(), MSCalibrator::VehicleRemover::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSE2Collector::notifyMove(), MSDevice_Vehroutes::notifyStopEnded(), GUIDialog_ViewSettings::onCmdExportSetting(), GUIParameterTracker::onCmdSave(), MSMeanData::openInterval(), ROLoader::openRoutes(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSNet::postSimStepOutput(), MSNet::preSimStepOutput(), MSVehicle::processLaneAdvances(), ROLoader::processRoutes(), ODMatrix::readTime(), GUIDialog_Breakpoints::rebuildList(), MSCalibrator::removePending(), MSBaseVehicle::replaceRoute(), MSTriggeredRerouter::rerouteParkingArea(), MSVehicle::rerouteParkingArea(), GNENetHelper::AttributeCarriers::retrieveRerouterInterval(), MSPerson::MSPersonStage_Walking::routeOutput(), MSStageDriving::routeOutput(), MSStageTranship::routeOutput(), MSStageWaiting::routeOutput(), MSTransportable::routeOutput(), ROPerson::Ride::saveAsXML(), ROPerson::Walk::saveAsXML(), MSStateHandler::saveState(), MEVehicle::saveState(), MSVehicle::saveState(), GUIMessageWindow::setCursorPos(), MSCalibrator::setFlow(), MSNet::simulate(), MSNet::simulationStep(), MSStopOut::stopEnded(), MSStopOut::stopStarted(), MSLane::succLinkSec(), MELoop::teleportVehicle(), MSTransportable::tripInfoOutput(), MSPerson::MSPersonStage_Walking::tripInfoOutput(), MSPerson::MSPersonStage_Access::tripInfoOutput(), MSStageDriving::tripInfoOutput(), MSStageTranship::tripInfoOutput(), MSStageWaiting::tripInfoOutput(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateDecayThreshold(), MSDevice_Taxi::updateMove(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSAbstractLaneChangeModel::updateShadowLane(), MSVehicle::updateState(), MSPModel_Striping::PState::walk(), MSStop::write(), SUMOVehicleParameter::Stop::write(), MSXMLRawOut::write(), MSElecHybridExport::write(), MSFullExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSBatteryExport::write(), MSEmissionExport::write(), ODMatrix::write(), GNECalibrator::writeAdditional(), GNEInductionLoopDetector::writeAdditional(), GNELaneAreaDetector::writeAdditional(), GNEMultiEntryExitDetector::writeAdditional(), GNERerouter::writeAdditional(), GNERouteProbe::writeAdditional(), GNEVaporizer::writeAdditional(), GNEVariableSpeedSignStep::writeAdditional(), MSElecHybridExport::writeAggregated(), MSLink::writeApproaching(), MSNet::writeCollisions(), GNEContainer::writeDemandElement(), GNEPerson::writeDemandElement(), GNERoute::writeDemandElement(), GNEVehicle::writeDemandElement(), RODFDetector::writeEmitterDefinition(), ODMatrix::writeFlows(), ROMAAssignments::writeInterval(), MSNet::writeOutput(), MSDevice_Vehroutes::writeOutput(), RODFDetector::writeSingleSpeedTrigger(), MSDevice_Tripinfo::writeStatistics(), ROLoader::writeStats(), MSNet::writeSummaryOutput(), MSTractionSubstation::writeTractionSubstationOutput(), MSChargingStation::writeVehicle(), MSOverheadWire::writeVehicle(), TrajectoriesHandler::writeXMLEmissions(), MEInductLoop::writeXMLOutput(), MSE2Collector::writeXMLOutput(), MSE3Collector::writeXMLOutput(), MSCalibrator::writeXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSDevice_Vehroutes::writeXMLRoute().
|
extern |
Definition at line 37 of file SUMOTime.cpp.
Referenced by MSCFModel_CC::_consensus(), MSCFModel_CACC::_v(), MSCFModel_CC::_v(), MSVehicle::Influencer::GapControlState::activate(), MSRoutingEngine::adaptEdgeEfforts(), MSTransportableControl::add(), MSPModel_Striping::add(), MSVehicleContainer::add(), GUITLLogicPhasesTrackerWindow::addValue(), MSCFModel::applyStartupDelay(), MSDevice_ToC::awarenessRecoveryStep(), MSFrame::buildStreams(), MSVehicleType::check(), MELoop::checkCar(), MSLaneChanger::checkChange(), RONet::checkFlows(), GUIApplicationWindow::checkGamingEvents(), GUIApplicationWindow::checkGamingEventsDRT(), MSE2Collector::checkJam(), GUIViewTraffic::checkSnapshots(), GUISUMOAbstractView::checkSnapshots(), MEVehicle::checkStop(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSPModel_NonInteracting::PState::computeDuration(), MSLink::computeFoeArrivalTimeBraking(), MSInsertionControl::computeRandomDepartOffset(), MSSOTLTrafficLightLogic::computeReturnTime(), MSSwarmTrafficLightLogic::computeReturnTime(), MSCFModel_Krauss::createVehicleVariables(), MSLane::detectCollisionBetween(), MSE3Collector::detectorUpdate(), MSMeanData::detectorUpdate(), TraCIServer::dispatchCommand(), MSPModel_Striping::PState::distToLaneEnd(), 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(), MSCFModel_EIDM::finalizeSpeed(), MSTransportableControl::fixLoadCount(), TrackerValueDesc::getAggregationSpan(), MSVehicle::getArrivalTime(), MEVehicle::getConservativeSpeed(), LIBSUMO_NAMESPACE::InductionLoop::getLastStepMeanLength(), LIBSUMO_NAMESPACE::InductionLoop::getLastStepMeanSpeed(), LIBSUMO_NAMESPACE::InductionLoop::getLastStepVehicleIDs(), LIBSUMO_NAMESPACE::InductionLoop::getLastStepVehicleNumber(), MSInductLoop::getOccupancy(), GUINet::getRTFactor(), MSVehicle::getStopDelay(), MSLeaderInfo::getSubLanes(), LIBSUMO_NAMESPACE::InductionLoop::getVehicleData(), GUIApplicationWindow::handleEvent_SimulationLoaded(), MSDevice_Battery::increaseChargingStartTime(), MSVehicle::Influencer::influenceSpeed(), MSLane::insertVehicle(), MSVehicle::keepStopping(), MSAbstractLaneChangeModel::laneChangeOutput(), MSTransportableControl::loadAnyWaiting(), GUIRunThread::makeStep(), MSPModel_Striping::moveInDirectionOnLane(), MSDevice_ToC::MRMExecutionStep(), MSCFModel_Krauss::MSCFModel_Krauss(), MSPModel_Remote::MSPModel_Remote(), MSRailSignal::MSRailSignal(), MSDevice_Tripinfo::notifyIdle(), MSDevice_ElecHybrid::notifyMove(), MSDevice_Taxi::notifyMove(), MSDevice_Transportable::notifyMove(), MSDevice_Tripinfo::notifyMove(), GUIDialog_Breakpoints::onCmdEditTable(), GUIParameterTracker::onCmdSave(), MSVehicleContainer::DepartFinder::operator()(), NLTriggerBuilder::parseAndBuildCalibrator(), AdditionalHandler::parseCalibratorAttributes(), MSCFModel_Krauss::patchSpeedBeforeLC(), MSNet::postSimStepOutput(), MSDevice_Routing::preInsertionReroute(), SUMOVehicleParserHelper::processActionStepLength(), TraCIServerAPI_Vehicle::processSet(), MSDevice_ToC::requestToC(), TrackerValueDesc::setAggregationSpan(), MSFrame::setMSGlobals(), LIBSUMO_NAMESPACE::Vehicle::setSpeed(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSTransportableControl::setWaitEnd(), MSTrafficLightLogic::SwitchCommand::shiftTime(), MELoop::simulate(), MSNet::simulationStep(), MSCFModel_EIDM::slowToStartTerm(), MSLaneChangerSublane::startChangeSublane(), MSAbstractLaneChangeModel::startLaneChangeManeuver(), MSDevice_ToC::ToCPreparationStep(), MSDevice_ToC::triggerDownwardToC(), MSDevice_ToC::triggerMRM(), GUIRunThread::tryStep(), MSOffTrafficLightLogic::trySwitch(), MSRailSignal::trySwitch(), NEMALogic::trySwitch(), MSAbstractLaneChangeModel::unchanged(), NEMAPhase::update(), PolygonDynamics::update(), MSRailCrossing::updateCurrentPhase(), GUIApplicationWindow::updateTimeLCD(), MSVehicle::updateWaitingTime(), MSPModel_Striping::PState::walk(), ODMatrix::write(), MSChargingStation::writeChargingStationOutput(), MSNet::writeOutput(), MSOverheadWire::writeOverheadWireSegmentOutput(), and MSMeanData::writeXMLOutput().