Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies...

21
peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

Transcript of Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies...

Page 1: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing

Agent-Based Computing:tools, languages and case studies

(Cont’d)

Page 2: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 2

Agent Programming Languages• Agent-oriented programming languages

– Not essential, BUT make life easier…• Do you know of a specific functionality that can only be

implemented with a particular programming language?– Special-purpose programming languages increase

productivity as they offer higher-level constructs• Particular aspects of the targeted domain are easier to

explore• Agent-oriented programming languages are useful

– However, there are many out there and many more are appearing…

– Let’s look at some of them!

Page 3: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 3

AgentSpeak• Influential abstract programming language• Uses the BDI agent model (we’ll see more about it)

– Beliefs: what the agent believes about the environment– Desires: what the agent needs to achieve– Intentions: plans to fulfil the desires

Page 4: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 4

AgentSpeak Architecture

Page 5: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 5

AgentSpeak Control Loop1. Agent receives events which are either

– External (from the environment or from sensors)– Internally generatedEvents (news and existing ones) are beliefs

2. Agent looks for plans that match events– Matching plans become desires

3. Agent chooses one plan from its desires to execute– Chosen plan is an intention

4. Execute chosen plan– During execution of plan, new events arise – go to 1

Page 6: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 6

AgentSpeak: Beliefs• Beliefs represent information the agent has

– About the environment– About its own internal state

• Encoded as ground first-order logic predicatessensor(temperature, 30)sensor(smoke, low)sensor(movement, detected)status(light, on)status(door, closed)status(window, open)

Page 7: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 7

AgentSpeak: Plans• Created off-line (manually or via planning systems)• Provide agents with a description of the actions it

should perform:– How to respond to events (e.g., if fire detected, then

enact the plan to put out fire and alert fire brigade)– How to achieve goals (e.g., how to book a flight from

Dundee to Paris)• Plan structure:

– Trigger condition: an event the plan can handle– Context: conditions under which plan can be used– Body: actual actions comprising the plan

Page 8: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 8

AgentSpeak: Plans (Cont’d)• Format:

TriggeringEvent : Context <- Body• Meaning:

– If TriggeringEvent arises and– Context holds in the current set of beliefs then– Execute Body

Page 9: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 9

AgentSpeak: Events• Achieve goal P: +!P• Drop goal P: -!P• Add new belief B: +B• Drop belief B: -B

Page 10: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

There is one single plan:• if you have acquired goal “start” then • when “true” holds (it always does) • carry out the single step plan “print(“hello world”)

Agent has a single initial goal

/* Initial goals */

!start.

/* Plans */

+!start : true <- .print("hello world.").

peer-to-peer and agent-based computing 10

AgentSpeak: “Hello World”

Page 11: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 11

Jason• An interpreter of AgentSpeak in Java• Development environment for MASs• Free downloads:

– http://jason.sourceforge.net • Integrated with JADE (distributed execution)• Eclipse plug-in

Page 12: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 12

Java Extensions for Agent Programming• Various extensions to Java

– Agent-specific constructs/built-ins– JACK, JADE and JASON are Java extensions!

• There are, however, APIs which retain the syntax and “object-orientedness” of Java

• Agent Building and Learning Environment (ABLE)– IBM’s agent toolkit– Java interfaces and base classes defining a library of JavaBeans

called AbleBeans, including• Reading and writing text and database data, • Rule-based inferencing using Boolean and fuzzy logic, • Machine learning techniques (e.g., neural networks, Bayesian classifiers,

and decision trees).

Page 13: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 13

Case Study 1: Softbots• Software robots (Softbots)

– Intelligent software agents that use software tools and services on a person's behalf

– User communicates what she wants accomplished (the goals), and softbots dynamically determine how to satisfy the person’s request

• Tool use is one of the hallmarks of intelligence– Softbots rely on the same tools and utilities available to

human computer users– Tools for sending mail, printing files, searching the

Web… • Popular Softbots interact with a wide range of

software tools and services through the WWW

Page 14: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 14

Case Study 1: MetaCrawler• WWW search services operated by the Univ. of

Washington– 1995–1997– Licensed to Go2Net, now InfoSpace, in 1997.

• Single, central interface for WWW document searching

Page 15: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 15

Case Study 1: MetaCrawler (Cont’d)• Upon receiving a query:

1. It posts the query to multiple search engines in parallel, then2. It performs sophisticated pruning on the responses returned

• MetaCrawler prunes as much as 75% of the returned responses as irrelevant, outdated, or unavailable

Page 16: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 16

Case Study 1: MetaCrawler (Cont’d)• Current version (www.metacrawler.com)

Page 17: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 17

Case Study 2: Calendar Agent• Retsina Semantic Web Calendar Agent

– Developed at Carnegie-Melon’s Intell. Software Agents Lab– Interoperability between RDF-based calendar descriptions on the

web, and Personal Information Manager (PIM) Systems such as Microsoft's Outlook

– Home page: http://www.cs.cmu.edu/~softagents/cal/ • Schedules can be:

– Browsed and imported by the user manually– Shared and imported autonomously by agents

• Assists users in keeping calendar “up-to-date”– Higher fidelity model of user’s schedule– Minimal cost on the user’s time

• Supports meeting scheduling– Agents negotiate meeting times based on user’s schedule and

preferences

Page 18: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 18

Case Study 2: Calendar Agent (Cont’d)• Schedules and events described on the web in RDF,

using ontologies, and linked to individual's contact information (e.g., their home page).

• Consists of – Distributed Meeting Scheduling Engine and – RETSINA Semantic Web Calendar Parser.

• Agent – Assists in organising and scheduling meetings between

several individuals, – Coordinates these based on existing schedules

maintained by MS Outlook.

Page 19: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 19

Case Study 2: Calendar Agent (Cont’d)• Agent interface and importing schedules onto Outlook

Page 20: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 20

Case Study 3: Robot Teams• Teams of robots must coordinate

their actions and collaborate– Example: robots playing football– Each robot is an autonomous agent

• Robocup: yearly competition of robot teams– http://www.robocup.org – Sony AIBO Legged League

• Football matches between teams of autonomous quadruped robots made by Sony Corporation.

– Sony AIBO's are publicly available and can be programmed

Page 21: Peer-to-peer and agent-based computing Agent-Based Computing: tools, languages and case studies (Cont’d)

peer-to-peer and agent-based computing 21

Further reading• A Survey of Programming Languages and Platforms for

Multi-Agent Systems, Bordini et. al., 2006, available at http://www.informatica.si/PDF/30-1/02_Bordini-A%20Survey%20of%20Programming%20Languages%20and%20Platforms...pdf

• Logics and Agent Programming Languages, Logan, B. and Alechina, N., ESSLLI 2009, available at http://www.agents.cs.nott.ac.uk/events/lapl09/

• JASON examples: http://jason.sourceforge.net/wp/examples/

• IBM’s ABLE: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frzahx%2Findex.html