Skip to content

State PyTrees¤

Note

State PyTrees that are operated on by specific model types are located alongside their respective types.

For example, MechanicsState is defined in the same module as Mechanics.

feedbax.state.State module-attribute ¤

State: TypeAlias = PyTree

feedbax.state.StateT module-attribute ¤

StateT = TypeVar('StateT', bound=State)

feedbax.state.StateBounds (Module, Generic[StateT]) ¤

Specifies bounds on a state.

Attributes:

Name Type Description
low Optional[StateT]

A state PyTree giving lower bounds.

high Optional[StateT]

A state PyTree giving upper bounds.

filter_spec: PyTree[bool] cached property ¤

A matching PyTree, indicated which parts of the state are bounded.

feedbax.state.CartesianState (Module) ¤

Cartesian state of a mechanical system in two spatial dimensions.

Attributes:

Name Type Description
pos Float[Array, '... 2']

The position coordinates of the point(s) in the system.

vel Float[Array, '... 2']

The respective velocities.

force Float[Array, '... 2']

The respective forces.

feedbax.state.clip_state (bounds: StateBounds[StateT],state: StateT) -> StateT
¤

Returns a state clipped to the given bounds.

Parameters:

Name Type Description Default
bounds StateBounds[StateT]

The lower and upper bounds to clip the state to.

required
state StateT

The state to clip.

required