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§

source

type A

The associated action type for this decision agent.

Required Methods§

source

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.
source

fn observe(&mut self, environment: &SimulationEnvironment)

Observes the current environment and updates the agent’s internal state.

Arguments
  • environment - The current environment.
source

fn as_any(&self) -> &dyn Any

Returns a reference to the Any trait for this object.

This method is useful for downcasting the object to a concrete type when working with trait objects.

Returns

A reference to the Any trait for the object.

Implementors§