pub trait Act: Clone + Debug {
// Provided method
fn len(&self) -> usize { ... }
}
Expand description
A trait representing actions that can be taken in an environment.
This trait defines the interface for actions in reinforcement learning. Actions represent the decisions made by the agent that affect the environment.
§Requirements
Implementations must:
- Be cloneable for efficient copying
- Support debug formatting for logging and debugging
§Examples
ⓘ
#[derive(Clone, Debug)]
struct DiscreteAction {
action: usize,
num_actions: usize,
}
impl Act for DiscreteAction {
fn len(&self) -> usize {
self.num_actions
}
}
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.