Simulation environment configuration

Configuring the environment

%load_ext param.ipython
from param.ipython import ParamPager
import panel as pn

Initialize the larvaworld registry. This loads some components from disc and builds the rest on the fly.

from larvaworld.lib import reg

We will start with the EnvConf class which supports environment configurations

Stored instances of the EnvConf class are available through the configuration registry.

The registry is retrieved from a dictionary of registry objects by the Env key.

Env_reg = reg.conf.Env

Each environment configuration is stored in the registry’s dictionary under a unique ID.

Let’s print the IDs

EnvIDs = Env_reg.confIDs
print(f"The IDs of the stored environment configurations are :{EnvIDs}")
# The configuration IDs are the keys. They correspond to a nested dictionary :
envID = EnvIDs[0]
env_entry = Env_reg.getID(envID)
print(f"The environment configuration stored under ID {envID} is :")
env_entry.print()
from larvaworld.lib.reg.generators import EnvConf

%params EnvConf

Let’s generate a new instance

env_new = EnvConf()

%params env_new
reg.conf.Trial.getID("default")