JACK Intelligent Agents® Agent Manual
Total Page:16
File Type:pdf, Size:1020Kb
JACK Intelligent Agents® Agent Manual Agent Manual Copyright Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. All rights reserved. No part of this document may be reproduced, transferred, sold, or otherwise disposed of, without the written permission of the owner. US Government Restricted Rights The JACK™ Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable. Trademarks All the trademarks mentioned in this document are the property of their respective owners. Agent Manual Release 5.3 2 10-June-05 Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. Publisher Information Agent Oriented Software Pty. Ltd. P.O. Box 639, Carlton South, Victoria, 3053 AUSTRALIA Phone: +61 3 9349 5055 Fax: +61 3 9349 5088 Web: http://www.agent-software.com If you find any errors in this document or would like to suggest improvements, please let us know. Agent Manual Release 5.3 10-June-05 3 Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. The JACK™ documentation set includes the following manuals and practicals: Document Description Agent Manual Describes the JACK programming language and infrastructure. JACK can be used to develop applications involving BDI agents. Teams Manual Describes the JACK Teams programming language extensions. JACK Teams can be used to develop applications that involve coordinated activity among teams of agents. Development Environment Describes how to use the JACK Development Manual Environment (JDE). The JDE is a graphical development environment that can be used to develop JACK agent and team-based applications. JACOB Manual Describes how to use JACOB. JACOB is an object modelling language that can be used for inter-process transport and object initialisation. WebBot Manual Describes how to use the JACK WebBot to develop JACK enabled web applications. Design Tool Manual Describes how to use the Design Tool to design and build an application within the JACK Development Environment. Graphical Plan Editor Manual Describes how to use the Graphical Plan Editor to develop graphical plans within the JACK Development Environment. JACK Sim Manual Describes how to use the JACK Sim framework for building and running repeatable agent simulations. Tracing and Logging Manual Describes the tracing and logging tools available with JACK. Agent Practicals A set of practicals designed to introduce the basic concepts involved in JACK programming. Teams Practicals A set of practicals designed to introduce the basic concepts involved in Teams programming. Agent Manual Release 5.3 4 10-June-05 Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. Table of Contents 1 Introduction . 13 1.1 Background . .13 1.2 Agent Oriented Concepts. .13 1.2.1 What is an Agent? . .14 1.2.2 Why program using Agents? . .15 1.3 The Components of JACK . .15 1.3.1 The JACK Agent Language . .15 1.3.2 The JACK Agent Compiler . .16 1.3.3 The JACK Agent Kernel . .16 1.4 Developing a JACK Application . .16 1.4.1 Setting up your Environment . .16 1.4.2 Source Code Creation . .17 1.4.3 Compilation . .18 1.4.4 Running a JACK Application . .18 1.4.5 Debugging a JACK Application . .19 2 JACK Agent Language Overview . 21 2.1 The JACK Agent Language . .21 2.1.1 Class, Interface and Method Extensions . .21 2.1.2 Syntactic Extensions . .22 2.1.3 Semantic Extensions . .23 2.2 JACK Agent Language Summary . .24 2.2.1 JACK Agent Language Classes . .25 2.2.2 JACK Agent Language Declarations (#-Declarations) . .26 2.2.3 Reasoning Method Statements (@-Statements) . .29 2.2.4 Base Members and Methods . .30 Agent Members . .30 Agent Methods . .30 Event Members . .32 Event Methods (for MessageEvents only) . .32 Plan Members . .32 Plan Methods . .33 BeliefSet Methods . .33 Capability Methods. .34 3 Agents . 35 3.1 Introduction. .35 3.2 Agent Definition . .35 3.3 Agents and Interfaces . .36 3.4 Agent Declarations. .36 Agent Manual Release 5.3 10-June-05 5 Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. #handles event EventType . .37 #posts event EventType [reference] . 38 #sends event EventType [reference] . 39 #uses plan PlanName . .40 #has capability CapabilityType reference . .40 3.4.1 Beliefsets . .41 Conceptual Model. .41 Beliefset Declarations. .41 3.4.2 Data stored in User-defined Data Structures . .45 #private data DataType data_name(arg_list). 45 #agent data DataType data_name(arg_list). 46 #global data DataType data_name(arg_list) . 47 3.4.3 Task Managers . .47 #uses taskManager SimpleRRTaskManager(<steps>) . 48 3.5 Agent Members and Methods . .49 Agent Construction . 50 Agent Termination . 50 void postEvent(Event e ) . 50 boolean postEventAndWait(Event e) . 51 void send(String s, MessageEvent e) . 51 void reply(MessageEvent q, MessageEvent r) . 51 String name() . 52 Timer timer . 52 4 Capabilities . 53 4.1 Introduction. .53 4.2 Capability Definition . .53 4.3 Capabilities and Interfaces . .54 4.4 Capability Declarations. .55 #handles event EventType; . 56 #handles external [event] EventType; . 56 #posts event EventType reference; . 56 #posts external [event] EventType reference; . 56 #sends event EventType reference; . 57 #private data DataType data_name(arg_list); . 57 #agent data DataType data_name(arg_list); . 57 #global data DataType data_name(arg_list); . 57 #exports data DataType data_name(arg_list); . 57 #imports data DataType data_name(); . 58 #uses plan PlanType; . 58 #has capability CapabilityType reference;. 58 4.5 Capability Members and Methods . .58 Agent Manual Release 5.3 6 10-June-05 Copyright © 1999-2012, Agent Oriented Software Pty. Ltd. Capability Construction . .58 public void postEvent(Event e) . 59 public Agent getAgent() . 59 protected void autorun() . 59 5 Events . 61 5.1 What are Events?. .61 5.2 Normal Events . ..