NuCon is a Python library designed to interface with and control parameters in Nucleares, a nuclear reactor simulation game. It provides a robust, type-safe foundation for reading and writing game parameters, allowing users to easily create their own automations and control systems.
-`Nucon.<PARAMETER>.value`: Get or set the current value of the parameter. Assigning a new value will write it to the game.
-`Nucon.<PARAMETER>.param_type`: Get the type of the parameter
-`Nucon.<PARAMETER>.is_writable`: Check if the parameter is writable
-`Nucon.<PARAMETER>.enum_type`: Get the enum type of the parameter if it's an enum, otherwise None
Parameter methods:
-`Nucon.<PARAMETER>.read()`: Get the current value of the parameter (alias for `value`)
-`Nucon.<PARAMETER>.write(new_value, force=False)`: Write a new value to the parameter. `force` will try to write even if the parameter is known as non-writable.
NuCon includes a preliminary Reinforcement Learning (RL) environment based on the OpenAI Gym interface. This feature is currently a work in progress and requires additional dependencies.
### Additional Dependencies
To use the RL features, you'll need to install the following packages:
```bash
pip install gymnasium numpy
```
### RL Environment
The `NuconEnv` class in `nucon/rl.py` provides a Gym-compatible environment for reinforcement learning tasks in the Nucleares simulation. Key features include:
- 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.
### Usage
Here's a basic example of how to use the RL environment: