AFAPL2
From Agent Factory
Contents |
Overview
AFAPL2 is an extended version of the original Agent Factory Agent Programming Language (AFAPL) that combines the basic features of AFAPL:
- A model of Beliefs
- The notion of Commitment to a course of Action
- A set of Commitment Rules that define the situations in which the agent should adopt commitments
- A simple language for specifying Plans
With an additional set of features that have been motivated by the use of AFAPL in a number of Irish and European-funded research projects:
- Additional practical Plan operators
- A Role programming construct
- A notion of a Goal
- Support for specifying ontologies that the agent uses via an Ontology construct.
As is highlighted in the figure on the right-hand side, the language is based on a mental state model that consists of a number of primary mental attitudes together with a set of meta attitudes that support the primary mental attitudes. Further, the interface between the agent and its environment is implemented as a set of Java classes, together with a support class that enables the creation of internal private resources that can be used by the agent to implement any additional data structures that may be required.
Finally, as can be seen, the underlying environment is implemented as a combination of Platform Serivces; other external systems whose interfaces can either be accessed directly or alternatively via some Module; and any other agents deployed in the system.
This page provides an overview of concepts that underpin the AFAPL2 language, which is executed on a purpose-built agent interpreter. For information on how to use the language to develop agents, please read the AFAPL2 Programmers Guide.
Mental State Model
The mental state of an AFAPL2 agent consists of the following components:
- A Belief set: this component is used to build a model of the state of the agents environment.
- A Commitment set: this component is used to represent the decisions that the agent has made about how to act.
- A Plan Library: this component holds a set of pre-written plans that the agent may commit to.
- An Action set: this component holds the set of primitive activities that the agent may perform.
- A Commitment Rule set: this component holds a set of rules that encapsulate the decision-making process of the agent (i.e. in what situations the agent should make a Commitment to a given plan or action).
- A Role Library: this component holds a set of pre-written roles that the agent may play.
- An Ontology set: this component holds a set of ontologies that model the kinds of facts and objects that the agent can use to reason about its environment.
The Core Java Components
In addition to the mental components listed in the previous section, AFAPL2 also makes use of three Java components:
- Perceptors: These components implement the basic sensory apparatus of an agent, in that they are used to generate beliefs about the current state of the agent and its environment.
- Actuators: These components implement the basic capabilities of an agent. That is, they are implementations of the Actions of an agent.
- Modules: These components are private resources that can be used to implement additional data structures that an agent needs or to provide interfaces to external systems.
A Reuse Mechanism
AFAPL2 provides a simple mechanism for reusing code that is based on the #include statement of C, namely the IMPORT statement.
The AFAPL2 Interpreter
AFAPL2 agents function as a result of their mental state being manipulated by an underlying interpreter whose implementation is a variation on the basic execution cycle of a deliberative agent, namely:
perceive -> deliberate -> act
As can be seen in the diagram on the right-hand side, for AFAPL2, this basic cycle is implemented as a four-stage process:
In terms of the basic cycle, the perceive functionality is implemented as part of the belief update process, and the act functionality is implemented as part of the commitment management process (specifically, actions are performed in the commitment realisation phase of this process).
These steps are performed repeatedly, in the specified order, until the agent is terminated.
Further details of this algorithm can be found in relevant papers that are available from this website. Instead, this guide will focus on the practicalities of building agents using the AFAPL2 language.


