Struct relearn::spaces::TupleSpace2
source · [−]pub struct TupleSpace2<A, B>(pub A, pub B);
Expand description
Cartesian product of two spaces; elements are tuples
Tuple Fields
0: A
1: B
Trait Implementations
sourceimpl<T0, T1, OS0, OS1, AS0, AS1, FS0, FS1> BuildAgent<TupleSpace2<OS0, OS1>, TupleSpace2<AS0, AS1>, TupleSpace2<FS0, FS1>> for AgentPair<T0, T1> where
T0: BuildAgent<OS0, AS0, FS0> + 'static,
T1: BuildAgent<OS1, AS1, FS1> + 'static,
OS0: Space + Clone + 'static,
OS1: Space + Clone + 'static,
AS0: Space + Clone + 'static,
AS1: Space + Clone + 'static,
FS0: Space + Clone + 'static,
FS1: Space + Clone + 'static,
impl<T0, T1, OS0, OS1, AS0, AS1, FS0, FS1> BuildAgent<TupleSpace2<OS0, OS1>, TupleSpace2<AS0, AS1>, TupleSpace2<FS0, FS1>> for AgentPair<T0, T1> where
T0: BuildAgent<OS0, AS0, FS0> + 'static,
T1: BuildAgent<OS1, AS1, FS1> + 'static,
OS0: Space + Clone + 'static,
OS1: Space + Clone + 'static,
AS0: Space + Clone + 'static,
AS1: Space + Clone + 'static,
FS0: Space + Clone + 'static,
FS1: Space + Clone + 'static,
type Agent = AgentPair<<T0 as BuildAgent<OS0, AS0, FS0>>::Agent, <T1 as BuildAgent<OS1, AS1, FS1>>::Agent>
type Agent = AgentPair<<T0 as BuildAgent<OS0, AS0, FS0>>::Agent, <T1 as BuildAgent<OS1, AS1, FS1>>::Agent>
Type of agent to build
sourcefn build_agent(
&self,
env: &dyn EnvStructure<ObservationSpace = TupleSpace2<OS0, OS1>, ActionSpace = TupleSpace2<AS0, AS1>, FeedbackSpace = TupleSpace2<FS0, FS1>>,
rng: &mut Prng
) -> Result<Self::Agent, BuildAgentError>
fn build_agent(
&self,
env: &dyn EnvStructure<ObservationSpace = TupleSpace2<OS0, OS1>, ActionSpace = TupleSpace2<AS0, AS1>, FeedbackSpace = TupleSpace2<FS0, FS1>>,
rng: &mut Prng
) -> Result<Self::Agent, BuildAgentError>
Build an agent for the given environment structure (EnvStructure
). Read more
sourceimpl<A: Clone, B: Clone> Clone for TupleSpace2<A, B>
impl<A: Clone, B: Clone> Clone for TupleSpace2<A, B>
sourcefn clone(&self) -> TupleSpace2<A, B>
fn clone(&self) -> TupleSpace2<A, B>
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<A: Debug, B: Debug> Debug for TupleSpace2<A, B>
impl<A: Debug, B: Debug> Debug for TupleSpace2<A, B>
sourceimpl<A: Default, B: Default> Default for TupleSpace2<A, B>
impl<A: Default, B: Default> Default for TupleSpace2<A, B>
sourcefn default() -> TupleSpace2<A, B>
fn default() -> TupleSpace2<A, B>
Returns the “default value” for a type. Read more
sourceimpl<'de, A, B> Deserialize<'de> for TupleSpace2<A, B> where
A: Deserialize<'de>,
B: Deserialize<'de>,
impl<'de, A, B> Deserialize<'de> for TupleSpace2<A, B> where
A: Deserialize<'de>,
B: 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<A: Space + Distribution<<A as Space>::Element>, B: Space + Distribution<<B as Space>::Element>> Distribution<<TupleSpace2<A, B> as Space>::Element> for TupleSpace2<A, B>
impl<A: Space + Distribution<<A as Space>::Element>, B: Space + Distribution<<B as Space>::Element>> Distribution<<TupleSpace2<A, B> as Space>::Element> for TupleSpace2<A, B>
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> <Self as Space>::Element
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> <Self as Space>::Element
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl<A: FeatureSpace, B: FeatureSpace> FeatureSpace for TupleSpace2<A, B>
impl<A: FeatureSpace, B: FeatureSpace> FeatureSpace for TupleSpace2<A, B>
sourcefn num_features(&self) -> usize
fn num_features(&self) -> usize
Length of the encoded feature vectors.
sourcefn features_out<'a, F: Float>(
&self,
element: &Self::Element,
out: &'a mut [F],
zeroed: bool
) -> &'a mut [F]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
fn features_out<'a, F: Float>(
&self,
element: &Self::Element,
out: &'a mut [F],
zeroed: bool
) -> &'a mut [F]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Encode the feature vector of an element into a mutable slice. Read more
sourcefn features<T>(&self, element: &Self::Element) -> T where
T: BuildFromArray1D,
<T::Array as NumArray1D>::Elem: Float,
fn features<T>(&self, element: &Self::Element) -> T where
T: BuildFromArray1D,
<T::Array as NumArray1D>::Elem: Float,
Encode the feature vector of an element into an array.
sourcefn batch_features_out<'a, I, A>(
&self,
elements: I,
out: &mut ArrayBase<A, Ix2>,
zeroed: bool
) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
A: DataMut,
A::Elem: Float,
fn batch_features_out<'a, I, A>(
&self,
elements: I,
out: &mut ArrayBase<A, Ix2>,
zeroed: bool
) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
A: DataMut,
A::Elem: Float,
Encode the feature vectors of multiple elements into rows of a two-dimensional array. Read more
sourcefn batch_features<'a, I, T>(&self, elements: I) -> T where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
T: BuildFromArray2D,
<T::Array as NumArray2D>::Elem: Float,
fn batch_features<'a, I, T>(&self, elements: I) -> T where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
T: BuildFromArray2D,
<T::Array as NumArray2D>::Elem: Float,
Encode the feature vectors of multiple elements as rows of a two-dimensional array.
sourceimpl<A: FiniteSpace, B: FiniteSpace> FiniteSpace for TupleSpace2<A, B>
impl<A: FiniteSpace, B: FiniteSpace> FiniteSpace for TupleSpace2<A, B>
sourceimpl<A: Hash, B: Hash> Hash for TupleSpace2<A, B>
impl<A: Hash, B: Hash> Hash for TupleSpace2<A, B>
sourceimpl<A: LogElementSpace, B: LogElementSpace> LogElementSpace for TupleSpace2<A, B>
impl<A: LogElementSpace, B: LogElementSpace> LogElementSpace for TupleSpace2<A, B>
sourcefn log_element<L: StatsLogger + ?Sized>(
&self,
name: &'static str,
element: &Self::Element,
logger: &mut L
) -> Result<(), LogError>
fn log_element<L: StatsLogger + ?Sized>(
&self,
name: &'static str,
element: &Self::Element,
logger: &mut L
) -> Result<(), LogError>
Log an element of the space
sourceimpl<A: NonEmptySpace, B: NonEmptySpace> NonEmptySpace for TupleSpace2<A, B>
impl<A: NonEmptySpace, B: NonEmptySpace> NonEmptySpace for TupleSpace2<A, B>
sourcefn some_element(&self) -> <Self as Space>::Element
fn some_element(&self) -> <Self as Space>::Element
An arbitrary deterministic element from the space.
sourceimpl<A: PartialEq, B: PartialEq> PartialEq<TupleSpace2<A, B>> for TupleSpace2<A, B>
impl<A: PartialEq, B: PartialEq> PartialEq<TupleSpace2<A, B>> for TupleSpace2<A, B>
sourcefn eq(&self, other: &TupleSpace2<A, B>) -> bool
fn eq(&self, other: &TupleSpace2<A, B>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TupleSpace2<A, B>) -> bool
fn ne(&self, other: &TupleSpace2<A, B>) -> bool
This method tests for !=
.
sourceimpl<A, B> Serialize for TupleSpace2<A, B> where
A: Serialize,
B: Serialize,
impl<A, B> Serialize for TupleSpace2<A, B> where
A: Serialize,
B: Serialize,
sourceimpl<A: Space, B: Space> Space for TupleSpace2<A, B>
impl<A: Space, B: Space> Space for TupleSpace2<A, B>
sourceimpl<A: SubsetOrd, B: SubsetOrd> SubsetOrd for TupleSpace2<A, B>
impl<A: SubsetOrd, B: SubsetOrd> SubsetOrd for TupleSpace2<A, B>
sourcefn subset_cmp(&self, other: &Self) -> Option<Ordering>
fn subset_cmp(&self, other: &Self) -> Option<Ordering>
Compare using the subset relationship. This is a partial order.
sourcefn strict_subset_of(&self, other: &Self) -> bool
fn strict_subset_of(&self, other: &Self) -> bool
Check if this is a strict subset of other
.
sourcefn subset_of(&self, other: &Self) -> bool
fn subset_of(&self, other: &Self) -> bool
Check if this is a subset (strict or equal) of other
.
sourcefn strict_superset_of(&self, other: &Self) -> bool
fn strict_superset_of(&self, other: &Self) -> bool
Check if this is a strict superset of other
.
sourcefn superset_of(&self, other: &Self) -> bool
fn superset_of(&self, other: &Self) -> bool
Check if this is a superset (strict or equal) of other
.
impl<A: Copy, B: Copy> Copy for TupleSpace2<A, B>
impl<A: Eq, B: Eq> Eq for TupleSpace2<A, B>
impl<A, B> StructuralEq for TupleSpace2<A, B>
impl<A, B> StructuralPartialEq for TupleSpace2<A, B>
Auto Trait Implementations
impl<A, B> RefUnwindSafe for TupleSpace2<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for TupleSpace2<A, B> where
A: Send,
B: Send,
impl<A, B> Sync for TupleSpace2<A, B> where
A: Sync,
B: Sync,
impl<A, B> Unpin for TupleSpace2<A, B> where
A: Unpin,
B: Unpin,
impl<A, B> UnwindSafe for TupleSpace2<A, B> where
A: UnwindSafe,
B: 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.