adf_core_python.core.agent.info package

Contents

adf_core_python.core.agent.info package#

Submodules#

adf_core_python.core.agent.info.agent_info module#

class adf_core_python.core.agent.info.agent_info.AgentInfo(agent: Agent, world_model: WorldModel)#

Bases: object

get_change_set() ChangeSet#

Get the change set

Returns:

Change set

Return type:

ChangeSet

get_entity_id() EntityID#

Get the entity ID of the agent

Returns:

Entity ID of the agent

Return type:

EntityID

get_executed_action(time: int) Action | None#

Get the executed action at the given time

Parameters:

time (int) – Time

get_heard_commands() list[Command]#

Get the heard commands

Returns:

Heard commands

Return type:

list[Command]

get_myself() Entity | None#

Get the entity of the agent

Returns:

Entity of the agent

Return type:

Entity

get_position_entity_id() EntityID | None#

Get the position entity ID of the agent

Returns:

Position entity ID of the agent

Return type:

EntityID

get_think_time() float#

Get the time taken for thinking

Returns:

Time taken for thinking

Return type:

float

get_time() int#

Get the current time of the agent

Returns:

Current time

Return type:

int

record_think_start_time() None#

Record the start time of thinking

set_change_set(change_set: ChangeSet) None#

Set the change set

Parameters:

change_set (ChangeSet) – Change set

set_executed_action(time: int, action: Action) None#

Set the executed action at the given time

Parameters:
  • time (int) – Time

  • action (Action) – Executed action

set_heard_commands(heard_commands: list[Command]) None#

Set the heard commands

Parameters:

heard_commands (list[Command]) – Heard commands

set_time(time: int) None#

Set the current time of the agent

Parameters:

time (int) – Current time

some_one_on_board() Human | None#

Get the human if someone is on board

Returns:

Human if someone is on board, None otherwise

Return type:

Human | None

adf_core_python.core.agent.info.scenario_info module#

class adf_core_python.core.agent.info.scenario_info.Mode(*values)#

Bases: IntEnum

NON_PRECOMPUTE = 0#
PRECOMPUTATION = 2#
PRECOMPUTED = 1#
class adf_core_python.core.agent.info.scenario_info.ScenarioInfo(config: Config, mode: Mode)#

Bases: object

get_config() Config#

Get the configuration

Returns:

Configuration

Return type:

Config

get_mode() Mode#

Get the mode of the scenario

Returns:

Mode of the scenario

Return type:

Mode

get_value(key: str, default: T) T#

Get the value of the configuration

Parameters:
  • key (str) – Key of the configuration

  • default (Any) – Default value of the configuration

Returns:

Value of the configuration

Return type:

Any

set_config(config: Config) None#

Set the configuration

Parameters:

config (Config) – Configuration

class adf_core_python.core.agent.info.scenario_info.ScenarioInfoKeys#

Bases: object

CLEAR_REPAIR_DISTANCE = 'clear.repair.distance'#
CLEAR_REPAIR_RAD = 'clear.repair.rad'#
CLEAR_REPAIR_RATE = 'clear.repair.rate'#
COMMUNICATION_CHANNELS_COUNT = 'comms.channels.count'#
COMMUNICATION_CHANNELS_MAX_OFFICE = 'comms.channels.max.centre'#
COMMUNICATION_CHANNELS_MAX_PLATOON = 'comms.channels.max.platoon'#
FIRE_EXTINGUISH_MAX_DISTANCE = 'fire.extinguish.max-distance'#
FIRE_EXTINGUISH_MAX_SUM = 'fire.extinguish.max-sum'#
FIRE_TANK_MAXIMUM = 'fire.tank.maximum'#
FIRE_TANK_REFILL_HYDRANT_RATE = 'fire.tank.refill_hydrant_rate'#
FIRE_TANK_REFILL_RATE = 'fire.tank.refill_rate'#
KERNEL_AGENTS_IGNOREUNTIL = 'kernel.agents.ignoreuntil'#
KERNEL_AGENTS_THINK_TIME = 'kernel.agents.think-time'#
KERNEL_COMMUNICATION_MODEL = 'kernel.communication-model'#
KERNEL_HOST = 'kernel.host'#
KERNEL_PERCEPTION = 'kernel.perception'#
KERNEL_STARTUP_CONNECT_TIME = 'kernel.startup.connect-time'#
KERNEL_TIMESTEPS = 'kernel.timesteps'#
PERCEPTION_LOS_MAX_DISTANCE = 'perception.los.max-distance'#
PERCEPTION_LOS_PRECISION_DAMAGE = 'perception.los.precision.damage'#
PERCEPTION_LOS_PRECISION_HP = 'perception.los.precision.hp'#
SCENARIO_AGENTS_AC = 'scenario.agents.ac'#
SCENARIO_AGENTS_AT = 'scenario.agents.at'#
SCENARIO_AGENTS_FB = 'scenario.agents.fb'#
SCENARIO_AGENTS_FS = 'scenario.agents.fs'#
SCENARIO_AGENTS_PF = 'scenario.agents.pf'#
SCENARIO_AGENTS_PO = 'scenario.agents.po'#
VOICE_MESSAGES_SIZE = 'comms.channels.0.messages.size'#

adf_core_python.core.agent.info.world_info module#

class adf_core_python.core.agent.info.world_info.WorldInfo(world_model: WorldModel)#

Bases: object

add_entity(entity: Entity) None#

Add the entity

Parameters:

entity (Entity) – Entity

get_blockades(area: Area) set[Blockade]#

Get the blockades in the area

Returns:

Blockade

Return type:

ChangeSet

get_change_set() ChangeSet#

Get the change set

Returns:

Change set

Return type:

ChangeSet

get_distance(entity_id1: EntityID, entity_id2: EntityID) float#

Get the distance between two entities

Parameters:
  • entity_id1 (EntityID) – Entity ID 1

  • entity_id2 (EntityID) – Entity ID 2

Returns:

Distance

Return type:

float

Raises:

ValueError – If one or both entities are invalid or the location is invalid

get_entities_of_types(entity_types: list[type[Entity]]) list[Entity]#

Get the entities of the specified types

Parameters:

entity_types (list[type[Entity]]) – List of entity types

Returns:

Entities

Return type:

list[Entity]

get_entity(entity_id: EntityID) Entity | None#

Get the entity

Parameters:

entity_id (EntityID) – Entity ID

Returns:

Entity

Return type:

Optional[Entity]

get_entity_ids_of_types(entity_types: list[type[Entity]]) list[EntityID]#

Get the entity IDs of the specified types

Parameters:

entity_types (list[type[Entity]]) – List of entity types

Returns:

Entity IDs

Return type:

list[EntityID]

get_entity_position(entity_id: EntityID) EntityID | None#

Get the entity position

Parameters:

entity_id (EntityID) – Entity ID

Returns:

Entity position

Return type:

EntityID

Raises:

ValueError – If the entity is invalid

get_world_model() WorldModel#

Get the world model

Returns:

World model

Return type:

WorldModel

set_change_set(change_set: ChangeSet) None#

Set the change set

Parameters:

change_set (ChangeSet) – Change set

Module contents#