Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// activitygen module
5// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6// This program and the accompanying materials are made available under the
7// terms of the Eclipse Public License 2.0 which is available at
8// https://www.eclipse.org/legal/epl-2.0/
9// This Source Code may also be made available under the following Secondary
10// Licenses when the conditions for such availability set forth in the Eclipse
11// Public License 2.0 are satisfied: GNU General Public License, version 2
12// or later which is available at
13// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15/****************************************************************************/
23// Configuration of the options of ActivityGen
24/****************************************************************************/
25#include <config.h>
26
27#ifdef HAVE_VERSION_H
28#include <version.h>
29#endif
30
31#include "AGFrame.h"
34#include <router/ROFrame.h>
39
40
41// ===========================================================================
42// method definitions
43// ===========================================================================
46 // Options handling
47 oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --rand",
48 TL("generate a trips file from a stats file on a given net using arbitrary random seed"));
49 oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>",
50 TL("generate a trips file from a stats file on a given net for numerous days (with fixed random seed)"));
51
52 // Add categories and insert the standard options
54 oc.addOptionSubTopic("Input");
55 oc.addOptionSubTopic("Output");
56 oc.addOptionSubTopic("Processing");
57 oc.addOptionSubTopic("Time");
58
59 // Insert options
60 oc.doRegister("net-file", 'n', new Option_FileName());
61 oc.addSynonyme("net-file", "net");
62 oc.addDescription("net-file", "Input", TL("Use FILE as SUMO-network to create trips for"));
63
64 oc.doRegister("stat-file", 's', new Option_FileName());
65 oc.addDescription("stat-file", "Input", TL("Loads the SUMO-statistics FILE"));
66
67 // need to do this here to be able to check for network and route input options
70
71 oc.doRegister("output-file", 'o', new Option_FileName());
72 oc.addSynonyme("output-file", "output", true);
73 oc.addDescription("output-file", "Output", TL("Write generated trips to FILE"));
74
75 oc.doRegister("debug", new Option_Bool(false));
76 oc.addDescription("debug", "Report",
77 "Detailed messages about every single step");
78
79 // TODO: What time options are consistent with other parts of SUMO and
80 // useful for the user?
81 oc.doRegister("begin", 'b', new Option_Integer(0));
82 oc.addDescription("begin", "Time", TL("Sets the time of beginning of the simulation during the first day (in seconds)"));
83
84 oc.doRegister("end", 'e', new Option_Integer(0));
85 oc.addDescription("end", "Time", TL("Sets the time of ending of the simulation during the last day (in seconds)"));
86
87 oc.doRegister("duration-d", new Option_Integer(1));
88 oc.addDescription("duration-d", "Time", TL("Sets the duration of the simulation in days"));
89}
90
91
93 return true;
94}
#define TL(string)
Definition MsgHandler.h:304
static bool checkOptions()
Checks set options from the OptionsCont singleton for being valid for usage within ActivityGen.
Definition AGFrame.cpp:92
static void fillOptions()
Inserts options used by ActivityGen into the OptionsCont singleton.
Definition AGFrame.cpp:44
A storage for options typed value containers)
Definition OptionsCont.h:89
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static OptionsCont & getOptions()
Retrieves the options.
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
static void insertRandOptions(OptionsCont &oc)
Initialises the given options container with random number options.
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.