Skip to content

Command line Arguments

Fred Rothganger edited this page Dec 8, 2023 · 10 revisions

The app normally starts up a graphical user interface (GUI) that supports editing and running models. In some circumstances, you may want to use the app as a command-line utility without starting up the GUI. Once the utility work is completed, the app exits. If you specify more than one utility function, only the last one will be executed. The utility functions are indicated in bold below. Other options modify the app behavior when running either the GUI or a utility function.

  • -csv -- For -run, converts output into standard comma-sparated-value (CSV) format. For -study, outputs list of completed jobs in CSV format.
  • -export -- Writes a specified model to disk. You can also specify format and destination file.
  • -format={name} -- Specifies the file format for export or import. In the case of export, if this argument is not given but the file is specified, then the format is derived from the file suffix. If neither are given, the app will default to its own internal format. In the case of import, this parameter can override the automatic format detection.
    The following is a list of formats currently built into the app. Format names are long-form strings, including space characters. Case is ignored.
    • BibTeX
    • C binary
    • C library shared
    • C library static
    • EndNote
    • N2A Native
    • NeuroML
    • PubMed
    • RIS bibliography
    • Vensim
  • -file={path} -- Specifies the file for import or export. In the case of export, if this argument is not given, the destination is the current working directory with a name built from the model name and the format's usual file suffix.
  • -import -- Reads in the specified file and adds it to the primary repository. The format is determined automatically from the file contents and file name suffix.
  • -install -- Unpacks the C and Python backend code into ~n2a/backend. This includes utility classes that you can use in other software projects, particularly for accessing model and output files.
  • -model={name} -- Specifies the model to run, study, import or export. In the case of import, if not specified, then the model name is derived from the file name.
  • -param={path} -- Read either a model file or a Dakota configuration file. The model file is used to set up a run with overridden model elements. The Dakota file is used to set up a study.
  • -plugin={name} -- Specifies a plugin class for explicit loading. Use a separate -plugin argument for each class. Note that any jar files in ~n2a/plugins will be loaded automatically using Java SPI, so they do not need to be listed.
  • -pluginDir={path} -- Adds a directory to the plugin search path. Use a separate -pluginDir argument for each directory.
  • -run -- Runs a simulation in headless mode. The given model must exist in the current repository structure. Treats the current working directory as the job directory.
  • -study -- Runs multiple simulations as part of a systematic study as specified by $meta.study tags contained in the model.
  • {keypath}={value} -- Any command-line argument that does not start with a dash is treated as a model override. This is used in conjunction with -run. The keypath is a dot-seperated list of names that specify the exact model element. The element gets set to value. This can be used to change an equation or some parameter. It can also be used to set the host or backend on which the model runs:
    • $meta.backend=my-favorite-backend
    • $meta.host=server123