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-2024 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"
33#include <router/ROFrame.h>
38
39
40// ===========================================================================
41// method definitions
42// ===========================================================================
45 // Options handling
46 oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --rand",
47 "generate a trips file from a stats file on a given net using arbitrary random seed");
48 oc.addCallExample("--net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>",
49 "generate a trips file from a stats file on a given net for numerous days (with fixed random seed)");
50
51 // Add categories and insert the standard options
53 oc.addOptionSubTopic("Input");
54 oc.addOptionSubTopic("Output");
55 oc.addOptionSubTopic("Processing");
56 oc.addOptionSubTopic("Time");
57
58 // Insert options
59 oc.doRegister("net-file", 'n', new Option_FileName());
60 oc.addSynonyme("net-file", "net");
61 oc.addDescription("net-file", "Input", TL("Use FILE as SUMO-network to create trips for"));
62
63 oc.doRegister("stat-file", 's', new Option_FileName());
64 oc.addDescription("stat-file", "Input", TL("Loads the SUMO-statistics FILE"));
65
66 // need to do this here to be able to check for network and route input options
69
70 oc.doRegister("output-file", 'o', new Option_FileName());
71 oc.addSynonyme("output-file", "output", true);
72 oc.addDescription("output-file", "Output", TL("Write generated trips to FILE"));
73
74 oc.doRegister("debug", new Option_Bool(false));
75 oc.addDescription("debug", "Report",
76 "Detailed messages about every single step");
77
78 // TODO: What time options are consistent with other parts of SUMO and
79 // useful for the user?
80 oc.doRegister("begin", 'b', new Option_Integer(0));
81 oc.addDescription("begin", "Time", TL("Sets the time of beginning of the simulation during the first day (in seconds)"));
82
83 oc.doRegister("end", 'e', new Option_Integer(0));
84 oc.addDescription("end", "Time", TL("Sets the time of ending of the simulation during the last day (in seconds)"));
85
86 oc.doRegister("duration-d", new Option_Integer(1));
87 oc.addDescription("duration-d", "Time", TL("Sets the duration of the simulation in days"));
88}
89
90
92 return true;
93}
#define TL(string)
Definition MsgHandler.h:315
static bool checkOptions()
Checks set options from the OptionsCont singleton for being valid for usage within ActivityGen.
Definition AGFrame.cpp:91
static void fillOptions()
Inserts options used by ActivityGen into the OptionsCont singleton.
Definition AGFrame.cpp:43
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.