Menu

Command Palette

Search for a command to run...

Agent Controller

Interface for controlling an agent and interacting with the Aegis system.

Overview

The AgentController interface allows users to control and direct an agent’s actions. Through this interface, users can send commands to Aegis, influencing the agent's movements, interactions, and decision-making in the world. The controller enables agents to carry out specific tasks, such as rescuing survivors and navigating the environment.

Methods

get_energy_level()

Returns the current energy level of the agent.

Returns

int

The agent's current energy level.

Example:

energy = self._agent.get_energy_level()
print(energy)
# Output: 326

get_location()

Returns the current location of the agent.

Returns

Location

The agent's current location in the world.

Example:

loc = self._agent.get_location()
print(loc)
# Output: (2, 5)

get_round_number()

Returns the current round number of the simulation.

Returns

int

The current round number of the simulation.

Example:

round = self._agent.get_round_number()
print(round)
# Output: 27

send()

Sends an action command to the Aegis system.

Parameters

agent_actionAgentCommandrequired

The action command that specifies what the agent should do.

Example:

# Sending a command to save a survivor
self._agent.send(SAVE_SURV())

log()

Logs a message, including the agent's ID and the current round number, for tracking or debugging purposes.

Parameters

messagestrrequired

The message to log.

Example:

# Logging a message on round 4 for agent 1 in group 1
self._agent.log(f"My location is {self._agent.get_location()}")
# Output: [Agent#(1:1)]@4: My location is (17, 15)