Previous topic

4. Agents - Things that actually do something

Next topic

4.2. Interface

This Page

4.1. OverviewΒΆ

../_images/agentview.jpg ../_images/daemon.png

Every node has a daemon running with a series of agents on it. These agents are each executed in their own thread or process. They are provided with a defined interface with which to send and receive messages to other object in the experiment. The dispatch code of the daemon will dispatch the message to the agent based on the type value of the MAGIMessage. The format of the message data is then up to the agent itself.

In the previous iteration of the MAGI backend, agents extended from one of the addon classes (Agent, Collector, etc) and relied on the base class for most of their behavior. However, this didn’t allow enough flexibility. The original code was based on using a limited messaging system with small messages. The agents are now free to except any message data they wish. We are not throwing away the support code, however. Rather, it is provided as libraries for the agent code to pick and choose from.

For the core agents provided with MAGI, a defined structure is specified for making RPC calls to the agents. Each agent can also provide an interface definition file so that it may be used by the graphical experiment tools.