 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
64 oc.
addCallExample(
"-c <CONFIGURATION>",
"run with configuration file");
81 oc.
addDescription(
"taz-files",
"Input",
"Loads TAZ (districts; also from networks) from FILE(s)");
86 oc.
addDescription(
"od-matrix-files",
"Input",
"Loads O/D-files from FILE(s)");
89 oc.
addSynonyme(
"od-amitran-files",
"amitran-files");
91 oc.
addDescription(
"od-amitran-files",
"Input",
"Loads O/D-matrix in Amitran format from FILE(s)");
97 oc.
addDescription(
"output-file",
"Output",
"Writes trip definitions into FILE");
100 oc.
addDescription(
"flow-output",
"Output",
"Writes flow definitions into FILE");
103 oc.
addDescription(
"flow-output.probability",
"Output",
"Writes probabilistic flow instead of evenly spaced flow");
106 oc.
addDescription(
"pedestrians",
"Output",
"Writes pedestrians instead of vehicles");
109 oc.
addDescription(
"persontrips",
"Output",
"Writes persontrips instead of vehicles");
112 oc.
addSynonyme(
"ignore-vehicle-type",
"no-vtype",
true);
113 oc.
addDescription(
"ignore-vehicle-type",
"Output",
"Does not save vtype information");
118 oc.
addDescription(
"begin",
"Time",
"Defines the begin time; Previous trips will be discarded");
121 oc.
addDescription(
"end",
"Time",
"Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent");
126 oc.
addDescription(
"scale",
"Processing",
"Scales the loaded flows by FLOAT");
129 oc.
addDescription(
"spread.uniform",
"Processing",
"Spreads trips uniformly over each time period");
132 oc.
addDescription(
"different-source-sink",
"Processing",
"Always choose source and sink edge which are not identical");
135 oc.
addDescription(
"vtype",
"Processing",
"Defines the name of the vehicle type to use");
138 oc.
addDescription(
"prefix",
"Processing",
"Defines the prefix for vehicle names");
141 oc.
addDescription(
"timeline",
"Processing",
"Uses STR[] as a timeline definition");
144 oc.
addDescription(
"timeline.day-in-hours",
"Processing",
"Uses STR as a 24h-timeline definition");
147 oc.
addSynonyme(
"ignore-errors",
"dismiss-loading-errors",
true);
148 oc.
addDescription(
"ignore-errors",
"Report",
"Continue on broken input");
151 oc.
addDescription(
"no-step-log",
"Processing",
"Disable console output of current time step");
156 oc.
addDescription(
"departlane",
"Defaults",
"Assigns a default depart lane");
159 oc.
addDescription(
"departpos",
"Defaults",
"Assigns a default depart position");
162 oc.
addDescription(
"departspeed",
"Defaults",
"Assigns a default depart speed");
165 oc.
addDescription(
"arrivallane",
"Defaults",
"Assigns a default arrival lane");
168 oc.
addDescription(
"arrivalpos",
"Defaults",
"Assigns a default arrival position");
171 oc.
addDescription(
"arrivalspeed",
"Defaults",
"Assigns a default arrival speed");
181 if (!oc.
isSet(
"taz-files")) {
185 if (!oc.
isSet(
"od-matrix-files") && !oc.
isSet(
"od-amitran-files")) {
189 if (!oc.
isSet(
"output-file") && !oc.
isSet(
"flow-output")) {
190 WRITE_ERROR(
"No trip table output file (-o) or flow-output is specified.");
194 WRITE_ERROR(
"Only one of the the options 'pedestrians' and 'persontrips' may be set.");
259 if (!oc.
isSet(
"taz-files")) {
260 throw ProcessError(
"You must supply a TAZ, network or districts file ('-n').");
265 if (districts.
size() == 0) {
279 if (oc.
isSet(
"timeline")) {
283 bool haveOutput =
false;
287 oc.
getBool(
"spread.uniform"), oc.
getBool(
"different-source-sink"),
288 oc.
getBool(
"ignore-vehicle-type"),
308 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
314 }
catch (
const std::exception& e) {
315 if (std::string(e.what()) != std::string(
"")) {
327 std::cout <<
"Success." << std::endl;
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static bool createDeviceByOption(const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="")
Creates the device using the output definition stored in the named option.
Distribution_Points parseTimeLine(const std::vector< std::string > &def, bool timelineDayInHours)
split the given timeline
bool processMetaOptions(bool missingOptions)
Checks for help and configuration output, returns whether we should exit.
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
void write(SUMOTime begin, const SUMOTime end, OutputDevice &dev, const bool uniform, const bool differSourceSink, const bool noVtype, const std::string &prefix, const bool stepLog, bool pedestrians, bool persontrips)
Writes the vehicles stored in the matrix assigning the sources and sinks.
static void close()
Closes all of an applications subsystems.
static void initOutputOptions()
init output options
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
int main(int argc, char **argv)
double departSpeed
(optional) The initial speed of the vehicle
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
Structure representing possible vehicle parameter.
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
void loadMatrix(OptionsCont &oc)
read a matrix in one of several formats
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
void loadDistricts(std::vector< std::string > files)
load districts from files
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
int size() const
Returns the number of stored items within the container.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
void setApplicationName(const std::string &appName, const std::string &fullName)
Sets the application name.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
double arrivalPos
(optional) The position the vehicle shall arrive on
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
static void init()
Initialises the xml-subsystem.
A storage for options typed value containers)
SUMOTime string2time(const std::string &r)
An O/D (origin/destination) matrix.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance.
A container for districts.
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
void setApplicationDescription(const std::string &appDesc)
Sets the application description.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
double getNumLoaded() const
Returns the number of loaded vehicles.
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
double getNumWritten() const
Returns the number of written vehicles.
#define SUMOTIME_MAXSTRING
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
double getNumDiscarded() const
Returns the number of discarded vehicles.
void writeFlows(const SUMOTime begin, const SUMOTime end, OutputDevice &dev, const bool noVtype, const std::string &prefix, bool asProbability=false, bool pedestrians=false, bool persontrips=false)
Writes the flows stored in the matrix.
static void insertRandOptions()
Initialises the given options container with random number options.
static bool checkOptions()
checks shared options and sets StdDefs
void applyCurve(const Distribution_Points &ps)
Splits the stored cells dividing them on the given time line.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
#define WRITE_MESSAGE(msg)
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)