Skip to main content

UtilityAction

Trait UtilityAction 

Source
pub trait UtilityAction: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn score(&self, bb: &Blackboard) -> f32;
    fn execute(&mut self, bb: &mut Blackboard, dt: f32) -> bool;

    // Provided method
    fn reset(&mut self) { ... }
}
Expand description

An action that utility AI can evaluate and execute.

Required Methods§

Source

fn name(&self) -> &str

Source

fn score(&self, bb: &Blackboard) -> f32

Score this action [0, 1]. Higher = more desirable.

Source

fn execute(&mut self, bb: &mut Blackboard, dt: f32) -> bool

Execute this action. Returns true if complete.

Provided Methods§

Source

fn reset(&mut self)

Reset execution state.

Implementors§