Struct relearn::agents::SerialActorAgent
source · [−]pub struct SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>, { /* private fields */ }
Expand description
A serial combined actor-agent.
Consists of an agent, an actor, and a history buffer. Steps are accumulated into the buffer and used to update the agent when full.
Implementations
sourceimpl<T, O, A> SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
impl<T, O, A> SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
pub fn new(agent: T) -> Self
sourcepub fn update(
&mut self,
step: PartialStep<O, A, T::Feedback>,
logger: &mut dyn StatsLogger
)
pub fn update(
&mut self,
step: PartialStep<O, A, T::Feedback>,
logger: &mut dyn StatsLogger
)
Update with the most recent step result.
This step must correspond to the most recent call to Actor::act
.
Trait Implementations
sourceimpl<T, O, A> Actor<O, A> for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
impl<T, O, A> Actor<O, A> for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
type EpisodeState = <<T as Agent<O, A>>::Actor as Actor<O, A>>::EpisodeState
type EpisodeState = <<T as Agent<O, A>>::Actor as Actor<O, A>>::EpisodeState
Stores state for each episode.
sourcefn initial_state(&self, rng: &mut Prng) -> Self::EpisodeState
fn initial_state(&self, rng: &mut Prng) -> Self::EpisodeState
Create the initial actor state for the start of a new episode.
sourceimpl<T: Clone, O: Clone, A: Clone> Clone for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Clone,
T::HistoryBuffer: Clone,
impl<T: Clone, O: Clone, A: Clone> Clone for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Clone,
T::HistoryBuffer: Clone,
sourcefn clone(&self) -> SerialActorAgent<T, O, A>
fn clone(&self) -> SerialActorAgent<T, O, A>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T, O, A> Debug for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A> + Debug,
T::Actor: Debug,
T::HistoryBuffer: Debug,
impl<T, O, A> Debug for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A> + Debug,
T::Actor: Debug,
T::HistoryBuffer: Debug,
sourceimpl<T: Hash, O: Hash, A: Hash> Hash for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Hash,
T::HistoryBuffer: Hash,
impl<T: Hash, O: Hash, A: Hash> Hash for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Hash,
T::HistoryBuffer: Hash,
sourceimpl<T: PartialEq, O: PartialEq, A: PartialEq> PartialEq<SerialActorAgent<T, O, A>> for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: PartialEq,
T::HistoryBuffer: PartialEq,
impl<T: PartialEq, O: PartialEq, A: PartialEq> PartialEq<SerialActorAgent<T, O, A>> for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: PartialEq,
T::HistoryBuffer: PartialEq,
sourcefn eq(&self, other: &SerialActorAgent<T, O, A>) -> bool
fn eq(&self, other: &SerialActorAgent<T, O, A>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SerialActorAgent<T, O, A>) -> bool
fn ne(&self, other: &SerialActorAgent<T, O, A>) -> bool
This method tests for !=
.
impl<T: Copy, O: Copy, A: Copy> Copy for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Copy,
T::HistoryBuffer: Copy,
impl<T: Eq, O: Eq, A: Eq> Eq for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
T::Actor: Eq,
T::HistoryBuffer: Eq,
impl<T, O, A> StructuralEq for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
impl<T, O, A> StructuralPartialEq for SerialActorAgent<T, O, A> where
T: Agent<O, A> + BatchUpdate<O, A>,
Auto Trait Implementations
impl<T, O, A> RefUnwindSafe for SerialActorAgent<T, O, A> where
T: RefUnwindSafe,
<T as Agent<O, A>>::Actor: RefUnwindSafe,
<T as BatchUpdate<O, A>>::HistoryBuffer: RefUnwindSafe,
impl<T, O, A> Send for SerialActorAgent<T, O, A> where
T: Send,
<T as Agent<O, A>>::Actor: Send,
<T as BatchUpdate<O, A>>::HistoryBuffer: Send,
impl<T, O, A> Sync for SerialActorAgent<T, O, A> where
T: Sync,
<T as Agent<O, A>>::Actor: Sync,
<T as BatchUpdate<O, A>>::HistoryBuffer: Sync,
impl<T, O, A> Unpin for SerialActorAgent<T, O, A> where
T: Unpin,
<T as Agent<O, A>>::Actor: Unpin,
<T as BatchUpdate<O, A>>::HistoryBuffer: Unpin,
impl<T, O, A> UnwindSafe for SerialActorAgent<T, O, A> where
T: UnwindSafe,
<T as Agent<O, A>>::Actor: UnwindSafe,
<T as BatchUpdate<O, A>>::HistoryBuffer: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.