Struct border_async_trainer::Actor
source · pub struct Actor<A, E, P, R>where
A: Agent<E, R> + SyncModel,
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>,{ /* private fields */ }
Expand description
Runs interaction between an Agent
and an Env
, then generates transitions.
flowchart TB
E["Agent
(in AsyncTrainer)"]-->|SyncModel::ModelInfo|A subgraph D[Actor] A[Agent]-->|Env::Act|B[Env] B-->|Env::Obs|A B-->|Step<E: Env>|C[StepProcessorBase] end C-->|ReplayBufferBase::PushedItem|F[ReplayBufferProxy]
(in AsyncTrainer)"]-->|SyncModel::ModelInfo|A subgraph D[Actor] A[Agent]-->|Env::Act|B[Env] B-->|Env::Obs|A B-->|Step<E: Env>|C[StepProcessorBase] end C-->|ReplayBufferBase::PushedItem|F[ReplayBufferProxy]
This diagram shows interaction of Agent
, Env
and StepProcessorBase
,
as shown in border_core::Trainer
. However, this diagram also shows that
The Agent
in the Actor
periodically synchronizes with the Agent
in
AsyncTrainer
via SyncModel::ModelInfo
, and the transitions generated by
StepProcessorBase
are sent to the ReplayBufferProxy
.
See also the diagram in AsyncTrainer
.
Implementations§
source§impl<A, E, P, R> Actor<A, E, P, R>where
A: Agent<E, R> + SyncModel,
E: Env,
P: StepProcessorBase<E>,
R: ReplayBufferBase<PushedItem = P::Output>,
impl<A, E, P, R> Actor<A, E, P, R>where A: Agent<E, R> + SyncModel, E: Env, P: StepProcessorBase<E>, R: ReplayBufferBase<PushedItem = P::Output>,
Auto Trait Implementations§
impl<A, E, P, R> RefUnwindSafe for Actor<A, E, P, R>where A: RefUnwindSafe, E: RefUnwindSafe, P: RefUnwindSafe, R: RefUnwindSafe, <A as Policy<E>>::Config: RefUnwindSafe, <E as Env>::Config: RefUnwindSafe, <P as StepProcessorBase<E>>::Config: RefUnwindSafe,
impl<A, E, P, R> Send for Actor<A, E, P, R>where A: Send, E: Send, P: Send, R: Send, <A as Policy<E>>::Config: Send, <E as Env>::Config: Send, <P as StepProcessorBase<E>>::Config: Send,
impl<A, E, P, R> Sync for Actor<A, E, P, R>where A: Sync, E: Sync, P: Sync, R: Sync, <A as Policy<E>>::Config: Sync, <E as Env>::Config: Sync, <P as StepProcessorBase<E>>::Config: Sync,
impl<A, E, P, R> Unpin for Actor<A, E, P, R>where A: Unpin, E: Unpin, P: Unpin, R: Unpin, <A as Policy<E>>::Config: Unpin, <E as Env>::Config: Unpin, <P as StepProcessorBase<E>>::Config: Unpin,
impl<A, E, P, R> UnwindSafe for Actor<A, E, P, R>where A: UnwindSafe, E: UnwindSafe, P: UnwindSafe, R: UnwindSafe, <A as Policy<E>>::Config: UnwindSafe, <E as Env>::Config: UnwindSafe, <P as StepProcessorBase<E>>::Config: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more