115 netBuilder->applyOptions(oc);
119 net =
new GNENet(netBuilder);
128 netBuilder->compute(oc);
135 if (oc.
getBool(
"ignore-errors")) {
143 net =
new GNENet(netBuilder);
150 if (oc.
isSet(
"configuration-file")) {
152 }
else if (oc.
isSet(
"sumo-net-file")) {
158 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
165 }
catch (std::exception& e) {
202 oc.
addCallExample(
"-c <CONFIGURATION>",
"edit net with options read from file");
228 oc.
addDescription(
"additional-files",
"Netedit",
"Load additional and shapes descriptions from FILE(s)");
231 oc.
addDescription(
"additionals-output",
"Netedit",
"file in which additionals must be saved");
235 oc.
addDescription(
"route-files",
"Netedit",
"Load demand elements descriptions from FILE(s)");
238 oc.
addDescription(
"demandelements-output",
"Netedit",
"file in which demand elements must be saved");
241 oc.
addDescription(
"TLSPrograms-output",
"Netedit",
"file in which TLS Programs must be saved");
244 oc.
addDescription(
"disable-laneIcons",
"Visualisation",
"Disable icons of special lanes");
250 oc.
addDescription(
"gui-settings-file",
"Visualisation",
"Load visualisation settings from FILE");
253 oc.
addDescription(
"registry-viewport",
"Visualisation",
"Load current viewport from registry");
256 oc.
addDescription(
"window-size",
"Visualisation",
"Create initial window with the given x,y size");
259 oc.
addDescription(
"window-pos",
"Visualisation",
"Create initial window at the given x,y position");
262 oc.
addDescription(
"gui-testing",
"Visualisation",
"Enable overlay for screen recognition");
265 oc.
addDescription(
"gui-testing-debug",
"Visualisation",
"Enable output messages during GUI-Testing");
268 oc.
addDescription(
"gui-testing-debug-gl",
"Visualisation",
"Enable output messages during GUI-Testing specific of gl functions");
272 oc.
addDescription(
"begin",
"Time",
"Defines the begin time in seconds; The simulation starts at this time");
275 oc.
addDescription(
"end",
"Time",
"Defines the end time in seconds; The simulation ends at this time");
278 oc.
addDescription(
"default.action-step-length",
"Processing",
"Length of the default interval length between action points for the car-following and lane-change models (in seconds). If not specified, the simulation step-length is used per default. Vehicle- or VType-specific settings override the default. Must be a multiple of the simulation step-length.");
292 oc.
set(
"offset.disable-normalization",
"true");
293 oc.
set(
"no-turnarounds",
"true");
318 if (!oc.
isSet(
"output-file")) {
323 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
336 if (
myFile !=
"" && !useStartupOptions) {
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
The message is only something to show.
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
FXEX::FXThreadEvent & myEventThrow
event throw
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static void insertRandOptions()
Initialises the given options container with random number options.
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
OutputDevice * myWarningRetriever
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
void resetWritable()
Resets all options to be writeable.
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
static MsgHandler * getGLDebugInstance()
Returns the instance to add GLdebug to.
OutputDevice * myGLDebugRetriever
static void fillOptions(bool forNetedit=false)
Inserts options used by the network importer and network building modules.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
static void computeFinal(bool lefthand=false)
compute the location attributes which will be used for output based on the loaded location data...
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
bool initOptions()
init options
FXSynchQue< GUIEvent * > & myEventQue
event Queue
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
A NBNetBuilder extended by visualisation and editing capabilities.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, FXSynchQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static OptionsCont & getOptions()
Retrieves the options.
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
OutputDevice * myDebugRetriever
bool myNewNet
if true, a new net is created
bool myLoadNet
Information whether only the network shall be loaded.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void clear()
Removes all information from the container.
static MsgHandler * getDebugInstance()
Returns the instance to add debug to.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
void load(OptionsCont &oc)
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static bool checkOptions()
checks shared options and sets StdDefs
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
static void addProjectionOptions(OptionsCont &oc)
Adds projection options to the given container.
FXint run()
starts the thread. The thread ends after the net has been loaded
The message is a warning.
Encapsulates an object's method for using it as a message retriever.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
Instance responsible for building networks.
OutputDevice * myMessageRetriever
A storage for options typed value containers)
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance...
std::string myFile
the path to load the network from
void computeAndUpdate(OptionsCont &oc, bool volatileOptions)
recompute the network and update lane geometries
static void fillOptions(bool forNetgen)
Inserts options used by the network converter.
static void enableDebugGLMessages(bool enable)
enable/disable gl-debug messages
static void enableDebugMessages(bool enable)
enable/disable debug messages
void submitEndAndCleanup(GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static void fillOptions(bool forNetgen)
Inserts options used by the network writer.
virtual void clear()
Clears information whether an error occurred previously.
#define WRITE_MESSAGE(msg)
static void initOutputOptions()
init output options
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
virtual ~GNELoadThread()
destructor