LEVELS OF ABSTRACTIONS IN DESIGNING & PROGRAMMING SYSTEMS OF - - PowerPoint PPT Presentation

levels of abstractions
SMART_READER_LITE
LIVE PREVIEW

LEVELS OF ABSTRACTIONS IN DESIGNING & PROGRAMMING SYSTEMS OF - - PowerPoint PPT Presentation

LEVELS OF ABSTRACTIONS IN DESIGNING & PROGRAMMING SYSTEMS OF COGNITIVE AGENTS A. Ricci DISI, University of Bologna OBJECTIVE OBJECTIVE Some glances about Agent-Oriented Programming and Multi- Agent Oriented Programming - examples


slide-1
SLIDE 1

LEVELS OF ABSTRACTIONS

IN DESIGNING & PROGRAMMING

SYSTEMS OF COGNITIVE AGENTS

  • A. Ricci

DISI, University of Bologna

slide-2
SLIDE 2

OBJECTIVE

slide-3
SLIDE 3

OBJECTIVE

  • Some glances about Agent-Oriented Programming and Multi-

Agent Oriented Programming

  • examples using JaCaMo framework/technology
slide-4
SLIDE 4

OBJECTIVE

  • Some glances about Agent-Oriented Programming and Multi-

Agent Oriented Programming

  • examples using JaCaMo framework/technology
  • Main viewpoint
  • Level of abstraction, from design to runtime through

programming

slide-5
SLIDE 5

OBJECTIVE

  • Some glances about Agent-Oriented Programming and Multi-

Agent Oriented Programming

  • examples using JaCaMo framework/technology
  • Main viewpoint
  • Level of abstraction, from design to runtime through

programming

  • Some points for the discussion
  • AOP and (M)AOP for the web/hypermedia?
slide-6
SLIDE 6

AGENT-ORIENTED PROGRAMMING

  • AI view
  • modeling/designing/programming autonomous systems,

referred as agents

  • SE view
  • using agents as first-class modeling/designing/programming

abstraction

slide-7
SLIDE 7

AGENT ABSTRACTION

slide-8
SLIDE 8

AGENT ABSTRACTION

ENVIRONMENT feedback a c t i

  • n

s percepts effectors / actuators sensors action to do PERCEPTION DECISION ACTION

slide-9
SLIDE 9

AGENT ABSTRACTION

  • task/goal-oriented
  • pro-active + reactive
  • decision making

ENVIRONMENT feedback a c t i

  • n

s percepts effectors / actuators sensors action to do PERCEPTION DECISION ACTION

slide-10
SLIDE 10

PARADIGMS & METAPHORS imperative => functional => OOP => agents => machines math world of objects

slide-11
SLIDE 11

PARADIGMS & METAPHORS imperative => functional => OOP => agents => machines math world of objects world of humans

slide-12
SLIDE 12

ACTIONS & PERCEPTS

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

slide-13
SLIDE 13

ACTIONS & PERCEPTS

  • control uncoupling
  • action execution model is

asynchronous

  • success/failure events
  • percepts as obs state events

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

slide-14
SLIDE 14

ACTIONS & PERCEPTS

  • control uncoupling
  • action execution model is

asynchronous

  • success/failure events
  • percepts as obs state events
  • vs. other models
  • vs. method/proc calls
  • vs. async msg (actor)

passing

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

slide-15
SLIDE 15

AGENT COMMUNICATION

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS

slide-16
SLIDE 16

AGENT COMMUNICATION

  • Agent Communication

Languages

  • “speech acts”
  • ~asynchronous message

passing + action semantics

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS

slide-17
SLIDE 17

AGENT COMMUNICATION

  • Agent Communication

Languages

  • “speech acts”
  • ~asynchronous message

passing + action semantics

  • vs. other model
  • vs. async (actor) msg

passing

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS

slide-18
SLIDE 18

“COGNITIVE” MODEL

slide-19
SLIDE 19

“COGNITIVE” MODEL

  • AOP as a computing paradigm
  • mentalistic and societal view of computation [Soham, 1993]
  • level of abstraction to design and program
slide-20
SLIDE 20

“COGNITIVE” MODEL

  • AOP as a computing paradigm
  • mentalistic and societal view of computation [Soham, 1993]
  • level of abstraction to design and program
  • BDI (Belief-Desire-Intention) model/architecture (80ies)
  • inspired by the theory of human practical reasoning [Bratman, 1987]
  • Procedural Reasoning System (PRS) [Georgeff et al, 1988]
slide-21
SLIDE 21

“COGNITIVE” MODEL

  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
slide-22
SLIDE 22

HVAC ENVIRONMENT startCooling temp BELIEF BASE AGENT startWarming stop 15° temp(15) my_name(“ag0”) … idle state state(idle)

“COGNITIVE” MODEL

  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
slide-23
SLIDE 23

“COGNITIVE” MODEL

  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour

// examples in Jason !achieve_temp(20). /* more declarative style */ !temp(20). /* long-term task */ !achieve_and_keep_temp(20).

  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
slide-24
SLIDE 24

“COGNITIVE” MODEL

  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
  • Beliefs
  • information state
  • Goals
  • tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour
  • Beliefs
  • information state
  • Goals
  • what tasks to do
  • achieve | maintenance
  • Plans
  • how to achieve the goals
  • modules of agent behaviour

PLAN LIBRARY AGENT @myplanX

slide-25
SLIDE 25
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

<event> : <context> <- <body>.

PLAN MODEL | JASON EXAMPLE

slide-26
SLIDE 26
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

<event> : <context> <- <body>.

PLAN MODEL | JASON EXAMPLE

+!achieve_temp(Target) : temp(Current) & Target > Current <- startWarming; !warm_until(Target). +!achieve_temp(Target) : temp(Current) & Target < Current <- startCooling; !cool_until(Target). +!achieve_temp(Target) : temp(Current) & Target == Current <- stopHVAC.

  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
slide-27
SLIDE 27
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

<event> : <context> <- <body>.

PLAN MODEL | JASON EXAMPLE

  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

// long-term / maintenance task // target(T): belief used to track // the target temperature +temp(Current) : target(Target) & Target != Current <- !achieve_temp(Target).

  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
slide-28
SLIDE 28
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

<event> : <context> <- <body>.

PLAN MODEL | JASON EXAMPLE

  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals

// long-term / maintenance task // target(T): belief used to track // the target temperature +temp(Current) : target(Target) & Target != Current <- !achieve_temp(Target). +!achieve_temp(Target) : temp(Current) & Target < Current <- startWarming; !warm_until(Target). +!achieve_temp(Target) : temp(Current) & Target > Current <- startCooling; !cool_until(Target). +!achieve_temp(Target) : temp(Current) & Target == Current <- stopHVAC.

  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
  • Plan model
  • pro-active plans
  • reactive plans
  • Hierarchical model
  • sub-goals
slide-29
SLIDE 29

“COGNITIVE” MODEL

  • Intention
  • a plan in execution
  • can fail => plan failure handling
  • can be inspected, suspended,

resumed, aborted

  • multiple intentions can be in

execution concurrently

+!achieve_temp(Target) : temp(Current) & Target < Current <- startWarming; !warm_until(Target).

  • !achieve_temp(Target) :

<- print(“broken”); send_email. +!warm_until(Target) : temp(Current) & Current > Target <- .drop_intention(warm_until); !achieve_temp(Target).

slide-30
SLIDE 30

“COGNITIVE” MODEL

  • Reflection/meta-level features
  • adding/changing plans at runtime
  • inspecting/changing motivation

state

// adding a plan action +!g1 <- … .add_plan(“+b : true <- .print(b).”); … // checking for an intention +!g1 : .intend(g2) <- … .suspend_intention(g2); …

slide-31
SLIDE 31

CONTROL LOOP | REASONING CYCLE

slide-32
SLIDE 32

CONTROL LOOP | REASONING CYCLE

see action next

state

ENVIRONMENT AGENT

  • Abstract/general
slide-33
SLIDE 33

CONTROL LOOP | REASONING CYCLE

  • (BDI) Reasoning cycle

see action next

state

ENVIRONMENT AGENT

  • Abstract/general

begin

1

while true do

2

p ← perception()

3

B ← brf (B,p) ; // belief revision

4

D ← options(B,I) ; // desire revision

5

I ← filter(B,D,I) ; // deliberation

6

execute(I) ; // means-end

7

end

8

slide-34
SLIDE 34

CONTROL LOOP | REASONING CYCLE

  • (BDI) Reasoning cycle

see action next

state

ENVIRONMENT AGENT

  • Abstract/general

while true do

1

B brf (B,perception())

2

D options(B,I)

3

I filter(B,D,I)

4

π plan(B,I,A)

5

while π 6= ; and ¬succeeded(I,B) and ¬impossible(I,B) do

6

execute( head(π) )

7

π tail(π)

8

B brf (B,perception())

9

if reconsider(I,B) then

10

D options(B,I) ;

11

I filter(B,D,I) ;

12

if ¬sound(π,I,B) then

13

π plan(B,I,A) ;

14

PLANS and PLAN LIBRARY means-end in BDI =>

  • get and exec a plan 


from a plan library revise commitment to plan – re- planning for context adaptation reconsider the intentions

slide-35
SLIDE 35

AGENTS vs. OBJECTS/ACTORS

slide-36
SLIDE 36

AGENTS vs. OBJECTS/ACTORS

  • vs. objects in OOP
  • active vs. passive
  • stronger encapsulation
  • state + behaviour + control of the behaviour
  • “decision making”
slide-37
SLIDE 37

AGENTS vs. OBJECTS/ACTORS

  • vs. objects in OOP
  • active vs. passive
  • stronger encapsulation
  • state + behaviour + control of the behaviour
  • “decision making”
  • vs. actors
  • not reactive but pro-activity
  • reasoning cycle vs. event-loop
  • task/goal-oriented vs. message-driven
slide-38
SLIDE 38

FROM AOP TO MAOP (“MULTI-AGENT ORIENTED PROGRAMMING”)

slide-39
SLIDE 39

FROM AOP TO MAOP (“MULTI-AGENT ORIENTED PROGRAMMING”)

  • Integrating further design & programming dimensions and

abstractions aside to agent [Boissier et al, JaCaMo papers]

  • environment dimension
  • organisation dimension
slide-40
SLIDE 40

FROM AOP TO MAOP (“MULTI-AGENT ORIENTED PROGRAMMING”)

  • Integrating further design & programming dimensions and

abstractions aside to agent [Boissier et al, JaCaMo papers]

  • environment dimension
  • organisation dimension
  • Key points
  • separation of concerns
  • again: level of the abstraction
  • i.e. away from the everything-is-an-agent perspective
slide-41
SLIDE 41

ENVIRONMENT AS FIRST-CLASS DIMENSION

slide-42
SLIDE 42

ENVIRONMENT AS FIRST-CLASS DIMENSION

  • Environment as first-class design/

programming abstraction

  • modularising functionalities and services

available to agents

slide-43
SLIDE 43

ENVIRONMENT AS FIRST-CLASS DIMENSION

  • Environment as first-class design/

programming abstraction

  • modularising functionalities and services

available to agents

  • JaCaMo: A&A model (Agents & Artifacts)
  • inspired by Activity Theory & Distributed

Cognition

  • environment as a dynamic set of artifacts
  • created/used/shared by agents
  • tools mediating agent activities
  • ~objects at the agent LoA
slide-44
SLIDE 44

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

slide-45
SLIDE 45

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

  • Artifact first-class abstraction

ENVIRONMENT c0: Counter

count/1 inc tick

b: WhiteBoard

write read

h: HVAC

temp/1 startC startW

  • ff

g: GUI

edit/1 setText pressed

slide-46
SLIDE 46

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

  • Artifact first-class abstraction
  • usage interface
  • operations (~actions)
  • observable properties

ENVIRONMENT c0: Counter

count/1 inc tick

b: WhiteBoard

write read

h: HVAC

temp/1 startC startW

  • ff

g: GUI

edit/1 setText pressed

slide-47
SLIDE 47

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

  • Artifact first-class abstraction
  • usage interface
  • operations (~actions)
  • observable properties
  • link interface
  • to connect artifacts

ENVIRONMENT c0: Counter

count/1 inc tick

b: WhiteBoard

write read

h: HVAC

temp/1 startC startW

  • ff

g: GUI

edit/1 setText pressed

slide-48
SLIDE 48

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

  • Artifact first-class abstraction
  • usage interface
  • operations (~actions)
  • observable properties
  • link interface
  • to connect artifacts
  • manual
  • what functionalities & how to use
  • JACaMo environment

ENVIRONMENT c0: Counter

count/1 inc tick

b: WhiteBoard

write read

h: HVAC

temp/1 startC startW

  • ff

g: GUI

edit/1 setText pressed

slide-49
SLIDE 49

ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT

ARTIFACT ABSTRACTION

  • Artifact first-class abstraction
  • usage interface
  • operations (~actions)
  • observable properties
  • link interface
  • to connect artifacts
  • manual
  • what functionalities & how to use
  • JACaMo environment
  • Java-based API & runtime

ENVIRONMENT c0: Counter

count/1 inc tick

b: WhiteBoard

write read

h: HVAC

temp/1 startC startW

  • ff

g: GUI

edit/1 setText pressed

public class Counter extends Artifact { private int nTicks; void init(){ defineObsProperty("count",0); nTicks = 0; } @OPERATION void inc(){ ObsProperty prop = getObsProperty("count"); prop.updateValue(prop.intValue() + 1); nTicks++; signal("tick " + nTicks); } }

slide-50
SLIDE 50

WORKSPACES

  • Structuring complex/distributed

environments in workspaces

  • logical containers of artifacts
  • agents can dynamically join and

work in multiple workspaces

  • workspaces can be distributed
  • ver the network

main wsp meetingZ wsp roomX wsp

slide-51
SLIDE 51

ORGANISATION AS FIRST-CLASS DIMENSION

WHITEBOARD artifact ARCHIVE artifact

  • COM. CHANNEL

artifact TASK SCHEDULER artifact RESOURCE artifact CLOCK artifact

BAKERY workspace

agents can join dynamically the workspace

bakery_staff

group

cake_staff

group

scheduling_staff

group

pastry_chef

role

assistant

role

helen john mary bob henry paul anna

manager

role

planner

role

planner

role

planner

role

archivist

role

planner

role

slide-52
SLIDE 52

ORGANISATION AS FIRST-CLASS DIMENSION

  • Organisation as first-class design/

programming abstraction

  • specifying the structure and

coordinated behaviour of a MAS as a whole

WHITEBOARD artifact ARCHIVE artifact

  • COM. CHANNEL

artifact TASK SCHEDULER artifact RESOURCE artifact CLOCK artifact

BAKERY workspace

agents can join dynamically the workspace

bakery_staff

group

cake_staff

group

scheduling_staff

group

pastry_chef

role

assistant

role

helen john mary bob henry paul anna

manager

role

planner

role

planner

role

planner

role

archivist

role

planner

role

slide-53
SLIDE 53

ORGANISATION AS FIRST-CLASS DIMENSION

  • Organisation as first-class design/

programming abstraction

  • specifying the structure and

coordinated behaviour of a MAS as a whole

  • JaCaMo organisation
  • roles, links, groups
  • social goals, missions schemes
  • norms

WHITEBOARD artifact ARCHIVE artifact

  • COM. CHANNEL

artifact TASK SCHEDULER artifact RESOURCE artifact CLOCK artifact

BAKERY workspace

agents can join dynamically the workspace

bakery_staff

group

cake_staff

group

scheduling_staff

group

pastry_chef

role

assistant

role

helen john mary bob henry paul anna

manager

role

planner

role

planner

role

planner

role

archivist

role

planner

role

slide-54
SLIDE 54

ORGANISATION AS FIRST-CLASS DIMENSION

  • Organisation as first-class design/

programming abstraction

  • specifying the structure and

coordinated behaviour of a MAS as a whole

  • JaCaMo organisation
  • roles, links, groups
  • social goals, missions schemes
  • norms
  • Tackling MAS-level complexity
  • coordination, openness, regulated

autonomy

WHITEBOARD artifact ARCHIVE artifact

  • COM. CHANNEL

artifact TASK SCHEDULER artifact RESOURCE artifact CLOCK artifact

BAKERY workspace

agents can join dynamically the workspace

bakery_staff

group

cake_staff

group

scheduling_staff

group

pastry_chef

role

assistant

role

helen john mary bob henry paul anna

manager

role

planner

role

planner

role

planner

role

archivist

role

planner

role

slide-55
SLIDE 55

composition

Concept

Dimension Organisation

Group Scheme Role Goal Organisation Norm * * * * *

M

slide-56
SLIDE 56

composition

Concept

Dimension Organisation

Group Scheme Role Goal Organisation Norm * * * * *

M

  • Explicit representation of the org
  • that agents can inspect, reason about, and change
  • Reified at runtime through artifacts
  • that agents can monitor, manage, adapt
slide-57
SLIDE 57

WRAP-UP

slide-58
SLIDE 58

WRAP-UP

Organisation Agent

Goal Group Scheme Role Goal Organisation Norm

Environment

Workspace Operation Environment Artifact Property Signal Agent Belief Action

e m p

  • w

e r c

  • u

n t

  • a

s p a r t i c i p a t e regulate coordinate act perceive

slide-59
SLIDE 59

WRAP-UP

Organisation Agent

Goal Group Scheme Role Goal Organisation Norm

Environment

Workspace Operation Environment Artifact Property Signal Agent Belief Action

e m p

  • w

e r c

  • u

n t

  • a

s p a r t i c i p a t e regulate coordinate act perceive

Explicit Description / API

Explicit Description / API

slide-60
SLIDE 60

POINTS FOR DISCUSSION

  • AOP/MAOP for WoX/Hypermedia (?)
  • benefits
  • open issues
  • Roadmap?
  • call for action?