Decomposition of computation
A computation is decomposed into agents, which are responsible for performing a part of or the whole algorithm. Agents are structured into a tree with virtual root agent shown in the figure below according to algorithm decomposition. We assume that all agents at the same level are executed in parallel. To increase performance, the top level agents (called workplaces) along with all their children can be distributed amongst many nodes.
The platform introduces two types of agents: thread-based and simple. The former are realized as separate threads so that the parallel processing is managed by Java Virtual Machine (similarly to Jade platform). Such agents can communicate and interact with neighbors via asynchronous messages.
However, a large number of such agents would significantly decrease the efficiency of a computation due to frequent context switching. Therefore, the notion of simple agent was introduced. The concept of simple agent is based on steppable processing which is to simulate pseudo-parallel execution of agents' tasks. The following two phases are distinguished:
- The execution of tasks related to computation semantics in the
step()
method. In the case of an aggregate agent all of it's children perform their steps sequentially. While doing so, they can register various events, which may indicate actions to perform or communication messages, in the parent aggregate. - The processing of events registered in an event queue. Since events may be registered only in agents that possess children, this phase concerns only aggregate agents.
The described idea of processing ensures that during execution of computational tasks of agents co-existing at the same level in the structure (agents with the same parent), the hierarchy remains unmodified, thus the tasks may be carried out in any order. From the perspective of these agents, they are processed in parallel. All changes to the agent structure are made by aggregates during processing of the events indicating actions such as the addition of new agent, the migration of an agent, the killing of an already existing agent, etc. They are visible for agents while performing the next step.
The processing of a single agent can be seen as choosing and ordering actions to be performed. Execution can be further delegated according to Strategy design pattern. Strategies represent problem-dependent algorithm operators (mutation, evaluation of fitness, etc.) and may be exchanged without intruding agents' implementation. Operations can be executed by external resources, by providing proxies (according to Proxy design pattern).
Agent
Each agent has a unique system-wide address (GUID). The address is generated by an external service (see Addressing). Each agent also has a collection of named properties which can be monitored. Agents can communicate with each other using synchronous requests (asking for property values of individual agents or functions of some set of agents) or by exchanging asynchronously individually interpreted messages. In all cases, the range and possibilities of communication is defined by the parent agent, which acts as an intermediary in the transfer of queries and messages.
Due to possible implementations of concurrent processing there are two types of agents: light and heavy ones.
Light Agent
The concept of light agents was created to increase the effectiveness of communication mechanisms. It is based on a step-based processing and allows to run pseudo-parallel agents.
The above figure shows the sequence diagram of a parent agent having three child ones. There are two stages of processing:
- computational logic execution (
step
method) - A parent agent will usually sequentially delegate to its children, which in turn can execute custom logic or register events with their parent. These events may consist of actions, messages or queries. - event processing (
processEvents
method) - previously queued events are being processed. As only child agents can issue events, this stage happens only in parent agents.
Such a design ensures a constant structure of the agents tree during the processing of all operations, at a given tree level and at a given step. Thus, the execution order at a given tree level is irrelevant and all sibling agents see these operations as being parallel.
All requests to change that structure are queued at the parent agent as events. After the execution phase of all of its children, the parent agent processes these events, which can affect the structure of the agents tree. However, these changes will only be visible to child agents in the next processing step.
Heavy Agent
Heavy agents are implemented as threads, which parallel processing and synchronization mechanisms are provided by the JVM.
The above figure shows the lifecycle of a heavy agent.
After being created the agent goes into the STOPPED
state. It is then fully initialized and ready to perform the computation.
After being started, the agent goes into the RUNNING
state and begins the computation. In this state it may communicate with other agents.
If it receives a stop request (e.g. by satisfying the stop condition or before a migration), the agent goes into the STOPPING
state. Computation is continued until the completion of some current phase, then stopped, and the agents enters the STOPPED
state. All properties of the heavy agent (and its possible children) are saved ("frozen''), so the computation can be later resumed from the same exact point, simply by starting the agent again.
A heavy agent may only be removed from the system if it is in the STOPPED
state.
Workplace
Workplaces are special heavy agents that encompass a whole JVM process. They are the basic unit of a distributed AgE instance, as they might be migrated between multiple AgE nodes, running on separate JVM processes, possibly on different physical nodes.
TODO: more info
Agents environment
Local environment
Each agents executes in some local environment, which provides him with the following services:
- The possibility of registering an address - before starting, each agent has to register a unique address which allows it to be unambiguously addressed in the environment.
- The possibility of issuing queries about properties of other agents. These queries may have two possible scopes:
- sibling scope - applies to siblings of the querying agent.
- parent scope - applies to siblings of the querying agent's parent.
The parent agent play the role of a local environment for its children. Some services may be delegated upward in the tree, up to the external environment.
External Environment
The external environment provides agents with external services, such as:
- a name service - allowing to retrieve agents by their address
- a communication service - allowing to access other AgE nodes
- a notification service - informing about the stopping of some workplace.
The external environment may be extended to include additional services.
The role of the external environment (IWorkplaceEnvironment)
is played by the object managing Workplaces instances. This object (WorkplaceManager
) is a component of the AgE node.
Attachments:


