This engine type enables the integration of the NEST spiking neural network simulator in NRP-core. It is based on the JSON over REST engine.
At initialization time, it loads a NEST simulation model described in a python script. At run time, it takes care of advancing the simulation when requested and of handling datapack data transfer.
This engine supports a unique datapack type: JsonDataPack. It contains the status of a set of neurons, detectors or synapsis as a dictionary or list of dictionaries. In fact, it can store the status of any NEST object which can be passed as argument to nest.GetStatus()
and nest.SetStatus()
functions.
nrp_core.engines.nest_json contains two functions that can be used to register datapacks with a NEST Json Engine:
After a datapack is registered using the functions described above, a NestEngineJSONDataPackController object is created to handle datapack I/O operations for this datapack in the Engine server. The NEST object passed to RegisterDataPack() is linked to this datapack controller. When the datapack is sent to the engine, it is passed to the controller which calls nest.SetStatus() with the datapack content. When the datapack is requested from the engine, the datapack controller calls nest.GetStatus() and stores the return value in the datapack data attribute.
In examples/nest_simple
can be found a simple experiment showing the use of NEST JSON Engine. First, in the script nest_simple.py
, a NEST network is defined and two datapacks with names noise
and voltage
are registered:
Then, in tf_1.py
, the voltage
JsonDataPack is accessed and its content printed out. Finally it returns a noise
datapack that will be used to set the status of its linked NEST object after it has been received by the engine server:
Attribute | Description | Python Type | C type |
---|---|---|---|
data | data contained in the datapack as a NlohmannJson object | NlohmannJson | nlohmann::json |
This Engine type parameters are defined in the NestJSONEngine schema (listed here), which in turn is based on EngineBase and EngineJSON schemas and thus inherits all parameters from them.
To use the NEST JSON engine in an experiment, set EngineType
to "nest_json".
Name | Description | Type | Default | Required | Array |
---|---|---|---|---|---|
EngineName | Name of the engine | string | X | ||
EngineType | Engine type. Used by EngineLauncherManager to select the correct engine launcher | string | X | ||
EngineProcCmd | Engine Process Launch command | string | |||
EngineProcStartParams | Engine Process Start Parameters | string | [] | X | |
EngineEnvParams | Engine Process Environment Parameters | string | [] | X | |
EngineLaunchCommand | LaunchCommand with parameters that will be used to launch the engine process | object | {"LaunchType":"BasicFork"} | ||
EngineTimestep | Engine Timestep in seconds | number | 0.01 | ||
EngineCommandTimeout | Engine Timeout (in seconds). It tells how long to wait for the completion of the engine runStep. 0 or negative values are interpreted as no timeout | number | 0.0 |
Name | Description | Type | Default | Required | Array |
---|---|---|---|---|---|
ServerAddress | EngineJSONServer address. Should this address already be in use, the server will continue trying ports higher up | string | localhost:9002 | ||
RegistrationServerAddress | Address EngineJSONRegistrationServer is listening at. Once the JSON engine server has bound to a port, it will use this address to register itself with the SimulationManager | string | localhost:9001 |
Name | Description | Type | Default | Required | Array |
---|---|---|---|---|---|
NestInitFileName | Path to the Python script that sets up the neural network for the simulation | string | X | ||
NestRNGSeed | Nest RNG seed | integer | 0 |
As explained above, the schema used by the NEST JSON engine inherits from EngineBase and EngineJSON schemas. A complete schema for the configuration of this engine is given below: