-
Notifications
You must be signed in to change notification settings - Fork 36
Server Communication
#Server Communication
The Power TAC competition is designed as an event driven, competitive simulation. Two kinds of events drive activity:
- One is the passage of time -- the simulation clock (org.powertac.common.TimeService) maintains a queue of "actions" that will be triggered at specific times. Any object can post an action to be triggered in the future, and actions can re-enter themselves in the queue for later times, leading to repeating events. This type of activity is, of course, restricted to a single process context.
- The other is message arrival, where the activity of one actor (say Broker Bob) results in a message being created and sent, which may be received by other entities (say a response of one of Broker Bob's customers) who may then act on the received message. This is the mechanism by which distributed portions of the system interact (Brokers and the Server, for example), and may also be used for some intra-Server communications.
In support of message-driven interaction, the Power TAC server offers a messaging framework that supports light-weight, event-driven interaction between the different core entitites of Power TAC. As shown in the figure below, two different entitites (called endpoints) are connected via message channels which allow them to exchange messages.
A message is a generic wrapper for any Java object combined with metadata used by the framework while handling that object. It consists of a payload and headers. The payload can be of any type and the headers hold commonly required information such as id, timestamp, correlation id, or return address. By convention, in Power TAC message payloads are either command objects or lists of command objects, where a command object is a simple Java Bean that contains all information required for the interaction between two Power TAC entities (say a broker and a customer).
Note that messages can be sent between the broker agents and the Power TAC server but also within the server only.
In the following sections all communication flows defined between brokers and server as well as within the server are described in detail.
For consistency we try to maintain the Naming conventions for communication channels.