.. index:: pair: struct; SimulationParams .. _doxid-struct_simulation_params: struct SimulationParams ======================= .. toctree:: :hidden: Overview ~~~~~~~~ NRP Simulation Startup Parameters. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct SimulationParams { // typedefs typedef bool :target:`ParamHelpT`; typedef std::string :target:`ParamSimCfgFileT`; typedef std::vector :target:`ParamPluginsT`; typedef std::string :target:`ParamExpDirT`; typedef std::string :target:`ParamConsoleLogLevelT`; typedef std::string :target:`ParamFileLogLevelT`; typedef std::string :target:`ParamLogOutputT`; typedef std::string :target:`ParamFilenameT`; typedef std::string :target:`ParamLogDirT`; typedef bool :target:`ParamLogConfigT`; typedef std::string :target:`ParamModeT`; typedef std::vector :target:`ParamSimParamT`; typedef std::string :target:`ParamServerAddressT`; typedef bool :target:`ParamSlaveT`; // fields static constexpr std::string_view :target:`NRPProgramName` = "NRPCoreSim"; static constexpr std::string_view :target:`ProgramDescription` = "Brain and physics simulator"; static constexpr std::string_view :target:`ParamHelp` = "h"; static constexpr std::string_view :target:`ParamHelpLong` = "h,help"; static constexpr std::string_view :target:`ParamHelpDesc` = "Print this message"; static constexpr std::string_view :target:`ParamSimCfgFile` = "c"; static constexpr std::string_view :target:`ParamSimCfgFileLong` = "c,config"; static constexpr std::string_view :target:`ParamSimCfgFileDesc` = "Simulation config file"; static constexpr std::string_view :target:`ParamPlugins` = "p"; static constexpr std::string_view :target:`ParamPluginsLong` = "p,plugins"; static constexpr std::string_view :target:`ParamPluginsDesc` = "Engine plugins to load. If omitted, all engines compiled with nrp-core are loaded"; static constexpr std::string_view :target:`ParamExpDir` = "d"; static constexpr std::string_view :target:`ParamExpDirLong` = "d,dir"; static constexpr std::string_view :target:`ParamExpDirDesc` = "The explicit location of the experiment folder"; static constexpr std::string_view :target:`ParamConsoleLogLevelLong` = "cloglevel"; static constexpr std::string_view :target:`ParamConsoleLogLevelDesc` = "Console minimum level of log severity"; static constexpr std::string_view :target:`ParamFileLogLevelLong` = "floglevel"; static constexpr std::string_view :target:`ParamFileLogLevelDesc` = "File minimum level of log severity"; static constexpr std::string_view :target:`ParamLogOutputLong` = "logoutput"; static constexpr std::string_view :target:`ParamLogOutputDesc` = "Option for logging stdout and stderr in the experiment: engines, all, silent"; static constexpr std::string_view :target:`ParamLogFilenameLong` = "logfilename"; static constexpr std::string_view :target:`ParamLogFilenameDesc` = "If 'logoutput' option is 'engines' or 'all', name of the log file"; static constexpr std::string_view :target:`ParamLogDirLong` = "logdir"; static constexpr std::string_view :target:`ParamLogDirDesc` = "Directory for the file logs"; static constexpr std::string_view :target:`ParamLogConfig` = "l"; static constexpr std::string_view :target:`ParamLogConfigLong` = "l,logconfig"; static constexpr std::string_view :target:`ParamLogConfigDesc` = "Print the simulation config in :ref:`use` to DEBUG log"; static constexpr std::string_view :target:`ParamMode` = "m"; static constexpr std::string_view :target:`ParamModeLong` = "m,mode"; static constexpr std::string_view :target:`ParamModeDesc` = "Operational mode, standalone or server"; static constexpr std::string_view :target:`ParamSimParam` = "o"; static constexpr std::string_view :target:`ParamSimParamLong` = "o,param"; static constexpr std::string_view :target:`ParamSimParamDesc` = "Simulation config parameter, specified as param=value, overriding configuration file parameters"; static constexpr std::string_view :target:`ParamServerAddressLong` = "server_address"; static constexpr std::string_view :target:`ParamServerAddressDesc` = "Desired address of the server in server operational mode"; static constexpr std::string_view :target:`ParamSlaveLong` = "slave"; static constexpr std::string_view :target:`ParamSlaveDesc` = "If present NRPCoreSim runs in slave mode. For internal use."; // methods static cxxopts::Options :ref:`createStartParamParser`(); static :ref:`jsonSharedPtr` :ref:`setWorkingDirectoryAndGetConfigFile`(const cxxopts::ParseResult& args); static void :ref:`parseAndSetCLISimParams`( const :ref:`ParamSimParamT`& parseResults, :ref:`nlohmann::json`& simulationConfig ); static :ref:`NRPLogger::level_t` :ref:`parseLogLevel`(const std::string& logLevel); }; .. _details-struct_simulation_params: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ NRP Simulation Startup Parameters. Methods ------- .. index:: pair: function; createStartParamParser .. _doxid-struct_simulation_params_1aa6c9b4b4d53513b7250dc1b4b466b4b8: .. ref-code-block:: cpp :class: doxyrest-title-code-block static cxxopts::Options createStartParamParser() Create a parser for start parameters. .. rubric:: Returns: Returns parser .. index:: pair: function; setWorkingDirectoryAndGetConfigFile .. _doxid-struct_simulation_params_1af868a0348976b0a9c162a1d72e7d7732: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`jsonSharedPtr` setWorkingDirectoryAndGetConfigFile(const cxxopts::ParseResult& args) Get the simulation configuration from start parameters as a JSON object. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - args - Parsed start parameters .. rubric:: Returns: Returns instance of simulation config .. index:: pair: function; parseAndSetCLISimParams .. _doxid-struct_simulation_params_1a4e9c2810426ad98a480647b97851cb85: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void parseAndSetCLISimParams( const :ref:`ParamSimParamT`& parseResults, :ref:`nlohmann::json`& simulationConfig ) Parse cmd line simulation parameters. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - parseResults - * - simulationConfig - .. index:: pair: function; parseLogLevel .. _doxid-struct_simulation_params_1a8c90775f6cc1f12bee42135e262c30e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`NRPLogger::level_t` parseLogLevel(const std::string& logLevel) parsing input parameter string log level into enum type .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - logLevel - The string expression of the log level