Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/activitygen/AGFrame.cpp
169665 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
16
/// @file AGFrame.cpp
17
/// @author Walter Bamberger
18
/// @author Daniel Krajzewicz
19
/// @author Jakob Erdmann
20
/// @author Michael Behrisch
21
/// @date Mo, 13 Sept 2010
22
///
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"
32
#include <utils/common/StdDefs.h>
33
#include <router/ROFrame.h>
34
#include <duarouter/RODUAFrame.h>
35
#include <utils/common/SystemFrame.h>
36
#include <utils/common/RandHelper.h>
37
#include <utils/options/OptionsCont.h>
38
39
40
// ===========================================================================
41
// method definitions
42
// ===========================================================================
43
void AGFrame::fillOptions() {
44
OptionsCont& oc = OptionsCont::getOptions();
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
52
SystemFrame::addConfigurationOptions(oc);
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
67
SystemFrame::addReportOptions(oc);
68
RandHelper::insertRandOptions(oc);
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
91
bool AGFrame::checkOptions() {
92
return true;
93
}
94
95