Message Types
In PDES-MAS, communication between LPs are designed to use Message
. The messages have two categories: ControlMessage
and SimulationMessage
.
ControlMessage
is used to control the simulation process, thus has higher priority and is sent from LP to LP in a separate message queue.
SimulationMessage
is where the data exchange between agents and environments lives in. It could either be a request message, a response message
or a anti message which is for reverting changes after a roll-back.
class AbstractMessage
This is the Abstract Base Class (ABC) from which all other message classes inherit. It defines some standard members which all messages contain. It also specifies two purely virtual methods send and receive which are defined in the three child classes. Each message sub class must also implement the CompareTo
method.
class AntiMessage
Base class for all anti message classes.
class ControlMessage
Base class for all control message classes.
A control message is NOT blocked by windows and its timestamp is NOT considered in GVT calculation.
class EndMessage
End message for an ALP.
This is the EndMessage class used to indicate an agent has finished sending it's messages. This message has special routing, whereby it is routed through all ports except the one it came from. This is used by the shutdown procedure.
The shutdown procedure uses GVT for the termination condition, the simulation is given a set end_time and when GVT=end_time the simulation can be safely terminated. Here, as in the previous approach each LP sends a termination message with a time-stamp = end_time of the simulation(NOTE end_time is usually set to time of last event plus one). This message must be broadcast to all CLPs (Not ALPs) in the system so as to update their LVT. After sending the termination message the ALP instigates a GVT calculation to determine the new GVT value. When the first agent does this GVT != end_time, although the LVT of the terminating agent = end_time and the LVT of all the CLPs = end_time, the LVT of all the other ALPs != end_time as none have sent their termination message.
Using GVT in this way resolves the problem of transient messages as the GVT algorithm accounts for this.
When all ALPs have sent their termination message the root CLP must periodically instigate gvt calculation. Once all transient messages have arrived and GVT is calculated as end_time it is safe to terminate.
class GvtControlMessage
Messages sent to each LP to decide their Mattern color, in order to do the GTV algorithm.
class GvtMessage
Base class for all GVT-related messages.
class GvtRequestMessage
Message sent by ALPs to initiate a GVT calculation.
class GvtValueMessage
Message reporting final negotiated GVT value back to each LP.
class LoadBalancingMessage
Originally designed to control load balancing between CLPs. Now replaced by StateMigrationMessage
.
class RangeQueryAntiMessage
Anti message for range queries.
class RangeQueryMessage
Message to perform range queries, or contains the response of a range query.
class RangeUpdateMessage
Message to notify CLPs about range updates, typically after a variable has been changed, or when rollback and/or state migration happens.
class ResponseMessage
Base class of all response message classes A mixin class to distinguish all types of response message which is inherited from Simulation message
class RollbackMessage
Class which implements messages for rollback
This is the class that implements the rollback message. It has a rollback Tag to identify the origin of a rollback (used to prevent the same LP from rolling back twice as a result of the same straggler). Rollback messages are generated by Clps, whereas anti-messages are generated by Alps.
class SharedStateMessage
Description: This is an abstract base class which all messages operating on the shared state inherit from. These messages are: - ReadMessage - WriteMessage - AddMessage - DelMessage
This class adds the virtual method GenerateAntiMessage
, which generates an equivalent AntiMessage from the normal non-anti-message
class SimulationMessage
Base class for all simulation message classes. Simulation message are blocked by windows and its timestamp is considered in GVT calculation.
class SingleReadAntiMessage
Anti message for single variable reads.
class SingleReadMessage
Class for reading a single SSV
An instance of SingleReadMessage defines a message for an ALP reading the value of an individual Shared State Variable.
class SingleReadResponseMessage
Response of reading a single SSV.
class StateMigrationMessage
Message controls the migration of state variables between CLPs. Contain the variables to be migrated (maybe a empty list).
class WriteAntiMessage
Anti message for updating a single SSV.
class WriteMessage
Class for updating a single SSV.
An instance of SingleReadMessage defines a message for an ALP updating the value of an individual Shared State Variable. A successful update will create a new write period at the destination CLP
class WriteResponseMessage
Response message for variable writes.