adf_core_python.core.agent.info package

目次

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)#

ベースクラス: object

get_change_set() ChangeSet#

Get the change set

戻り値:

Change set

戻り値の型:

ChangeSet

get_entity_id() EntityID#

Get the entity ID of the agent

戻り値:

Entity ID of the agent

戻り値の型:

EntityID

get_executed_action(time: int) Action | None#

Get the executed action at the given time

パラメータ:

time (int) -- Time

get_heard_commands() list[Command]#

Get the heard commands

戻り値:

Heard commands

戻り値の型:

list[Command]

get_myself() Entity#

Get the entity of the agent

戻り値:

Entity of the agent

戻り値の型:

Entity

get_position_entity_id() EntityID#

Get the position entity ID of the agent

戻り値:

Position entity ID of the agent

戻り値の型:

EntityID

get_think_time() float#

Get the time taken for thinking

戻り値:

Time taken for thinking

戻り値の型:

float

get_time() int#

Get the current time of the agent

戻り値:

Current time

戻り値の型:

int

record_think_start_time() None#

Record the start time of thinking

set_change_set(change_set: ChangeSet) None#

Set the change set

パラメータ:

change_set (ChangeSet) -- Change set

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

Set the executed action at the given time

パラメータ:
  • time (int) -- Time

  • action (Action) -- Executed action

set_heard_commands(heard_commands: list[Command]) None#

Set the heard commands

パラメータ:

heard_commands (list[Command]) -- Heard commands

set_time(time: int) None#

Set the current time of the agent

パラメータ:

time (int) -- Current time

some_one_on_board() Human | None#

Get the human if someone is on board

戻り値:

Human if someone is on board, None otherwise

戻り値の型:

Human | None

adf_core_python.core.agent.info.scenario_info module#

class adf_core_python.core.agent.info.scenario_info.Mode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

ベースクラス: IntEnum

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

ベースクラス: object

get_config() Config#

Get the configuration

戻り値:

Configuration

戻り値の型:

Config

get_mode() Mode#

Get the mode of the scenario

戻り値:

Mode of the scenario

戻り値の型:

Mode

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

Get the value of the configuration

パラメータ:
  • key (str) -- Key of the configuration

  • default (Any) -- Default value of the configuration

戻り値:

Value of the configuration

戻り値の型:

Any

set_config(config: Config) None#

Set the configuration

パラメータ:

config (Config) -- Configuration

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

ベースクラス: 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)#

ベースクラス: object

add_entity(entity: Entity) None#

Add the entity

パラメータ:

entity (Entity) -- Entity

get_blockades(area: Area) set[Blockade]#

Get the blockades in the area

戻り値:

Blockade

戻り値の型:

ChangeSet

get_change_set() ChangeSet#

Get the change set

戻り値:

Change set

戻り値の型:

ChangeSet

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

Get the distance between two entities

パラメータ:
  • entity_id1 (EntityID) -- Entity ID 1

  • entity_id2 (EntityID) -- Entity ID 2

戻り値:

Distance

戻り値の型:

float

例外:

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

パラメータ:

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

戻り値:

Entities

戻り値の型:

list[Entity]

get_entity(entity_id: EntityID) Entity | None#

Get the entity

パラメータ:

entity_id (EntityID) -- Entity ID

戻り値:

Entity

戻り値の型:

Optional[Entity]

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

Get the entity IDs of the specified types

パラメータ:

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

戻り値:

Entity IDs

戻り値の型:

list[EntityID]

get_entity_position(entity_id: EntityID) EntityID#

Get the entity position

パラメータ:

entity_id (EntityID) -- Entity ID

戻り値:

Entity position

戻り値の型:

EntityID

例外:

ValueError -- If the entity is invalid

get_world_model() WorldModel#

Get the world model

戻り値:

World model

戻り値の型:

WorldModel

set_change_set(change_set: ChangeSet) None#

Set the change set

パラメータ:

change_set (ChangeSet) -- Change set

Module contents#