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§
fn name(&self) -> &str
Sourcefn score(&self, bb: &Blackboard) -> f32
fn score(&self, bb: &Blackboard) -> f32
Score this action [0, 1]. Higher = more desirable.
Sourcefn execute(&mut self, bb: &mut Blackboard, dt: f32) -> bool
fn execute(&mut self, bb: &mut Blackboard, dt: f32) -> bool
Execute this action. Returns true if complete.