LEVELS OF ABSTRACTIONS
IN DESIGNING & PROGRAMMING
SYSTEMS OF COGNITIVE AGENTS
- A. Ricci
DISI, University of Bologna
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
DISI, University of Bologna
Agent Oriented Programming
Agent Oriented Programming
programming
Agent Oriented Programming
programming
referred as agents
abstraction
ENVIRONMENT feedback a c t i
s percepts effectors / actuators sensors action to do PERCEPTION DECISION ACTION
ENVIRONMENT feedback a c t i
s percepts effectors / actuators sensors action to do PERCEPTION DECISION ACTION
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
asynchronous
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
asynchronous
passing
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS
Languages
passing + action semantics
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS
Languages
passing + action semantics
passing
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENTS SPEECH ACTS
HVAC ENVIRONMENT startCooling temp BELIEF BASE AGENT startWarming stop 15° temp(15) my_name(“ag0”) … idle state state(idle)
// examples in Jason !achieve_temp(20). /* more declarative style */ !temp(20). /* long-term task */ !achieve_and_keep_temp(20).
PLAN LIBRARY AGENT @myplanX
<event> : <context> <- <body>.
<event> : <context> <- <body>.
+!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.
<event> : <context> <- <body>.
// long-term / maintenance task // target(T): belief used to track // the target temperature +temp(Current) : target(Target) & Target != Current <- !achieve_temp(Target).
<event> : <context> <- <body>.
// 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.
resumed, aborted
execution concurrently
+!achieve_temp(Target) : temp(Current) & Target < Current <- startWarming; !warm_until(Target).
<- print(“broken”); send_email. +!warm_until(Target) : temp(Current) & Current > Target <- .drop_intention(warm_until); !achieve_temp(Target).
state
// adding a plan action +!g1 <- … .add_plan(“+b : true <- .print(b).”); … // checking for an intention +!g1 : .intend(g2) <- … .suspend_intention(g2); …
see action next
state
ENVIRONMENT AGENT
see action next
state
ENVIRONMENT AGENT
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
see action next
state
ENVIRONMENT AGENT
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 =>
from a plan library revise commitment to plan – re- planning for context adaptation reconsider the intentions
abstractions aside to agent [Boissier et al, JaCaMo papers]
abstractions aside to agent [Boissier et al, JaCaMo papers]
programming abstraction
available to agents
programming abstraction
available to agents
Cognition
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT c0: Counter
count/1 inc tick
b: WhiteBoard
write read
h: HVAC
temp/1 startC startW
g: GUI
edit/1 setText pressed
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT c0: Counter
count/1 inc tick
b: WhiteBoard
write read
h: HVAC
temp/1 startC startW
g: GUI
edit/1 setText pressed
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT c0: Counter
count/1 inc tick
b: WhiteBoard
write read
h: HVAC
temp/1 startC startW
g: GUI
edit/1 setText pressed
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT c0: Counter
count/1 inc tick
b: WhiteBoard
write read
h: HVAC
temp/1 startC startW
g: GUI
edit/1 setText pressed
ENVIRONMENT ACTIONS OBSERVABLE STATE PERCEPTS AGENT
ENVIRONMENT c0: Counter
count/1 inc tick
b: WhiteBoard
write read
h: HVAC
temp/1 startC startW
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); } }
environments in workspaces
work in multiple workspaces
main wsp meetingZ wsp roomX wsp
WHITEBOARD artifact ARCHIVE artifact
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
programming abstraction
coordinated behaviour of a MAS as a whole
WHITEBOARD artifact ARCHIVE artifact
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
programming abstraction
coordinated behaviour of a MAS as a whole
WHITEBOARD artifact ARCHIVE artifact
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
programming abstraction
coordinated behaviour of a MAS as a whole
autonomy
WHITEBOARD artifact ARCHIVE artifact
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
composition
Concept
Dimension Organisation
Group Scheme Role Goal Organisation Norm * * * * *
M
composition
Concept
Dimension Organisation
Group Scheme Role Goal Organisation Norm * * * * *
M
Organisation Agent
Goal Group Scheme Role Goal Organisation Norm
Environment
Workspace Operation Environment Artifact Property Signal Agent Belief Action
e m p
e r c
n t
s p a r t i c i p a t e regulate coordinate act perceive
Organisation Agent
Goal Group Scheme Role Goal Organisation Norm
Environment
Workspace Operation Environment Artifact Property Signal Agent Belief Action
e m p
e r c
n t
s p a r t i c i p a t e regulate coordinate act perceive
Explicit Description / API
Explicit Description / API