NRP Core  1.4.1
SimulationParams Struct Reference

NRP Simulation Startup Parameters. More...

#include <simulation_parameters.h>

Public Types

using ParamHelpT = bool
 
using ParamSimCfgFileT = std::string
 
using ParamPluginsT = std::vector< std::string >
 
using ParamExpDirT = std::string
 
using ParamConsoleLogLevelT = std::string
 
using ParamFileLogLevelT = std::string
 
using ParamLogOutputT = std::string
 
using ParamFilenameT = std::string
 
using ParamLogDirT = std::string
 
using ParamLogConfigT = bool
 
using ParamModeT = std::string
 
using ParamSimParamT = std::vector< std::string >
 
using ParamServerAddressT = std::string
 
using ParamSlaveT = bool
 

Static Public Member Functions

static cxxopts::Options createStartParamParser ()
 Create a parser for start parameters. More...
 
static jsonSharedPtr setWorkingDirectoryAndGetConfigFile (const cxxopts::ParseResult &args)
 Get the simulation configuration from start parameters as a JSON object. More...
 
static void parseAndSetCLISimParams (const ParamSimParamT &parseResults, nlohmann::json &simulationConfig)
 Parse cmd line simulation parameters. More...
 
static NRPLogger::level_t parseLogLevel (const std::string &logLevel)
 parsing input parameter string log level into enum type More...
 

Static Public Attributes

static constexpr std::string_view NRPProgramName = "NRPCoreSim"
 
static constexpr std::string_view ProgramDescription = "Brain and physics simulator"
 
static constexpr std::string_view ParamHelp = "h"
 
static constexpr std::string_view ParamHelpLong = "h,help"
 
static constexpr std::string_view ParamHelpDesc = "Print this message"
 
static constexpr std::string_view ParamSimCfgFile = "c"
 
static constexpr std::string_view ParamSimCfgFileLong = "c,config"
 
static constexpr std::string_view ParamSimCfgFileDesc = "Simulation config file"
 
static constexpr std::string_view ParamPlugins = "p"
 
static constexpr std::string_view ParamPluginsLong = "p,plugins"
 
static constexpr std::string_view ParamPluginsDesc = "Engine plugins to load. If omitted, all engines compiled with nrp-core are loaded"
 
static constexpr std::string_view ParamExpDir = "d"
 
static constexpr std::string_view ParamExpDirLong = "d,dir"
 
static constexpr std::string_view ParamExpDirDesc = "The explicit location of the experiment folder"
 
static constexpr std::string_view ParamConsoleLogLevelLong = "cloglevel"
 
static constexpr std::string_view ParamConsoleLogLevelDesc = "Console minimum level of log severity"
 
static constexpr std::string_view ParamFileLogLevelLong = "floglevel"
 
static constexpr std::string_view ParamFileLogLevelDesc = "File minimum level of log severity"
 
static constexpr std::string_view ParamLogOutputLong = "logoutput"
 
static constexpr std::string_view ParamLogOutputDesc = "Option for logging stdout and stderr in the experiment: engines, all, silent"
 
static constexpr std::string_view ParamLogFilenameLong = "logfilename"
 
static constexpr std::string_view ParamLogFilenameDesc = "If 'logoutput' option is 'engines' or 'all', name of the log file"
 
static constexpr std::string_view ParamLogDirLong = "logdir"
 
static constexpr std::string_view ParamLogDirDesc = "Directory for the file logs"
 
static constexpr std::string_view ParamLogConfig = "l"
 
static constexpr std::string_view ParamLogConfigLong = "l,logconfig"
 
static constexpr std::string_view ParamLogConfigDesc = "Print the simulation config in use to DEBUG log"
 
static constexpr std::string_view ParamMode = "m"
 
static constexpr std::string_view ParamModeLong = "m,mode"
 
static constexpr std::string_view ParamModeDesc = "Operational mode, standalone or server"
 
static constexpr std::string_view ParamSimParam = "o"
 
static constexpr std::string_view ParamSimParamLong = "o,param"
 
static constexpr std::string_view ParamSimParamDesc = "Simulation config parameter, specified as param=value, overriding configuration file parameters"
 
static constexpr std::string_view ParamServerAddressLong = "server_address"
 
static constexpr std::string_view ParamServerAddressDesc = "Desired address of the server in server operational mode"
 
static constexpr std::string_view ParamSlaveLong = "slave"
 
static constexpr std::string_view ParamSlaveDesc = "If present NRPCoreSim runs in slave mode. For internal use."
 

Detailed Description

NRP Simulation Startup Parameters.

Member Typedef Documentation

◆ ParamConsoleLogLevelT

◆ ParamExpDirT

using SimulationParams::ParamExpDirT = std::string

◆ ParamFileLogLevelT

◆ ParamFilenameT

using SimulationParams::ParamFilenameT = std::string

◆ ParamHelpT

◆ ParamLogConfigT

◆ ParamLogDirT

using SimulationParams::ParamLogDirT = std::string

◆ ParamLogOutputT

using SimulationParams::ParamLogOutputT = std::string

◆ ParamModeT

using SimulationParams::ParamModeT = std::string

◆ ParamPluginsT

using SimulationParams::ParamPluginsT = std::vector<std::string>

◆ ParamServerAddressT

◆ ParamSimCfgFileT

◆ ParamSimParamT

using SimulationParams::ParamSimParamT = std::vector<std::string>

◆ ParamSlaveT

Member Function Documentation

◆ createStartParamParser()

cxxopts::Options SimulationParams::createStartParamParser ( )
static

Create a parser for start parameters.

Returns
Returns parser

◆ parseAndSetCLISimParams()

void SimulationParams::parseAndSetCLISimParams ( const ParamSimParamT parseResults,
nlohmann::json simulationConfig 
)
static

Parse cmd line simulation parameters.

Parameters
parseResults
simulationConfig

◆ parseLogLevel()

NRPLogger::level_t SimulationParams::parseLogLevel ( const std::string &  logLevel)
static

parsing input parameter string log level into enum type

Parameters
logLevelThe string expression of the log level

◆ setWorkingDirectoryAndGetConfigFile()

jsonSharedPtr SimulationParams::setWorkingDirectoryAndGetConfigFile ( const cxxopts::ParseResult &  args)
static

Get the simulation configuration from start parameters as a JSON object.

Parameters
argsParsed start parameters
Returns
Returns instance of simulation config

Member Data Documentation

◆ NRPProgramName

constexpr std::string_view SimulationParams::NRPProgramName = "NRPCoreSim"
staticconstexpr

◆ ParamConsoleLogLevelDesc

constexpr std::string_view SimulationParams::ParamConsoleLogLevelDesc = "Console minimum level of log severity"
staticconstexpr

◆ ParamConsoleLogLevelLong

constexpr std::string_view SimulationParams::ParamConsoleLogLevelLong = "cloglevel"
staticconstexpr

◆ ParamExpDir

constexpr std::string_view SimulationParams::ParamExpDir = "d"
staticconstexpr

◆ ParamExpDirDesc

constexpr std::string_view SimulationParams::ParamExpDirDesc = "The explicit location of the experiment folder"
staticconstexpr

◆ ParamExpDirLong

constexpr std::string_view SimulationParams::ParamExpDirLong = "d,dir"
staticconstexpr

◆ ParamFileLogLevelDesc

constexpr std::string_view SimulationParams::ParamFileLogLevelDesc = "File minimum level of log severity"
staticconstexpr

◆ ParamFileLogLevelLong

constexpr std::string_view SimulationParams::ParamFileLogLevelLong = "floglevel"
staticconstexpr

◆ ParamHelp

constexpr std::string_view SimulationParams::ParamHelp = "h"
staticconstexpr

◆ ParamHelpDesc

constexpr std::string_view SimulationParams::ParamHelpDesc = "Print this message"
staticconstexpr

◆ ParamHelpLong

constexpr std::string_view SimulationParams::ParamHelpLong = "h,help"
staticconstexpr

◆ ParamLogConfig

constexpr std::string_view SimulationParams::ParamLogConfig = "l"
staticconstexpr

◆ ParamLogConfigDesc

constexpr std::string_view SimulationParams::ParamLogConfigDesc = "Print the simulation config in use to DEBUG log"
staticconstexpr

◆ ParamLogConfigLong

constexpr std::string_view SimulationParams::ParamLogConfigLong = "l,logconfig"
staticconstexpr

◆ ParamLogDirDesc

constexpr std::string_view SimulationParams::ParamLogDirDesc = "Directory for the file logs"
staticconstexpr

◆ ParamLogDirLong

constexpr std::string_view SimulationParams::ParamLogDirLong = "logdir"
staticconstexpr

◆ ParamLogFilenameDesc

constexpr std::string_view SimulationParams::ParamLogFilenameDesc = "If 'logoutput' option is 'engines' or 'all', name of the log file"
staticconstexpr

◆ ParamLogFilenameLong

constexpr std::string_view SimulationParams::ParamLogFilenameLong = "logfilename"
staticconstexpr

◆ ParamLogOutputDesc

constexpr std::string_view SimulationParams::ParamLogOutputDesc = "Option for logging stdout and stderr in the experiment: engines, all, silent"
staticconstexpr

◆ ParamLogOutputLong

constexpr std::string_view SimulationParams::ParamLogOutputLong = "logoutput"
staticconstexpr

◆ ParamMode

constexpr std::string_view SimulationParams::ParamMode = "m"
staticconstexpr

◆ ParamModeDesc

constexpr std::string_view SimulationParams::ParamModeDesc = "Operational mode, standalone or server"
staticconstexpr

◆ ParamModeLong

constexpr std::string_view SimulationParams::ParamModeLong = "m,mode"
staticconstexpr

◆ ParamPlugins

constexpr std::string_view SimulationParams::ParamPlugins = "p"
staticconstexpr

◆ ParamPluginsDesc

constexpr std::string_view SimulationParams::ParamPluginsDesc = "Engine plugins to load. If omitted, all engines compiled with nrp-core are loaded"
staticconstexpr

◆ ParamPluginsLong

constexpr std::string_view SimulationParams::ParamPluginsLong = "p,plugins"
staticconstexpr

◆ ParamServerAddressDesc

constexpr std::string_view SimulationParams::ParamServerAddressDesc = "Desired address of the server in server operational mode"
staticconstexpr

◆ ParamServerAddressLong

constexpr std::string_view SimulationParams::ParamServerAddressLong = "server_address"
staticconstexpr

◆ ParamSimCfgFile

constexpr std::string_view SimulationParams::ParamSimCfgFile = "c"
staticconstexpr

◆ ParamSimCfgFileDesc

constexpr std::string_view SimulationParams::ParamSimCfgFileDesc = "Simulation config file"
staticconstexpr

◆ ParamSimCfgFileLong

constexpr std::string_view SimulationParams::ParamSimCfgFileLong = "c,config"
staticconstexpr

◆ ParamSimParam

constexpr std::string_view SimulationParams::ParamSimParam = "o"
staticconstexpr

◆ ParamSimParamDesc

constexpr std::string_view SimulationParams::ParamSimParamDesc = "Simulation config parameter, specified as param=value, overriding configuration file parameters"
staticconstexpr

◆ ParamSimParamLong

constexpr std::string_view SimulationParams::ParamSimParamLong = "o,param"
staticconstexpr

◆ ParamSlaveDesc

constexpr std::string_view SimulationParams::ParamSlaveDesc = "If present NRPCoreSim runs in slave mode. For internal use."
staticconstexpr

◆ ParamSlaveLong

constexpr std::string_view SimulationParams::ParamSlaveLong = "slave"
staticconstexpr

◆ ProgramDescription

constexpr std::string_view SimulationParams::ProgramDescription = "Brain and physics simulator"
staticconstexpr

The documentation for this struct was generated from the following files: