Struct border_async_trainer::ActorManager
source · [−]pub struct ActorManager<A, E, R, P> where
A: Agent<E, R> + SyncModel,
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>, { /* private fields */ }
Expand description
Manages Actors.
This struct handles the following requests:
- From the LearnerManager for updating the latest model info, stored in this struct.
- From the Actors for getting the latest model info.
- From the Actors for pushing sample batch to the
LearnerManager
.
Implementations
impl<A, E, R, P> ActorManager<A, E, R, P> where
A: Agent<E, R> + SyncModel,
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output> + Send + 'static,
A::Config: Send + 'static,
E::Config: Send + 'static,
P::Config: Send + 'static,
R::PushedItem: Send + 'static,
A::ModelInfo: Send + 'static,
impl<A, E, R, P> ActorManager<A, E, R, P> where
A: Agent<E, R> + SyncModel,
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output> + Send + 'static,
A::Config: Send + 'static,
E::Config: Send + 'static,
P::Config: Send + 'static,
R::PushedItem: Send + 'static,
A::ModelInfo: Send + 'static,
Builds a ActorManager.
Runs threads for Actors and a thread for sending samples into the replay buffer.
A thread will wait for the initial SyncModel::ModelInfo from AsyncTrainer, which blocks execution of Actor threads.
Stops and joins actors.