pub trait BasicTraits {
// Required methods
fn new(objective: String, position: String) -> Self;
fn update_state(&mut self, new_state: AgentState);
fn get_objective(&self) -> &String;
fn get_position(&self) -> &String;
fn get_state(&self) -> &AgentState;
fn get_memory(&self) -> &Vec<Message>;
}
Expand description
Defines the basic traits that an agent must implement for managing its state, objective, position, and memory.
Required Methods§
sourcefn update_state(&mut self, new_state: AgentState)
fn update_state(&mut self, new_state: AgentState)
sourcefn get_objective(&self) -> &String
fn get_objective(&self) -> &String
sourcefn get_position(&self) -> &String
fn get_position(&self) -> &String
Retrieves the position or role of the agent.
§Returns
A reference to the agent’s position as a String
.
sourcefn get_state(&self) -> &AgentState
fn get_state(&self) -> &AgentState
Retrieves the current state of the agent.
§Returns
A reference to the agent’s current state as an AgentState
.
sourcefn get_memory(&self) -> &Vec<Message>
fn get_memory(&self) -> &Vec<Message>
Retrieves the memory of the agent, which contains logged messages or information.
§Returns
A reference to the agent’s memory as a Vec<Message>
.
Object Safety§
This trait is not object safe.