Classes | Public Types | Public Member Functions | Static Public Member Functions
bbp::sonata::SimulationConfig Class Reference

#include <config.h>

Classes

struct  Conditions
 
struct  ConnectionOverride
 
struct  InputAbsoluteShotNoise
 
struct  InputBase
 
struct  InputHyperpolarizing
 
struct  InputLinear
 
struct  InputNoise
 
struct  InputOrnsteinUhlenbeck
 
struct  InputPulse
 
struct  InputRelativeLinear
 
struct  InputRelativeOrnsteinUhlenbeck
 
struct  InputRelativeShotNoise
 
struct  InputSeclamp
 
struct  InputShotNoise
 
struct  InputSinusoidal
 
struct  InputSubthreshold
 
struct  InputSynapseReplay
 
struct  ModificationBase
 
struct  ModificationConfigureAllSections
 
struct  ModificationTTX
 
struct  Output
 
struct  Report
 
struct  Run
 

Public Types

enum  SimulatorType { invalid = -1, NEURON, CORENEURON }
 
using Modification = nonstd::variant< ModificationTTX, ModificationConfigureAllSections >
 
using ReportMap = std::unordered_map< std::string, Report >
 
using Input = nonstd::variant< InputLinear, InputRelativeLinear, InputPulse, InputSinusoidal, InputSubthreshold, InputHyperpolarizing, InputSynapseReplay, InputSeclamp, InputNoise, InputShotNoise, InputRelativeShotNoise, InputAbsoluteShotNoise, InputOrnsteinUhlenbeck, InputRelativeOrnsteinUhlenbeck >
 
using InputMap = std::unordered_map< std::string, Input >
 

Public Member Functions

 SimulationConfig (const std::string &content, const std::string &basePath)
 
const std::string & getBasePath () const noexcept
 
const std::string & getJSON () const noexcept
 
const std::string & getNetwork () const noexcept
 
const RungetRun () const noexcept
 
const OutputgetOutput () const noexcept
 
const ConditionsgetConditions () const noexcept
 
std::set< std::string > listReportNames () const
 
const ReportgetReport (const std::string &name) const
 
std::set< std::string > listInputNames () const
 
const InputgetInput (const std::string &name) const
 
const std::vector< ConnectionOverride > & getConnectionOverrides () const noexcept
 
const SimulationConfig::SimulatorType & getTargetSimulator () const
 
const std::string & getNodeSetsFile () const noexcept
 
const nonstd::optional< std::string > & getNodeSet () const noexcept
 
const std::unordered_map< std::string, variantValueType > & getMetaData () const noexcept
 
const std::unordered_map< std::string, variantValueType > & getBetaFeatures () const noexcept
 
const std::string & getExpandedJSON () const
 

Static Public Member Functions

static SimulationConfig fromFile (const std::string &path)
 

Detailed Description

Read access to a SONATA simulation config file.

Constructor & Destructor Documentation

◆ SimulationConfig()

bbp::sonata::SimulationConfig::SimulationConfig ( const std::string &  content,
const std::string &  basePath 
)

Parses a SONATA JSON simulation configuration file.

Exceptions
SonataErroron:
  • Ill-formed JSON
  • Missing mandatory entries (in any depth)

Member Function Documentation

◆ fromFile()

static SimulationConfig bbp::sonata::SimulationConfig::fromFile ( const std::string &  path)
static

Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it.

Exceptions
SonataErroron:
  • Non accesible file (does not exists / does not have read access)
  • Ill-formed JSON
  • Missing mandatory entries (in any depth)

◆ getBasePath()

const std::string& bbp::sonata::SimulationConfig::getBasePath ( ) const
noexcept

Returns the base path of the simulation config file

◆ getBetaFeatures()

const std::unordered_map<std::string, variantValueType>& bbp::sonata::SimulationConfig::getBetaFeatures ( ) const
noexcept

Returns the beta_features section

◆ getConditions()

const Conditions& bbp::sonata::SimulationConfig::getConditions ( ) const
noexcept

Returns the Conditions section of the simulation configuration.

◆ getConnectionOverrides()

const std::vector<ConnectionOverride>& bbp::sonata::SimulationConfig::getConnectionOverrides ( ) const
noexcept

Returns the full list of connection overrides

◆ getExpandedJSON()

const std::string& bbp::sonata::SimulationConfig::getExpandedJSON ( ) const

Returns the configuration file JSON whose variables have been expanded by the manifest entries.

◆ getInput()

const Input& bbp::sonata::SimulationConfig::getInput ( const std::string &  name) const

Returns the given input parameters.

Exceptions
SonataErrorif the given input name does not exist

◆ getJSON()

const std::string& bbp::sonata::SimulationConfig::getJSON ( ) const
noexcept

Returns the JSON content of the simulation config file

◆ getMetaData()

const std::unordered_map<std::string, variantValueType>& bbp::sonata::SimulationConfig::getMetaData ( ) const
noexcept

Returns the metadata section

◆ getNetwork()

const std::string& bbp::sonata::SimulationConfig::getNetwork ( ) const
noexcept

Returns circuit config file associated with this simulation config

◆ getNodeSet()

const nonstd::optional<std::string>& bbp::sonata::SimulationConfig::getNodeSet ( ) const
noexcept

Returns the name of node set to be instantiated for the simulation, default = None

◆ getNodeSetsFile()

const std::string& bbp::sonata::SimulationConfig::getNodeSetsFile ( ) const
noexcept

Returns the path of node sets file overriding node_sets_file provided in _network, default is empty in case of no setting in _network

◆ getOutput()

const Output& bbp::sonata::SimulationConfig::getOutput ( ) const
noexcept

Returns the Output section of the simulation configuration.

◆ getReport()

const Report& bbp::sonata::SimulationConfig::getReport ( const std::string &  name) const

Returns the given report parameters.

Exceptions
SonataErrorif the given report name does not correspond with any existing report.

◆ getRun()

const Run& bbp::sonata::SimulationConfig::getRun ( ) const
noexcept

Returns the Run section of the simulation configuration.

◆ getTargetSimulator()

const SimulationConfig::SimulatorType& bbp::sonata::SimulationConfig::getTargetSimulator ( ) const

Returns the name of simulator, default = NEURON

Exceptions
SonataErrorif the given value is neither NEURON nor CORENEURON

◆ listInputNames()

std::set<std::string> bbp::sonata::SimulationConfig::listInputNames ( ) const

Returns the names of the inputs

◆ listReportNames()

std::set<std::string> bbp::sonata::SimulationConfig::listReportNames ( ) const

Returns the names of the reports