1D Custom Environments
Any 1D custom environment can easily be added to the PDE ContRoL Gym. It is best to follow the current environments format to ensure project structure errors are avoided. The following steps are required to add a custom 1D environment.
Build you environment (in the folder
pde_control_gym/src/environments1d/) implementing all the required functions by inheriting the base classPDEEnv1D. All the details about the base class are given below and it is probably helpful to look at the source code for the other 1D environments inpde_control_gym/src/environments1d/for example templates.Update
__init__.pyfiles in each of the following folders:pde_control_gym/src/environments1d/__init__.pyImport your class containing the environment and add it to the
__all__array.
pde_control_gym/src/__init__.pyAgain import your class from the
environments1dfolder and again add it to the__all__array.
pde_control_gym/__init__.pyRegister your new environment by giving the environment an
idand set theentry_pointto"pde_control_gym.src:{Insert Class Name}".
Reinstall environment by going to the root directory and running
pip install -e ..Use your new environment by importing the gym and making the environment!
import pde_control_gym env = gym.make("{id_given_in_step_2}", params="{Your env parameters}")