Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
StdDefs.cpp File Reference
#include "StdDefs.h"
#include <sstream>
Include dependency graph for StdDefs.cpp:

Go to the source code of this file.

Functions

int getScalingQuota (double frac, int loaded)
 Returns the number of instances of the current object that shall be emitted given the number of loaded objects considering that "frac" of all objects shall be emitted overall.
 
double roundBits (double x, int fractionBits)
 round to the given number of mantissa bits beyond the given number
 
double roundDecimal (double x, int precision)
 round to the given number of decimal digits
 
double roundDecimalToEven (double x, int precision)
 round to the given number of decimal digits (bankers rounding)
 
double truncate (double x, int fractionBits)
 discrds mantissa bits beyond the given number
 

Variables

bool gDebugFlag1 = false
 global utility flags for debugging
 
bool gDebugFlag2 = false
 
bool gDebugFlag3 = false
 
bool gDebugFlag4 = false
 
bool gDebugFlag5 = false
 
bool gDebugFlag6 = false
 
bool gHumanReadableTime = false
 
bool gIgnoreUnknownVClass = false
 
std::string gLanguage = "C"
 the language for GUI elements and messages
 
int gPrecision = 2
 the precision for floating point outputs
 
int gPrecisionEmissions = 2
 
int gPrecisionGeo = 6
 
int gPrecisionRandom = 4
 
bool gSimulation = false
 
int GUIDesignDialogButtonsHeight = 32
 the default height for dialog buttons
 
int GUIDesignHeight = 23
 the default height for GUI elements
 
double gWeightsRandomFactor = 1
 
double gWeightsWalkOppositeFactor = 1
 

Detailed Description

Author
Jakob Erdmann
Michael Behrisch
Laura Bieker
Date
2014-01-07

Definition in file StdDefs.cpp.

Function Documentation

◆ getScalingQuota()

int getScalingQuota ( double  frac,
int  loaded 
)

Returns the number of instances of the current object that shall be emitted given the number of loaded objects considering that "frac" of all objects shall be emitted overall.

Returns
the number of objects to create (something between 0 and ceil(frac))

Definition at line 69 of file StdDefs.cpp.

Referenced by MSVehicleControl::getQuota(), ROMARouteHandler::myEndElement(), and RONet::saveAndRemoveRoutesUntil().

Here is the caller graph for this function:

◆ roundBits()

double roundBits ( double  x,
int  fractionBits 
)

round to the given number of mantissa bits beyond the given number

Definition at line 51 of file StdDefs.cpp.

◆ roundDecimal()

double roundDecimal ( double  x,
int  precision 
)

round to the given number of decimal digits

Definition at line 57 of file StdDefs.cpp.

Referenced by MSVehicleType::computeChosenSpeedDeviation(), MSLane::getDepartPosLat(), MSLane::getDepartSpeed(), and MSLane::insertVehicle().

Here is the caller graph for this function:

◆ roundDecimalToEven()

double roundDecimalToEven ( double  x,
int  precision 
)

round to the given number of decimal digits (bankers rounding)

Definition at line 63 of file StdDefs.cpp.

Referenced by Position::round(), and NBEdge::roundSpeed().

Here is the caller graph for this function:

◆ truncate()

double truncate ( double  x,
int  fractionBits 
)

discrds mantissa bits beyond the given number

Definition at line 47 of file StdDefs.cpp.

Variable Documentation

◆ gDebugFlag1

◆ gDebugFlag2

◆ gDebugFlag3

◆ gDebugFlag4

◆ gDebugFlag5

◆ gDebugFlag6

bool gDebugFlag6 = false

Definition at line 45 of file StdDefs.cpp.

Referenced by MSLink::blockedByFoe(), and MSLink::computeFoeArrivalTimeBraking().

◆ gHumanReadableTime

◆ gIgnoreUnknownVClass

bool gIgnoreUnknownVClass = false

Definition at line 32 of file StdDefs.cpp.

Referenced by SystemFrame::checkOptions(), and parseVehicleClasses().

◆ gLanguage

std::string gLanguage = "C"

the language for GUI elements and messages

Definition at line 35 of file StdDefs.cpp.

Referenced by SystemFrame::addReportOptions(), main(), GUIMainWindow::onCmdChangeLanguage(), and GUIMainWindow::onUpdChangeLanguage().

◆ gPrecision

int gPrecision = 2

the precision for floating point outputs

Definition at line 26 of file StdDefs.cpp.

Referenced by MSLCM_LC2013::_patchSpeed(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), NBEdge::assignInternalLaneLength(), SystemFrame::checkOptions(), MSVehicle::checkReversal(), MSCFModel::finalizeSpeed(), StringUtils::format(), MSDevice_Emissions::generateOutput(), SUMOVehicleParameter::getDepartPos(), SUMOVehicleParameter::getDepartPosLat(), SUMOVehicleParameter::getDepartSpeed(), MSLane::getLeader(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), MSDevice_SSM::makeStringWithNAs(), MSDevice_SSM::makeStringWithNAs(), libsumo::Helper::moveToXYMap(), NIImporter_OpenDrive::myStartElement(), MapMatcher< E, L, N >::parseGeoEdges(), MSVehicle::planMove(), MSNet::postSimStepOutput(), MSDevice_Tripinfo::printStatistics(), NBEdge::roundGeometry(), NBNode::roundGeometry(), NBEdge::roundSpeed(), ROPerson::PersonTrip::saveAsXML(), ROVehicle::saveAsXML(), MSStateHandler::saveState(), MSTransportable::saveState(), NBEdge::shiftPositionAtNode(), time2string(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSXMLRawOut::write(), MSFCDExport::write(), MSEmissionExport::write(), MSEmissionExport::writeEmissions(), NWWriter_OpenDrive::writeInternalEdge(), NWWriter_OpenDrive::writeNormalEdge(), MSDevice_SSM::writeOutConflict(), NWWriter_OpenDrive::writeRoadObjects(), MSDevice_Tripinfo::writeStatistics(), and MSFCDExport::writeTransportable().

◆ gPrecisionEmissions

◆ gPrecisionGeo

◆ gPrecisionRandom

◆ gSimulation

bool gSimulation = false

◆ GUIDesignDialogButtonsHeight

int GUIDesignDialogButtonsHeight = 32

the default height for dialog buttons

Definition at line 38 of file StdDefs.cpp.

◆ GUIDesignHeight

◆ gWeightsRandomFactor

◆ gWeightsWalkOppositeFactor

double gWeightsWalkOppositeFactor = 1