rlightning.engine.async_rl_engine¶
Asynchronous reinforcement learning engine module.
This module implements the AsyncRLEngine for asynchronous training where rollout, training, and weight updates run in separate threads.
- class rlightning.engine.async_rl_engine.AsyncCoordinator[source]¶
Bases:
objectA coordinator to manage asynchronous tasks.
- class rlightning.engine.async_rl_engine.AsyncRLEngine(config: MainConfig, env_group: EnvGroup, policy_group: PolicyGroup, buffer: DataBuffer)[source]¶
Bases:
BaseEngineAsynchronous reinforcement learning engine.
This engine implements asynchronous training where: - Rollout thread: Collects experience from environments. - Training thread: Updates policy using collected experience. - Weight update thread: Broadcasts updated weights to eval policies.
- rollout() None[source]¶
Perform rollout to collect experience from environments.
Runs the rollout loop, collecting experience by stepping through environments and storing transitions in the buffer. Runs until the done_flag is set.
- run() None[source]¶
Launch asynchronous training threads.
Starts three worker threads (rollout, train, weight update) and waits for them to complete. Prints timing summary when finished.