Struct MultiAgentEnvLoop
pub struct MultiAgentEnvLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,{ /* private fields */ }Expand description
An asynchronous runner for multiple agent/environement interfaces.
Implementations§
§impl<BT, RLC> MultiAgentEnvLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,
impl<BT, RLC> MultiAgentEnvLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,
pub fn new(
num_envs: usize,
env_init: <RLC as RLComponentsTypes>::EnvInit,
agent: AsyncPolicy<<RLC as RLComponentsTypes>::Backend, <RLC as RLComponentsTypes>::Policy>,
eval: bool,
deterministic: bool,
device: &<BT as BackendTypes>::Device,
) -> MultiAgentEnvLoop<BT, RLC>
pub fn new( num_envs: usize, env_init: <RLC as RLComponentsTypes>::EnvInit, agent: AsyncPolicy<<RLC as RLComponentsTypes>::Backend, <RLC as RLComponentsTypes>::Policy>, eval: bool, deterministic: bool, device: &<BT as BackendTypes>::Device, ) -> MultiAgentEnvLoop<BT, RLC>
Create a new asynchronous runner for multiple agent/environement interfaces.
Trait Implementations§
§impl<BT, RLC> AgentEnvLoop<BT, RLC> for MultiAgentEnvLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,
impl<BT, RLC> AgentEnvLoop<BT, RLC> for MultiAgentEnvLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,
§fn run_steps(
&mut self,
num_steps: usize,
processor: &mut AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>,
interrupter: &Interrupter,
progress: &mut Progress,
) -> Vec<TimeStep<BT, <RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>
fn run_steps( &mut self, num_steps: usize, processor: &mut AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>, interrupter: &Interrupter, progress: &mut Progress, ) -> Vec<TimeStep<BT, <RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>
Run a certain number of timesteps. Read more
§fn update_policy(&mut self, update: <RLC as RLComponentsTypes>::PolicyState)
fn update_policy(&mut self, update: <RLC as RLComponentsTypes>::PolicyState)
Update the runner’s agent.
§fn run_episodes(
&mut self,
num_episodes: usize,
processor: &mut AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>,
interrupter: &Interrupter,
_progress: &mut Progress,
) -> Vec<Trajectory<BT, <RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>
fn run_episodes( &mut self, num_episodes: usize, processor: &mut AsyncProcessorTraining<RLEvent<<RLC as RLComponentsTypes>::TrainingOutput, <RLC as RLComponentsTypes>::ActionContext>, AgentEvaluationEvent<<RLC as RLComponentsTypes>::ActionContext>>, interrupter: &Interrupter, _progress: &mut Progress, ) -> Vec<Trajectory<BT, <RLC as RLComponentsTypes>::State, <RLC as RLComponentsTypes>::Action, <RLC as RLComponentsTypes>::ActionContext>>
Run a certain number of episodes. Read more
§fn policy(&self) -> <RLC as RLComponentsTypes>::PolicyState
fn policy(&self) -> <RLC as RLComponentsTypes>::PolicyState
Get the state of the runner’s agent.
Auto Trait Implementations§
impl<BT, RLC> Freeze for MultiAgentEnvLoop<BT, RLC>
impl<BT, RLC> RefUnwindSafe for MultiAgentEnvLoop<BT, RLC>
impl<BT, RLC> Send for MultiAgentEnvLoop<BT, RLC>
impl<BT, RLC> !Sync for MultiAgentEnvLoop<BT, RLC>
impl<BT, RLC> Unpin for MultiAgentEnvLoop<BT, RLC>
impl<BT, RLC> UnwindSafe for MultiAgentEnvLoop<BT, RLC>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more