Chapter 5. Coalescing Agent State Monitoring in Hive

Table of Contents
Problems with individual agent-level state maintainence
Implementation of the AgentMonitoringAgent

Different agents may be simultaneously attempting to keep track of the state of agents on other cells. Instead of requiring each agent author to maintain the state himself (a difficult and memory/bandwidth consuming process), it may be easier to integrate these actions into a single server agent on the Hive cell and allow other agents to query this information.

Problems with individual agent-level state maintainence

If an agent needs to monitor another group of agents on a particular cell, the agent itself needs to get a list of all the agents on that cell, and then the agent itself needs to monitor the event stream from the ServerEventInfoAgent and use that to update its internal state representation. From a preliminary glance, this strategy may look acceptable, however there are a few subtle problems:

By either creating a new ServerAgent or by augmenting an already existing one, these problems can be eliminated. There can be one community accessible service that will monitor and "cache" the state of agents on other cells thereby reducing the complexity of agent authoring, reducing the amount of Hive cell memory usage, and reducing the amount of bandwidth needed to keep the state consistent.