44 oc.
addSynonyme(
"configuration-file",
"configuration");
45 oc.
addDescription(
"configuration-file",
"Configuration",
TL(
"Loads the named config on startup"));
49 oc.
addSynonyme(
"save-config",
"save-configuration");
50 oc.
addDescription(
"save-configuration",
"Configuration",
TL(
"Saves current configuration into FILE"));
53 oc.
addSynonyme(
"save-config.relative",
"save-configuration.relative");
54 oc.
addDescription(
"save-configuration.relative",
"Configuration",
TL(
"Enforce relative paths when saving the configuration"));
57 oc.
addDescription(
"save-template",
"Configuration",
TL(
"Saves a configuration template (empty) into FILE"));
60 oc.
addDescription(
"save-schema",
"Configuration",
TL(
"Saves the configuration schema into FILE"));
63 oc.
addSynonyme(
"save-commented",
"save-template.commented");
64 oc.
addDescription(
"save-commented",
"Configuration",
TL(
"Adds comments to saved template, configuration, or schema"));
76 oc.
addDescription(
"print-options",
"Report",
TL(
"Prints option values before processing"));
79 oc.
addDescription(
"help",
"Report",
TL(
"Prints this screen or selected topics"));
85 oc.
addDescription(
"xml-validation",
"Report",
"Set schema validation scheme of XML inputs (\"never\", \"local\", \"auto\" or \"always\")");
87 if (oc.
exists(
"net-file")) {
89 oc.
addDescription(
"xml-validation.net",
"Report",
"Set schema validation scheme of SUMO network inputs (\"never\", \"local\", \"auto\" or \"always\")");
92 if (oc.
exists(
"route-files")) {
94 oc.
addDescription(
"xml-validation.routes",
"Report",
"Set schema validation scheme of SUMO route inputs (\"never\", \"local\", \"auto\" or \"always\")");
98 oc.
addSynonyme(
"no-warnings",
"suppress-warnings",
true);
99 oc.
addDescription(
"no-warnings",
"Report",
TL(
"Disables output of warnings"));
102 oc.
addDescription(
"aggregate-warnings",
"Report",
TL(
"Aggregate warnings of the same type whenever more than INT occur"));
106 oc.
addDescription(
"log",
"Report",
TL(
"Writes all messages to FILE (implies verbose)"));
109 oc.
addDescription(
"message-log",
"Report",
TL(
"Writes all non-error messages to FILE (implies verbose)"));
112 oc.
addDescription(
"error-log",
"Report",
TL(
"Writes all warnings and errors to FILE"));
115 oc.
addDescription(
"log.timestamps",
"Report",
TL(
"Writes timestamps in front of all messages"));
118 oc.
addDescription(
"log.processid",
"Report",
TL(
"Writes process ID in front of all messages"));
124 oc.
addDescription(
"write-license",
"Output",
TL(
"Include license info into every output file"));
127 oc.
addDescription(
"write-metadata",
"Output",
TL(
"Write parsable metadata (configuration etc.) instead of comments"));
130 oc.
addDescription(
"output-prefix",
"Output",
TL(
"Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time."));
133 oc.
addDescription(
"output-suffix",
"Output",
TL(
"Suffix which is applied to all output files. The special string 'TIME' is replaced by the current time."));
136 oc.
addDescription(
"precision",
"Output",
TL(
"Defines the number of digits after the comma for floating point output"));
139 oc.
addDescription(
"precision.geo",
"Output",
TL(
"Defines the number of digits after the comma for lon,lat output"));
142 oc.
addDescription(
"output.compression",
"Output",
TL(
"Defines the standard compression algorithm (currently only for parquet output)"));
145 oc.
addDescription(
"output.format",
"Output",
TL(
"Defines the standard output format if not derivable from the file name ('xml', 'csv', 'parquet')"));
148 oc.
addDescription(
"output.column-header",
"Output",
TL(
"How to derive column headers from attribute names ('none', 'tag', 'auto', 'plain', 'full')"));
151 oc.
addDescription(
"output.column-separator",
"Output",
TL(
"Separator in CSV output"));
154 oc.
addDescription(
"human-readable-time",
"Output",
TL(
"Write time values as hour:minute:second or day:hour:minute:second rather than seconds"));
161 if (oc.
exists(
"emission-output.precision")) {
166 if (oc.
exists(
"weights.random-factor")) {
169 if (oc.
exists(
"persontrip.walk-opposite-factor")) {
172 if (oc.
exists(
"xml-validation.routes") && oc.
isDefault(
"xml-validation.routes") && !oc.
isDefault(
"xml-validation")) {
189 if (oc.
exists(
"output.column-header")) {
192 if (oc.
exists(
"output.column-separator")) {
197 std::function<void(std::ostream&)> metadataWriter;
198 if (oc.
exists(
"write-metadata") && oc.
getBool(
"write-metadata")) {
199 metadataWriter = [](std::ostream & into) {
203 into <<
" </metadata>\n";
221 if (oc.
getBool(
"no-warnings")) {
225 if (oc.
isSet(
"log",
false)) {
228 if (!oc.
getBool(
"no-warnings")) {
232 if (oc.
getBool(
"log.timestamps")) {
235 if (oc.
getBool(
"log.processid")) {
239 if (oc.
isSet(
"message-log",
false)) {
243 if (oc.
isSet(
"error-log",
false)) {
278 oc.
addDescription(
"random",
"Random Number",
TL(
"Initialises the random number generator with the current system time"));
282 oc.
addDescription(
"seed",
"Random Number",
TL(
"Initialises the random number generator with the given value"));
int gPrecision
the precision for floating point outputs
double gWeightsRandomFactor
double gWeightsWalkOppositeFactor
std::string gLanguage
the language for GUI elements and messages
bool gIgnoreUnknownVClass
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static void setWriteTimestamps(bool enable)
enable/disable timestamps in log output
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
virtual void clear(bool resetInformed=true)
Clears information whether an error occurred previously and print aggregated message summary.
void setAggregationThreshold(const int thresh)
void addInitialMessage(const std::string &msg)
add a message which is repeated at the end if errors occurred
static void setWriteProcessId(bool enable)
enable/disable process id in log output
static void cleanupOnEnd()
Removes pending handler.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const std::string &relativeTo="", const bool forceRelative=false, const bool inComment=false, const std::string &indent="") const
Writes the configuration.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void writeXMLHeader(std::ostream &os, const bool includeConfig=true) const
Writes a standard XML header, including the configuration.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool setDefault(const std::string &name, const std::string &value)
Sets the given value for the named option as new default value.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
const std::string & getFullName() const
get options full name
void clear()
Removes all information from the container.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void addXMLDefault(const std::string &name, const std::string &xmlRoot="")
Adds an XML root element to handle by default. The special root "" denotes the default handler.
static OptionsCont & getOptions()
Retrieves the options.
static const std::chrono::time_point< std::chrono::system_clock > & getLoadTime()
Return the time stamp of the last init.
Static storage of an output device and its base (abstract) implementation.
static Settings mySettings
the output related option values, set by SystemFrame so that this class does not depend on the option...
static void closeAll(bool keepErrorRetrievers=false)
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
static void initRand(SumoRNG *which=nullptr, const bool random=false, const int seed=23423)
Initialises the random number generator with hardware randomness or seed.
static std::string isoTimeString(const std::chrono::time_point< std::chrono::system_clock > *const timeRef=nullptr)
Returns an ISO8601 formatted time string with microsecond precision.
static void close()
Closes all of an applications subsystems.
static bool checkOptions(OptionsCont &oc)
checks shared options and sets StdDefs
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
static void initRandGlobal(SumoRNG *which=nullptr)
Reads the given random number options and initialises the random number generator in accordance.
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
static void insertRandOptions(OptionsCont &oc)
Initialises the given options container with random number options.
static void updateOutputSettings(const OptionsCont &oc)
hands the output related option values and the XML header writers over to the output devices
static void initOutputOptions()
init message output (console and log files) according to the options
static void close()
Closes the xml-subsystem.
values of the output related options, handed over by SystemFrame so that this class does not depend o...
std::string suffix
the suffix to append to all output file names
std::string prefix
the prefix to prepend to all output file names
std::string columnHeader
how to derive column headers (CSV and Parquet)
std::string columnSeparator
the separator for CSV output
std::string compression
the compression algorithm for Parquet output
std::chrono::time_point< std::chrono::system_clock > loadTime
the time the configuration was loaded, used to replace TIME in prefix, suffix and file names
std::string format
the default output format ("xml", "csv" or "parquet")