Struct relearn::agents::RandomAgent
source · [−]pub struct RandomAgent<AS> { /* private fields */ }
Expand description
An agent that samples actions at random.
Implementations
sourceimpl<AS> RandomAgent<AS>
impl<AS> RandomAgent<AS>
Trait Implementations
sourceimpl<O, AS: SampleSpace + Clone> Actor<O, <AS as Space>::Element> for RandomAgent<AS>
impl<O, AS: SampleSpace + Clone> Actor<O, <AS as Space>::Element> for RandomAgent<AS>
type EpisodeState = ()
type EpisodeState = ()
Stores state for each episode.
sourcefn initial_state(&self, _: &mut Prng) -> Self::EpisodeState
fn initial_state(&self, _: &mut Prng) -> Self::EpisodeState
Create the initial actor state for the start of a new episode.
sourceimpl<O, AS: SampleSpace + Clone> Agent<O, <AS as Space>::Element> for RandomAgent<AS>
impl<O, AS: SampleSpace + Clone> Agent<O, <AS as Space>::Element> for RandomAgent<AS>
sourceimpl<O, AS: Space> BatchUpdate<O, <AS as Space>::Element> for RandomAgent<AS>
impl<O, AS: Space> BatchUpdate<O, <AS as Space>::Element> for RandomAgent<AS>
type HistoryBuffer = NullBuffer
sourcefn buffer(&self) -> Self::HistoryBuffer
fn buffer(&self) -> Self::HistoryBuffer
Create a new history buffer.
sourcefn min_update_size(&self) -> HistoryDataBound
fn min_update_size(&self) -> HistoryDataBound
Request a minimum amount of on-policy data for the next batch update.
sourcefn batch_update<'a, I>(&mut self, _buffers: I, _logger: &mut dyn StatsLogger) where
I: IntoIterator<Item = &'a mut Self::HistoryBuffer>,
Self::HistoryBuffer: 'a,
fn batch_update<'a, I>(&mut self, _buffers: I, _logger: &mut dyn StatsLogger) where
I: IntoIterator<Item = &'a mut Self::HistoryBuffer>,
Self::HistoryBuffer: 'a,
Update the agent from a collection of history buffers. Read more
sourceimpl<AS: Clone> Clone for RandomAgent<AS>
impl<AS: Clone> Clone for RandomAgent<AS>
sourcefn clone(&self) -> RandomAgent<AS>
fn clone(&self) -> RandomAgent<AS>
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<AS: Debug> Debug for RandomAgent<AS>
impl<AS: Debug> Debug for RandomAgent<AS>
sourceimpl<'de, AS> Deserialize<'de> for RandomAgent<AS> where
AS: Deserialize<'de>,
impl<'de, AS> Deserialize<'de> for RandomAgent<AS> where
AS: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<AS: Display> Display for RandomAgent<AS>
impl<AS: Display> Display for RandomAgent<AS>
sourceimpl<AS: Hash> Hash for RandomAgent<AS>
impl<AS: Hash> Hash for RandomAgent<AS>
sourceimpl<AS: PartialEq> PartialEq<RandomAgent<AS>> for RandomAgent<AS>
impl<AS: PartialEq> PartialEq<RandomAgent<AS>> for RandomAgent<AS>
sourcefn eq(&self, other: &RandomAgent<AS>) -> bool
fn eq(&self, other: &RandomAgent<AS>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RandomAgent<AS>) -> bool
fn ne(&self, other: &RandomAgent<AS>) -> bool
This method tests for !=
.
sourceimpl<AS> Serialize for RandomAgent<AS> where
AS: Serialize,
impl<AS> Serialize for RandomAgent<AS> where
AS: Serialize,
impl<AS: Copy> Copy for RandomAgent<AS>
impl<AS: Eq> Eq for RandomAgent<AS>
impl<AS> StructuralEq for RandomAgent<AS>
impl<AS> StructuralPartialEq for RandomAgent<AS>
Auto Trait Implementations
impl<AS> RefUnwindSafe for RandomAgent<AS> where
AS: RefUnwindSafe,
impl<AS> Send for RandomAgent<AS> where
AS: Send,
impl<AS> Sync for RandomAgent<AS> where
AS: Sync,
impl<AS> Unpin for RandomAgent<AS> where
AS: Unpin,
impl<AS> UnwindSafe for RandomAgent<AS> where
AS: 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.