Skip to main content

StateAggregation

Trait StateAggregation 

Source
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 concrete State type being aggregated.

Required Associated Types§

Source

type AbstractState: Clone + Eq

The abstract state type produced by aggregation.

Required Methods§

Source

fn aggregate(&self, state: &S) -> Self::AbstractState

Returns the abstract representative for state.

Provided Methods§

Source

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".

Implementors§