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:
Separation of Concerns: Each manager handles one specific area of your program
Reusability: Managers can be shared across environments
Configurability: Easy to modify behavior through configuration
Logging: Automatic tensorboard logging support
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.action_manager = PositionActionManager(self, ...)
RewardManager(self, ...)
TerminationManager(self, ...)
ObservationManager(self, ...)
Manager Lifecycle#
All managers follow a consistent lifecycle:
Build: Called before the very first step to initialize manager and its buffers.
Step: Called at each environment step
Reset: Called when environments reset
Explore the managers to learn more.