Action

From Agent Factory

Jump to: navigation, search

Contents

Editorial History

19/12/08 (Version 1): Fixed up structure of page

Overview

Actions represent the primitive capabilities of mental agents, such as those supported via the AFAPL and AFAPL2 agnet programming languages. That is, they specify the most basic activities that are directly executable by an agent. As such, action definitions are split into two parts:

  • Some form of agent programming language construct that associates primitive actions with specific agents.
  • Actuator units, written in Java, implement those primitive actions.

Declaring actions in AFAPL

In AFAPL actions are declared by listing the Actuator units that are available to the agent. This is done via the ACTUATOR keyword. For example, to declare that an agent has the ability to kick a ball, the following statement may be added:

 ACTUATOR soccer.actuator.KickBall;

Declaring Actions in AFAPL2

In AFAPL2, the definition of the actions that an agent can perform has been made more explicit. That is, AFAPL2 allows you to declare the name of the action, the pre-conditions that must be satisfied for the action to be successful, the expected effect (post-conditions) of those actions on the state of the environment, and finally, the Actuator that implements the action. Thus, the equivalent action declaration for an AFAPL2 agent that can kick a ball would take the form:

 ACTION kickBall {
   PRECONDITION BELIEF(has(ball));
   POSTCONDITION !BELIEF(has(ball));
 
   CLASS soccer.actuator.KickBall;
 }

Invoking Actions

In AFAPL and AFAPL2 the agent must adopt a Commitment to the Action before it can be performed.