Struct AgentEnvBaseLoop
pub struct AgentEnvBaseLoop<B, RLC>where
B: Backend,
RLC: RLComponentsTypes,{ /* private fields */ }Expand description
A simple, synchronized agent/environement interface.
Implementations§
§impl<B, RLC> AgentEnvBaseLoop<B, RLC>where
B: Backend,
RLC: RLComponentsTypes,
impl<B, RLC> AgentEnvBaseLoop<B, RLC>where
B: Backend,
RLC: RLComponentsTypes,
pub fn new(
env_init: <RLC as RLComponentsTypes>::EnvInit,
agent: <RLC as RLComponentsTypes>::Policy,
eval: bool,
deterministic: bool,
) -> AgentEnvBaseLoop<B, RLC>
pub fn new( env_init: <RLC as RLComponentsTypes>::EnvInit, agent: <RLC as RLComponentsTypes>::Policy, eval: bool, deterministic: bool, ) -> AgentEnvBaseLoop<B, RLC>
Create a new base runner.
Trait Implementations§
§impl<BT, RLC> AgentEnvLoop<BT, RLC> for AgentEnvBaseLoop<BT, RLC>where
BT: Backend,
RLC: RLComponentsTypes,
impl<BT, RLC> AgentEnvLoop<BT, RLC> for AgentEnvBaseLoop<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<B, RLC> Freeze for AgentEnvBaseLoop<B, RLC>
impl<B, RLC> RefUnwindSafe for AgentEnvBaseLoop<B, RLC>where
<RLC as RLComponentsTypes>::Env: RefUnwindSafe,
<RLC as RLComponentsTypes>::Policy: RefUnwindSafe,
B: RefUnwindSafe,
impl<B, RLC> Send for AgentEnvBaseLoop<B, RLC>
impl<B, RLC> Sync for AgentEnvBaseLoop<B, RLC>
impl<B, RLC> Unpin for AgentEnvBaseLoop<B, RLC>
impl<B, RLC> UnwindSafe for AgentEnvBaseLoop<B, RLC>where
<RLC as RLComponentsTypes>::Env: UnwindSafe,
<RLC as RLComponentsTypes>::Policy: UnwindSafe,
B: 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
§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