pub trait DecisionModifier:
Send
+ Sync
+ Debug {
// Required methods
fn modify(
&self,
action: Action,
context: &DecisionContext,
state: &AgentState,
) -> Action;
fn name(&self) -> &'static str;
}Expand description
Trait for modifying decisions based on conditions
Modifiers are applied after the base decider makes its decision, allowing for layered behavior like “weather awareness” on top of “flocking behavior”.
Required Methods§
Sourcefn modify(
&self,
action: Action,
context: &DecisionContext,
state: &AgentState,
) -> Action
fn modify( &self, action: Action, context: &DecisionContext, state: &AgentState, ) -> Action
Modify an action based on context and state
Can return the same action unchanged, modify it, or replace it entirely.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".