pub trait DecisionAgent: Send + Any {
type A;
// Required methods
fn next_action(&self, delta_time: Option<Duration>) -> Self::A;
fn observe(&mut self, environment: &SimulationEnvironment);
fn as_any(&self) -> &dyn Any;
}
Expand description
A trait that represents a decision agent responsible for choosing the best action based on the current state of the simulation.
Required Associated Types§
Required Methods§
sourcefn next_action(&self, delta_time: Option<Duration>) -> Self::A
fn next_action(&self, delta_time: Option<Duration>) -> Self::A
Returns the best action based on the current state of the simulation.
Returns
Self::A
- The action chosen by the decision agent.
sourcefn observe(&mut self, environment: &SimulationEnvironment)
fn observe(&mut self, environment: &SimulationEnvironment)
Observes the current environment and updates the agent’s internal state.
Arguments
environment
- The current environment.