Skip to main content

DecisionModifier

Trait DecisionModifier 

Source
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§

Source

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.

Source

fn name(&self) -> &'static str

Name of this modifier (for logging)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§