adf_core_python.core.agent.communication package#
Subpackages#
- adf_core_python.core.agent.communication.standard package
Submodules#
adf_core_python.core.agent.communication.message_manager module#
- class adf_core_python.core.agent.communication.message_manager.MessageManager#
Bases:
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.
- Parameters:
message (CommunicationMessage) – The message.
- add_received_message(message: CommunicationMessage) None #
Add the received message.
- Parameters:
message (CommunicationMessage) – The received message.
- coordinate_message(agent_info: AgentInfo, world_info: WorldInfo, scenario_info: ScenarioInfo) None #
Coordinate the message.
- Parameters:
agent_info (AgentInfo) – The agent info.
world_info (WorldInfo) – The world info.
scenario_info (ScenarioInfo) – The scenario info.
- get_channel_send_message_list() list[list[CommunicationMessage]] #
Get the channel send message list.
- Returns:
The channel send message list.
- Return type:
list[list[CommunicationMessage]]
- get_channel_subscriber() ChannelSubscriber #
Get the channel subscriber.
- Returns:
The channel subscriber.
- Return type:
- get_heard_agent_help_message_count() int #
Get the heard agent help message count.
- Returns:
The heard agent help message count.
- Return type:
int
- get_is_subscribed() bool #
Get the flag to indicate if the agent is subscribed to the channel.
- Returns:
The flag to indicate if the agent is subscribed to the channel.
- Return type:
bool
- get_message_class(index: int) type[CommunicationMessage] #
Get the message class.
- Parameters:
index (int) – The index.
- Returns:
The message class.
- Return type:
type[CommunicationMessage]
- get_message_class_index(message_class: type[CommunicationMessage]) int #
Get the message class index.
- Parameters:
message_class (type[CommunicationMessage]) – The message class.
- Returns:
The message class index.
- Return type:
int
- get_received_message_list() list[CommunicationMessage] #
Get the received message list.
- Returns:
The received message list.
- Return type:
list[CommunicationMessage]
- get_send_message_list() list[CommunicationMessage] #
Get the send message list.
- Returns:
The send message list.
- Return type:
list[CommunicationMessage]
- get_subscribed_channels() list[int] #
Get the subscribed channels.
- Returns:
The subscribed channels.
- Return type:
list[int]
- refresh() None #
Refresh the message manager.
- register_message_class(index: int, message_class: type[CommunicationMessage]) None #
Register the message class.
- Parameters:
message_class (type[CommunicationMessage]) – The message class.
- set_channel_subscriber(channel_subscriber: ChannelSubscriber) None #
Set the channel subscriber.
- Parameters:
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.
- Parameters:
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.
- Parameters:
message_coordinator (MessageCoordinator) – The message coordinator.
- set_subscribed_channels(subscribed_channels: list[int]) None #
Set the subscribed channels.
- Parameters:
subscribed_channels (list[int]) – The subscribed channels.
- subscribe(agent_info: AgentInfo, world_info: WorldInfo, scenario_info: ScenarioInfo) None #
Subscribe to the channel.
- Parameters:
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.