pub trait StateAggregation<const SR: usize, S: State<SR>> {
type AbstractState: Clone + Eq;
// Required method
fn aggregate(&self, state: &S) -> Self::AbstractState;
// Provided method
fn same_aggregate(&self, state1: &S, state2: &S) -> bool { ... }
}Expand description
Maps concrete states to abstract representatives for state aggregation.
State aggregation is used in function approximation and hierarchical RL to group similar states under a shared abstract representation.
§Type Parameters
SR: Rank of the concrete state space tensor.S: The concreteStatetype being aggregated.
Required Associated Types§
Sourcetype AbstractState: Clone + Eq
type AbstractState: Clone + Eq
The abstract state type produced by aggregation.
Required Methods§
Sourcefn aggregate(&self, state: &S) -> Self::AbstractState
fn aggregate(&self, state: &S) -> Self::AbstractState
Returns the abstract representative for state.
Provided Methods§
Sourcefn same_aggregate(&self, state1: &S, state2: &S) -> bool
fn same_aggregate(&self, state1: &S, state2: &S) -> bool
Returns true when state1 and state2 map to the same abstract state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".