Managers#

Each manager handles a specific aspect of your RL environment, making your code more modular and maintainable.

Why Use Managers?#

Traditional RL environment code often becomes a monolithic mess as features are added. Genesis Forge’s manager architecture provides:

  1. Separation of Concerns: Each manager handles one specific area of your program

  2. Reusability: Managers can be shared across environments

  3. Configurability: Easy to modify behavior through configuration

  4. Logging: Automatic tensorboard logging support

  5. Less Boilerplate: Common patterns are handled for you

Basic Example#

When your environment class inherits from ManagedEnvironment, managers are automatically coordinated throughout your environment’s build/step/reset lifecycles.

from genesis_forge import ManagedEnvironment

class MyEnv(ManagedEnvironment):
    def __init__(self, ...):
        super().__init__(...)
        # Build your scene here

    def config(self):
        """Configure all managers here"""
        self.actuators = ActuatorManager(self, ...)
        PositionActionManager(self, ...)
        RewardManager(self, ...)
        TerminationManager(self, ...)
        ObservationManager(self, ...)

Manager Lifecycle#

All managers follow a consistent lifecycle:

  1. Build: Called before the very first step to initialize manager and its buffers.

  2. Step: Called at each environment step

  3. Reset: Called when environments reset

Explore the managers to learn more.