2APL A Practical Agent Programming Language March 6, 2007 Cathy Yen.

Slides:



Advertisements
Similar presentations
Network II.5 simulator ..
Advertisements

Modelling uncertainty in 3APL Johan Kwisthout Master Thesis
Crucial Patterns in Service- Oriented Architecture Jaroslav Král, Michal Žemlička Charles University, Prague.
Formal Semantics for an Abstract Agent Programming Language K.V. Hindriks, Ch. Mayer et al. Lecture Notes In Computer Science, Vol. 1365, 1997
Component Oriented Programming 1 Chapter 2 Theory of Components.
Use Case & Use Case Diagram
The Web Warrior Guide to Web Design Technologies
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Rheeve: A Plug-n-Play Peer- to-Peer Computing Platform Wang-kee Poon and Jiannong Cao Department of Computing, The Hong Kong Polytechnic University ICDCSW.
Agent Mediated Grid Services in e-Learning Chun Yan, Miao School of Computer Engineering Nanyang Technological University (NTU) Singapore April,
JACK Intelligent Agents and Applications Hitesh Bhambhani CSE 6362, SPRING 2003 Dr. Lawrence B. Holder.
Implementation of MAS issues M. Birna van Riemsdijk ProMAS TFG 2005.
University of Jyväskylä An Observation Framework for Multi-Agent Systems Joonas Kesäniemi, Artem Katasonov * and Vagan Terziyan University of Jyväskylä,
1 Trust Management and Theory Revision Ji Ma School of Computer and Information Science University of South Australia 24th September 2004, presented at.
Proof System HY-566. Proof layer Next layer of SW is logic and proof layers. – allow the user to state any logical principles, – computer can to infer.
Communication in Distributed Systems –Part 2
JDBC. In This Class We Will Cover: What SQL is What ODBC is What JDBC is JDBC basics Introduction to advanced JDBC topics.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
1 Case Study: Starting the Student Registration System Chapter 3.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
Introduction to Jadex programming Reza Saeedi
Why Analysis Process Refer to earlier chapters Models what the system will do makes it easier for understanding no environment considered (hence, system.
Microsoft Visual Basic 2005: Reloaded Second Edition
1 CSE 2102 CSE 2102 CSE 2102: Introduction to Software Engineering Ch9: Software Engineering Tools and Environments.
Firewall and Internet Access Mechanism that control (1)Internet access, (2)Handle the problem of screening a particular network or an organization from.
Using Visual Basic 6.0 to Create Web-Based Database Applications
COMP 410 & Sky.NET May 2 nd, What is COMP 410? Forming an independent company The customer The planning Learning teamwork.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 09. Review Introduction to architectural styles Distributed architectures – Client Server Architecture – Multi-tier.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
Introduction to AgentSpeak and Jason for Programming Multi-agent Systems (1) Dr Fuhua (Oscar) Lin SCIS Athabasca University June 19, 2009.
Chapter 14 Part II: Architectural Adaptation BY: AARON MCKAY.
Oracle Data Integrator Procedures, Advanced Workflows.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
A Multi-agent Approach for the Integration of the Graphical and Intelligent Components of a Virtual Environment Rui Prada INESC-ID.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Mas Simon Lynch intro the basics agent types small scale (eg: NetLogo) generic (eg: Jade, Boris…) BDI (2APL, Jason, Goal…) (BOID,
Agents, Multi-Agent Systems and Declarative Programming: What, When, Where, Why, Who, How? Andrew Diniz da Costa –
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
October 27, 2006 BDI Agents and AgentSpeak(L) Romelia Plesa PhD Candidate SITE, University of Ottawa.
ECI – electronic Commerce Infrastructure “ An application to the Shares Market ” Demetris Zeinalipour ( Melinos Kyriacou
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
L. M. Pereira, J. J. Alferes, J. A. Leite Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal P. Dell’Acqua Dept. of Science.
ECE 353 Lab 2 Pipeline Simulator. Aims Further experience in C programming Handling strings Further experience in the use of assertions Reinforce concepts.
EEL 5937 Agent communication EEL 5937 Multi Agent Systems Lotzi Bölöni.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
G.v. Bochmann, revised Jan Comm Systems Arch 1 Different system architectures Object-oriented architecture (only objects, no particular structure)
UML - Development Process 1 Software Development Process Using UML.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
THE EYESWEB PLATFORM - GDE The EyesWeb XMI multimodal platform GDE 5 March 2015.
MTA SZTAKI Department of Distributed Systems Hogyan mixeljünk össze webszolgáltatásokat, ontológiákat és ágenseket? Micsik András.
From NARS to a Thinking Machine Pei Wang Temple University.
Software Architecture for Multimodal Interactive Systems : Voice-enabled Graphical Notebook.
Software Design and Development Languages and Environments Computing Science.
TTCN-3 Testing and Test Control Notation Version 3.
Software, IEE Proceedings, Vol.152, Num.3, June 2005,Page(s): Prasanthi.S March, Java-based component framework for dynamic reconfiguration.
1 Team Skill 3 Defining the System Part 1: Use Case Modeling Noureddine Abbadeni Al-Ain University of Science and Technology College of Engineering and.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Extending Model-Driven Engineering in Tango
Object-Oriented Analysis and Design
SysML v2 Formalism: Requirements & Benefits
Unified Modeling Language
Ch > 28.4.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Computer Programming.
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Using Use Case Diagrams
Mas Simon Lynch
Presentation transcript:

2APL A Practical Agent Programming Language March 6, 2007 Cathy Yen

Introduction 3APL (triple-a-p-l)  An Abstract Agent Programming Language  3APL project was carried out by the Intelligent Systems Group at Utrecht University, the Netherlands  it is used for implementing cognitive agents and multi-agent systems.  It provides programming constructs to implement agents in terms of beliefs, goals, plans, actions, and practical reasoning rules.  3apl program is executed by an interpreter in Java  it makes use of an embedded Prolog reasoning engine.  Intended to bridge the gap between agent theory and agent programming

3APL Architecture

3APL Modules belief base  implemented by a subset of first-order predicate language (prolog like facts and rules) goal base  Implemented by expressions of an imperative language ( procedural or to-do goals) plan base  built from basic actions composed through program operators sequential “;”, iteration “while-do”, conditional “if-then-else” action base (capabilities)  Implemented as triplets consisting of action name together with pre- condition (under which action can be performed) and post-conditions (effect of the action after it’s performed). goal plan rules  Revision blocked actions, not achievable goals, generation/optimize goals plan revision rules – used to revise, adopt, and drop plans Interpreter - implementing the Deliberation process  Applying reasoning rules, selecting goals and actions

Introducing 2APL 2APL (double-a-p-l)  A Practical Agent Programming Language  2APL is designed and developed at the Intelligent Systems Group at the University of Utrecht.  2APL is the successor of 3APL  2APL interpreter is built on the JADE platform.  It provides practical extensions with constructs that makes it easier to program in and debug Testing, different execution modes, event and exception handling mechanism Supports the integration of declarative concepts (belief, goals) with imperative style programming (events, plans) Aims at improving the practical application of BDI agent programming language.

The 2APL Language Specification in EBNF notation  denotes a Prolog like atomic formula starting with lowercase letter   denotes a string  denotes a string starting with capital letter  denotes a grounded atomic formula  with “?” is a syntactic entity of the 2APL language

2APL Language Specification

The 2APL Language Composed of various ingredients  Specify different aspects of the agency  Programmed with initial state of ingredients  Some ingredient change during the execution Beliefs and goals Basic actions Plans Reasoning rules The deliberation cycle

Beliefs and goals The implementation of the initial belief base starts with the keyword ’Beliefs:’ followed by one or more belief expressions of the form. the agent believes that there is a bomb at location (3; 4), and that the blockworld environment is clean if there are no bombs anymore and the agent is not carrying a bomb.

Beliefs and goals The goals of a 2APL agent are implemented by its goal base, which consists of formulas each of which denotes a situation the agent wants to realize. The implementation of the initial goal base starts with the keyword ’Goals:’ followed by a list of goal expressions of the form. This goal base indicates that the agent wants to achieve a desirable situation in which the blockworld is clean.

Basic actions In order to achieve its goals, a 2APL agent needs to act. Basic actions specify the capabilities that an agent can perform to achieve its desirable situation. There are six types of basic actions are distinguished:  Belief Update Action : actions to update the belief base  Communication actions  External actions  Abstract actions  Belief and Goal Test Actions : actions to test the belief and goal bases  Goal Dynamics Actions : actions to manage the dynamics of goals.

Basic actions – Belief Update Action A belief update action updates the belief base of an agent when executed. An agent can execute a belief update action if the pre-condition of the action is derivable from its belief base. belief update actions starts with the keyword ’Beliefupdates: an agent can remove a bomb if it is the same location as the bomb the PickUp() indicates that this belief update action can be performed if the agent does not already carry a bomb and that after performing this action the agent will carry a bomb.

Basic actions – Communication Action A communication action passes a message to another agent One version of the communication action is the expression : Send(Receiver, Performative, Content).  Receiver referring to the receiving agent, Performative is a speech act name (e.g. inform, request, etc.), and Content is an expression representing the content of the message. An example of a communication action is sally informing harry about a bomb location

Basic actions – External Action An external action is supposed to change the external environment in which the agents operate. The effects of external actions are assumed to be determined by the environment and might not be known to the agents The external environment determines the effect of the action an expression of the form Java(Env,ActionName,Return,Time-out)  The parameter Env is the name of the agent’s environment to which it has access, implemented as a Java class.  The parameter ActionName is a method call (of the Java class) that specifies the effect of the external action in the environment. Java(blockworld, east(),_,2).  This action causes an agent to go one step to the east in the blockworld environment.

Basic actions – Belief and Goal Test Action A belief test action is to test whether a belief expression is derivable from an agent’s belief base  it tests whether the agent has a certain belief. A goal test action is to test whether a formula is derivable from the goal base  whether the agent has a certain goal from which the formula is derivable  For example, if an agent has a goal p(a) and q(b), then the goal test action p(X)! succeeds resulting in the substitution [X/a].

Basic actions – Goal Dynamics Action The adopt goal and drop goal actions are used to adopt and drop a goal to and from the agent’s goal base, respectively.  The adopt goal action can have two different forms: adopta(Ф) and adoptz(Ф).  the drop goal action can have three different forms: dropGoal(Ф), dropSubGoal(Ф), and dropExactGoal(Ф).

Plans 2APL agent adapt plans in order to achieve its goals. Like 3APL, A plan consists of basic actions composed by process operators. Harry enters the blockworld by performing an external action enter. The plans of a 2APL agent are implemented by its plan base. The implementation of the initial plan base starts with the keyword ’Plans:’ followed by a list of plans.

Reasoning Rules The 2APL programming language provides constructs to implement practical reasoning rules that can be used to implement the generation of plans. Three types of practical reasoning rules are proposed:  planning goal rules,  procedural rules, and  plan repair rules.

Reasoning Rules – Planning Goal Rules A planning goal rule can specifies that an agent should generate a plan if it has certain goals and beliefs. A planning goal rule of an agent can be applied when the goal and belief expressions are derivable from the agent’s goal and the belief bases, respectively. A planning goal rule is of the form:  ? " “|"

Reasoning Rules – Planning Goal Rules a plan to achieve the goal clean(blockWorld) can be generated if the agent believes there is a bomb at position (X,Y).

Reasoning Rules – Procedural Rules Procedural rules generate plans as a response to  the reception of messages sent by other agents,  events generated by the external environment, and  the execution of abstract actions like planning goal rules, a procedural rule has a belief condition indicating when a received event should cause the generation of a plan. a procedural rule can be applied if the agent has received an event and the belief query of the rule is derivable from its belief base.

Reasoning Rules – Procedural Rules This rule indicates that if harry receives a message from sally informing him that there is a bomb at position (X,Y) and harry does not believe there are any bombs, then harry updates his beliefs with this new fact and adds a goal to clean the blockworld again.

Reasoning Rules – Plan Repair Rules A plan repair rule indicates that if the execution of an agent’s plan fails and the agent has a certain belief, then the failed plan should be replaced by another plan. A plan repair rule hprrulei has the following form:  " “|" A plan repair rule of an agent can applied if:  the execution of one of its plan fails,  the failed plan can be matched with the abstract plan in the head of the rule, and  the belief query expression is derivable from the agent’s belief base.

Reasoning Rules – Plan Repair Rules an example of a plan repair rule of harry. This rule is used when the execution of a plan with the external action Java(blockworld,pickup(),L) fails. It fails due to there is no bomb to be picked up; it is possibly removed by another agent. The rule states that the plan should be replaced by a plan in which the agent updates its beliefs about the location of the bombs.

The Deliberation Cycle Like 3APL agent, the beliefs, goals, plans and reasoning rules form the mental states of the 2APL agent. deliberation cycle defines what the agent should do with these mental attitudes. It states which step the agent should perform next, e.g. execute an action or apply a reasoning rule. The deliberation cycle can be viewed as the interpreter of the agent program, as it determines which deliberation steps should be performed in which order

The Deliberation Cycle of a 2APL Agent

The 2APL Platform A development tool that is designed to support the implementation and execution of multi-agent systems programmed in 2APL The 2APL platform provides a graphical interface through which a user can develop and execute 2APL multi-agent systems using several facilities, such as a syntax-colored editor, different execution modes, and several debugging/observation tools. The platform allows communication among agents and can run on several machines connected in a network.  Agents hosted on different 2APL platforms can communicate with each other.

The 2APL Platform - startup

The 2APL Platform – with open file

When MAS is selected Log tab - to read the multi-agent system logs Files tab - to access the file in which the multi-agent system is specified Messages tab - to observe the messages that are exchanged between the agents when they are executed.

When a specific agent is selected Overview tab - to observe the selected agent’s mental state Log tab - to observe the agent’s execution log The Belief updates tab - to see the specification of belief update actions that the agent can perform PG rules tab - to see the agent’s rule that specifies how and by which plans the agent can realize its goals PC rules tab - to view the agent’s rules that specify how the received events and messages should be handled PR rules tab - to view the agent’s rules that specify how the agent can repair its failed plans Files tab to - access the complete source files that specify the agent. The Edit button in the Files tab the source file will be open

JADE tools - The RMA (Remote Monitoring Agent) tool - can be used to control the life cycle of the agent platform and of all the registered agents. The sniffer - can be used for tracking messages exchanged in a JADE based environment.  You can select agents to be sniffed. Every message directed to this agent(s) or coming from this The introspector allows to monitor and control the life- cycle of a running agent and its exchanged messages, both the queue of sent and received messages. It allows also to monitor the queue of behaviors, including executing them step-by-step.

RMA

Sniffer

2APL Specific tools The Flexible Graphical Deliberation Cycle (FGDC) tool  used to visualize and program the deliberation cycle of an agent. The agent’s deliberation cycle is used to determine what the agent should do next, e.g., execute an action, or select a plan to reach a goal. The state tracer  used for showing the execution trace of an agent. Each state shows the beliefs, plans, goals, and log of the agent as a result of executing one deliberation step.

FGDC tool

State tracer

2APL Environments 2APL agents can interact with environments that are implemented in Java. You can implement your own environment, or use the “blockworld” environment that is provided by the 2APL platform (this option is not yet available)

Block World Environment The blockworld is an external environment in which agents can perform actions. The blockworldconsists of a n x n world where agents can move in four directions (north, south, east and west). The world can contain bombs, stones, and traps. Agents can pickup and drop bombs.

Block World Environment

Reference