diff --git a/README.md b/README.md index c4bc7f2..2db6a00 100644 --- a/README.md +++ b/README.md @@ -102,15 +102,17 @@ The `NuconEnv` class in `nucon/rl.py` provides a Gym-compatible environment for - Observation space: Includes all readable parameters from the Nucon system. - Action space: Encompasses all writable parameters in the Nucon system. - Step function: Applies actions to the Nucon system and returns new observations. -- Objective function: Allows for custom objective functions to be defined for training. +- Objective function: Allows for predefined or custom objective functions to be defined for training. ### Usage Here's a basic example of how to use the RL environment: ```python -from nucon.rl import NuconEnv +from nucon.rl import NuconEnv, Parameterized_Objectives env = NuconEnv(objectives=['max_power'], seconds_per_step=5) +# env2 = gym.make('Nucon-max_power-v0') +# env3 = NuconEnv(objectives=[Parameterized_Objectives['target_temperature'](goal_temp=600)], seconds_per_step=5) obs, info = env.reset() for _ in range(1000): @@ -122,6 +124,8 @@ for _ in range(1000): env.close() ``` +Objectives takes either strings of the name of predefined objectives, or lambda functions which take an observation and return a scalar reward. Final rewards are summed across all objectives. `info['objectives']` contains all objectives and their values. + ## Testing NuCon includes a test suite to verify its functionality and compatibility with the Nucleares game.