Communication
gradysim.protocol.messages.communication
This file contains definitions for the communication commands. These commands are sent to the communication module to instruct it to perform some communication action, generally sending a message to another node.
CommunicationCommand
dataclass
Represents a communication command. Communication commands are sent to the communication module to instruct it to perform some communication action, generally sending a message to another node.
Source code in gradysim/protocol/messages/communication.py
command_type: CommunicationCommandType
instance-attribute
The type of the communication command
destination: Optional[int] = None
class-attribute
instance-attribute
The destination node ID. It's not necessary for a broadcast message
message: str
instance-attribute
The message to send
CommunicationCommandType
Bases: int
, Enum
Enum that defines the types of communication commands
Source code in gradysim/protocol/messages/communication.py
BROADCAST = 1
class-attribute
instance-attribute
Send a message to all nodes
SEND = 0
class-attribute
instance-attribute
Send a message to a specific node