adf_core_python.core.agent.communication package#

Subpackages#

Submodules#

adf_core_python.core.agent.communication.message_manager module#

class adf_core_python.core.agent.communication.message_manager.MessageManager#

ベースクラス: object

MAX_MESSAGE_CLASS_COUNT = 32#
add_heard_agent_help_message_count() None#

Add the heard agent help message count.

add_message(message: CommunicationMessage, check_duplicate: bool = True) None#

Add the message.

パラメータ:

message (CommunicationMessage) -- The message.

add_received_message(message: CommunicationMessage) None#

Add the received message.

パラメータ:

message (CommunicationMessage) -- The received message.

coordinate_message(agent_info: AgentInfo, world_info: WorldInfo, scenario_info: ScenarioInfo) None#

Coordinate the message.

パラメータ:
get_channel_send_message_list() list[list[CommunicationMessage]]#

Get the channel send message list.

戻り値:

The channel send message list.

戻り値の型:

list[list[CommunicationMessage]]

get_channel_subscriber() ChannelSubscriber#

Get the channel subscriber.

戻り値:

The channel subscriber.

戻り値の型:

ChannelSubscriber

get_heard_agent_help_message_count() int#

Get the heard agent help message count.

戻り値:

The heard agent help message count.

戻り値の型:

int

get_is_subscribed() bool#

Get the flag to indicate if the agent is subscribed to the channel.

戻り値:

The flag to indicate if the agent is subscribed to the channel.

戻り値の型:

bool

get_message_class(index: int) type[CommunicationMessage]#

Get the message class.

パラメータ:

index (int) -- The index.

戻り値:

The message class.

戻り値の型:

type[CommunicationMessage]

get_message_class_index(message_class: type[CommunicationMessage]) int#

Get the message class index.

パラメータ:

message_class (type[CommunicationMessage]) -- The message class.

戻り値:

The message class index.

戻り値の型:

int

get_received_message_list() list[CommunicationMessage]#

Get the received message list.

戻り値:

The received message list.

戻り値の型:

list[CommunicationMessage]

get_send_message_list() list[CommunicationMessage]#

Get the send message list.

戻り値:

The send message list.

戻り値の型:

list[CommunicationMessage]

get_subscribed_channels() list[int]#

Get the subscribed channels.

戻り値:

The subscribed channels.

戻り値の型:

list[int]

refresh() None#

Refresh the message manager.

register_message_class(index: int, message_class: type[CommunicationMessage]) None#

Register the message class.

パラメータ:

message_class (type[CommunicationMessage]) -- The message class.

set_channel_subscriber(channel_subscriber: ChannelSubscriber) None#

Set the channel subscriber.

パラメータ:

channel_subscriber (ChannelSubscriber) -- The channel subscriber.

set_is_subscribed(is_subscribed: bool) None#

Set the flag to indicate if the agent is subscribed to the channel.

パラメータ:

is_subscribed (bool) -- The flag to indicate if the agent is subscribed to the channel.

set_message_coordinator(message_coordinator: MessageCoordinator) None#

Set the message coordinator.

パラメータ:

message_coordinator (MessageCoordinator) -- The message coordinator.

set_subscribed_channels(subscribed_channels: list[int]) None#

Set the subscribed channels.

パラメータ:

subscribed_channels (list[int]) -- The subscribed channels.

subscribe(agent_info: AgentInfo, world_info: WorldInfo, scenario_info: ScenarioInfo) None#

Subscribe to the channel.

パラメータ:
  • agent_info (AgentInfo) -- The agent info.

  • world_info (WorldInfo) -- The world info.

  • scenario_info (ScenarioInfo) -- The scenario info.

  • Throws

  • ------

  • ValueError -- If the ChannelSubscriber is not set.

Module contents#