slide1
Download
Skip this Video
Download Presentation
Dr. Muhammad Adnan Hashmi

Loading in 2 Seconds...

play fullscreen
1 / 68

Dr. Muhammad Adnan Hashmi - PowerPoint PPT Presentation


  • 106 Views
  • Uploaded on

An Agent Oriented Programming Language integrating Temporal Planning and the Plan Coordination Mechanisms. Dr. Muhammad Adnan Hashmi. Outline. Introduction Background Problem Overview Plan Coordination Mechanisms Coordinated Planning Problem Proactive-Reactive Coordination Problem

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Dr. Muhammad Adnan Hashmi' - ban


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

An Agent Oriented Programming Language integrating Temporal Planning and the Plan Coordination Mechanisms

Dr. Muhammad Adnan Hashmi

outline
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
outline1
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
what is an agent
What is an Agent?
  • An agent is a computer system capable of autonomous action in some environment in order to meet its design objectives (goals).
  • Achievement of goals is important for agents
planning
Planning
  • Finding a sequence of actions that takes agent from Initial State to Goal State

Initial state:clear(c),on(c,a),ontable(a),clear(b),ontable(b),handempty

Goal:on(a,b),

on(b,c)

a

c

b

a

b

c

a

c

b

b

a

b

a

b

c

a

c

c

multi agent planning
Multi-Agent Planning
  • Multiple agents sharing the same environment
    • Independent planning is not sufficient
    • Coordination of plans is vital
  • Coordination of plans
    • Removing conflicts (negative interactions)
    • Utilizing help relations (positive interactions)

DA

DA

A

A

DB

DB

B

B

how to program agents
How to Program Agents?
  • Agent Oriented Programming (AOP) Languages allow to program intelligent and autonomous agents
  • Main Characteristics
    • Mental State: Beliefs, Goals, Commitments
    • Reasoning Mechanism
    • Capabilities, Services
    • Communication
  • Some Languages
    • Agent-0 [Shoham 1993], 2APL [Dastani 2008], AgentSpeak (L) [Rao 1996]
outline2
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
problem statement
Problem Statement
  • Current AOP languages
    • Follow a reactive (PRS based) approach
    • Do not support temporal planning
      • Only a few support planning
  • Problems
    • Execution without planning may result in the goal failures
        • Agent can reach a dead end
    • Conflicts can arise among different agents
    • Actions’ duration is important
      • Real world actions take place over a timespan
objectives
Objectives
  • Propose a programming language that endows agents with planning skills
      • Has temporal planning
      • Deals with uncertainty of the environment
      • Incorporate reactivity by dealing with on the fly goals having different priorities
  • Propose coordination mechanisms for the plans having different priorities
outline3
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
assumptions
Assumptions
  • Two agents α and β sharing the same environment
    • Agent α having higher priority (reactive) goals
    • Agent β having normal priority (proactive) goals
  • Actions have:
    • Preconditions
    • Add effects
    • Delete effects
  • Two possible conflicts among plans
    • Causal link threat
    • Parallel actions interference
two possible conflicts
Two Possible Conflicts
  • Causal Link (A1, A2, p)
    • Action A1 adds an effect p
    • Action A2 needs this effect
    • No action between A1 and A2 adding p
  • Causal Link Threat
    • If an action A deletes p and lies between A1 and A2, then A threatens the causal link (A1, A2, p)

p

A1

A2

Threat

A

¬p

two possible conflicts1
Two Possible Conflicts
  • Causal Link (A1, A2, p)
    • Action A1 adds an effect p
    • Action A2 needs this effect
    • No action between A1 and A2 adding p
  • Parallel Actions Interference
    • Actions A1 and A2 lie in parallel
    • Either one of them deletes the preconditions or add effects of the other

A1

p

A1

¬p

p

A2

¬p

A2

outline4
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
coordinated planning problem
Coordinated Planning Problem
  • Prerequisite:
    • Plan Pα of Agent α
  • Our Aim:
    • Compute a Plan Pβ for Agent β
      • Has no conflict with Pα
      • Avails the cooperative opportunities offered by Pα
  • Solution:
    • Non Temporal Domains  µ-SATPLAN
    • Temporal Domains  Coordinated-Sapa
satplan kautz and selman 2006

SATPLAN [Kautz and Selman 2006]

A Classical Planner that Finds Optimal Plans in Non-Temporal Domains

satplan
SATPLAN

We Use GraphPlan Encoding

Propositional formula in conjunctive normal form (CNF)

  • Planning Problem
  • Init State
  • Goal
  • Actions

Compiler

(encoding)

Simplifier

(polynomial

inference)

CNF

Increment plan length

If unsatisfiable

CNF

satisfying

model

Decoder

Solver

(SAT engine/s)

Plan

constructing the planning graph
Constructing the planning graph
  • Level P1: All literals from the initial state
  • Add an action in level Ai if all its preconditions are present in level Pi
  • Add a proposition in level Pi if it is the effect of some action in level Ai-1
  • Maintain a set of exclusion relations to eliminate incompatible propositions and actions
graphplan encoding
GraphPlan Encoding
  • Can create such constraints for every node in the planning graph
  • Only involves facts and actions in the graph

Pre1

Act1

Fact

Pre2

Act2

Fact  Act1  Act2

Act1  Pre1  Pre2

¬Act1  ¬Act2

satplan1

µ-SATPLAN

An Extension of SATPLAN that Computes Coordinated Plans in Non-Temporal Domains

handling causal link threat
Handling Causal Link Threat
  • While constructing the planning graph for Agent β, don’t add an action O at level Ai if
    • It has an effect ¬p, and
    • There is a causal link (Aj, Ak, p) in plan Pα, and
    • j ≤ i ≤ k

Action O threatens Causal Link (Aj, Ak, p)

handling positive interactions parallel actions interference
Handling Positive Interactions & Parallel Actions Interference
  • For each time step i in the plan of Agent α, create an action NoName(i)
    • Add(NoName(i))  All the effects added by Pαat time step i
    • Del(NoName(i))  All the effects deleted by Pαat time step i
    • Pre(NoName(i))  All the preconditions of actions of Pαat time step i
  • Explicitly add all the NoName actions in the planning graph of Agent β
handling positive interactions
Level 0

Level 1

Level 2

a0

a0

a0

NoName(0)

NoName(1)

a2

a2

a1

a1

a1

β2

β4

a8

a4

a4

a4

a4

β1

a5

a5

a5

β3

a7

a7

a6

a6

a6

a6

Handling Positive Interactions
  • Pα = {α1(0), α2(0), α3(1)}
  • Eff(α1) = a0, Eff(α2) = a1, Eff(α3) = a2
  • Eff( NoName(0) ) = {a0,a1}, Eff( NoName(1) ) = {a2}

Planning Graph of Agent β

handling positive interactions1
Level 0

Level 1

Level 2

a0

a0

a0

NoName(0)

NoName(1)

a2

a2

a1

a1

a1

β2

β4

a8

a4

a4

a4

a4

β1

a5

a5

a5

β3

a7

a7

a6

a6

a6

a6

Handling Positive Interactions
  • Add NoName actions as unary clauses to CNF
    • NoName(0)
    • NoName(1)
  • Partial CNF Sentence
    • a8  β4
    • β4  a0  a7
    • a0  β2  NoName(0)
    • a7  β3
    • β2  a5

Solution

Problem

outline5
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
proactive reactive coordination
Proactive-Reactive Coordination
  • Prerequisite:
    • Reactive plan Pα of Agent α
    • Proactive plan Pβ of Agent β
  • Our Aim:
    • Modify plan Pβ such that:
      • It has no conflict with Pα
      • Avails the cooperative opportunities offered by Pα
  • Solution:
    • Plan Merging Algorithm
case study
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

Case Study

Rescue Agent : α

Analyzer Agent : β

  • Tasks of Rescue Agent
    • Rescue the Victims
  • Tasks of Analyzer Agent
    • Analyze the goal cells
    • Call the central agent
  • Constraints
    • One agent in a cell
    • Hyper energy cells
      • Needs fuel or energy to enter
    • Agent should have key to open door
conflict resolution
Conflict Resolution
  • Threat-Repair Link (A1, A2, p)
    • Action A1 deletes p
    • A2 is a subsequent action and adds p
    • A1 is called Threat Action
    • A2 is called Repair Action

p

B1

B2

Threat

A1

-p

A2

p

Repair

valid and possibly valid time stamps
Valid and Possibly Valid Time Stamps
  • Possibly Valid Time Slot for an action A
    • All preconditions are met
    • No parallel actions interference

P[1]

 a

b

h

P[2]

 b

c

-d

P[3]

 c

e

P[4]

 e

f

P[5]

 f

g

P[6]

 g

i

P[7]

  • i
  • h

g

P[1]

 b

d

-h

  • Valid Time Slot for an action A
    • All preconditions are met
    • No parallel actions interference
    • Either:
      • No causal link threat
      • Repair Action exist before the deadline

P[1]

 a

b

h

P[2]

 b

c

-d

P[3]

 c

e

P[4]

 e

f

P[5]

 f

g

P[6]

 g

i

P[7]

  • i
  • h

g

P[2]

k

P[1]

 b

d

-h

 d

P[3]

  • k

h

plan merging algorithm
Plan Merging Algorithm
  • Fix all the actions of Reactive Plan Pα on timeline
  • For every action CA of Proactive Plan
    • Search for the first Possibly Valid Time Slot T on timeline
    • Reason about the time slot T
      • There could be 5 cases at T
plan merging algorithm1
1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

Plan Merging Algorithm

Case 1: No causal link threat by CA at T

    • Assign Time Slot T to CA

EXAMPLE

  • Current Action: Move(A1, A2)
    • Returned Time Slot: 0 - 5
    • Any Threat? : No
    • Assign Time Slot 0 – 5 to CA
plan merging algorithm2
Plan Merging Algorithm

Case 2: CA threatens a Causal Link but Repair Action exist

    • Assign Time Slot T to CA
    • Save a Possible Threat

EXAMPLE

  • Current Action: Move(A4, A5)
    • Time Slot: 20 - 25
    • Any Threat? : Yes (Agent α needs A5 at time 40-45)
    • Repair Action: Move(A5, A6)
    • Assign Time Slot 20 - 25 to Move (A4, A5)
    • Save

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan merging algorithm3
Plan Merging Algorithm

Case 3: It is a Repair Action but can not meet a deadline of some Threat Action

    • Backtrack to the Threat Action,find another time stamp

EXAMPLE

  • Current Action: Move (A8, A9)
    • Returned Time Slot: 50 - 55
    • Any Threat?: Yes (Agent α needs A9 at 85-110)
    • Repair Action : Move (A9, B9)
    • Save
  • Next Action: AnalyzeCell (A9)
    • Time Slot Assigned: 55 - 70

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan merging algorithm4
Plan Merging Algorithm

Attention

  • Next Action: CallCentral (A9)
    • Time Slot Assigned: 80 – 90
  • Next Action: Move (A9, B9)
    • Is it a Repair Action? : Yes
    • Meet all deadlines?: No (Agent α needs A9 at 85)
    • Backtrack to action Move(A8, A9)
      • Find another Time Slot
      • New Time Slot: 110 – 115 (Valid Time Slot)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan merging algorithm5
Plan Merging Algorithm

Case 4: All the effects of CA are already achieved

WHAT TO DO?

  • Mark CA as redundant

POST PROCESSING

  • Remove all redundant actions from the plan
  • Recursively remove all actions which achieve only the preconditions of removed action
plan merging algorithm6
Plan Merging Algorithm

EXAMPLE

  • Current Action: OpenDoor (C11)
    • Returned Time Slot: 172 - 175
    • Redundant(OpenDoor(C11))  true
      • BecauseopenedDoor(C11) is true at time 172
    • When the plan is returned
      • Remove OpenDoor(C11) from plan
      • Also remove TakeKey(C11, key1) from plan

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan merging algorithm7
Plan Merging Algorithm

Case 5: Action CA’s preconditions can not be achieved

  • Remove action CA from the plan and compute a plan to achieve effects of CA
    • I = State just before CA
    • G = Effects (CA)
  • Plan should have no conflict with Reactive Plan Pβand if CA is a repair action, repair effects must meet their deadline
    • ReplacementPlan = Coordinated-Sapa (I, G, Pβ)
  • If a plan is returned, replace the removed actions with the plan
  • If a deadline is violated, backtrack to the threat action
  • If no plan possible, then remove another action CA + 1
    • G = G U Effects (CA + 1) \ Pre (CA + 1)

Use Coordinated-Sapa

plan merging algorithm8
Plan Merging Algorithm

EXAMPLE

  • Current Action: TakeEnergy(B13, energy1)
  • Preconditions can not be achieved
    • Repair the plan

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan repair algorithm
Plan Repair Algorithm
  • Create a CPP by removing TakeEnergy(B13, energy1)
    • I = { at(β, B13), at(energy1, B13), at(energy2, B13) }
    • G = { hasEnergy(β, energy), at(β, B13)}
  • Call Coordinated-Sapa to solve this CPP
    • Coordinated-Sapa returns fail
    • Why? energy2 is also needed by Agent α

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

plan repair algorithm1
Plan Repair Algorithm
  • Create another CPP by removing Move(B13, A12)
    • I = { at(β, B13), at(energy1, B13), at(energy2, C15) }
    • G = { at(β, A12) }
  • Call Coordinated-Sapa to solve this CPP
    • A plan is returned to enter A12 by taking the fuel from D14

POST PROCESSING

  • This plan will become a replacement for both TakeEnergy(B13, energy1) and Move(B13, A12)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

A

B

C

D

outline6
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
slide44
P-CLAIM
  • An AOP language having:
    • Cognitive aspects specific to intelligent agents
    • Communication primitives
    • Mobility primitives
    • Temporal planning capability
  • P-CLAIM Agent:
    • Is autonomous, intelligent and mobile
    • Has a mental state containing knowledge, goals, and capabilities
    • Is able to communicate with other agents
    • Entails a planning based behaviour
    • Achieves goals based on their priorities
    • Maintains the stability of the plan in the dynamic environments
defining p claim agent
Defining P-CLAIM Agent

defineAgent agentName{

parent = null | agentName ;

knowledge = null ;| {knowledge1; …; knowledgem}

goals = null;| {goal1; … ; goaln}

activities = null ; {activity1 … activityo}

actions = {action1 … actionp}

agents = null ; | {agName1, agName2, …, agNameq}

}

activities
Activities

defineAgent agentName{

parent = null | agentName ;

knowledge = null ;| {knowledge1; …; knowledgem}

goals = null;| {goal1; … ; goaln}

activities = null ; {activity1 … activityo}

actions = {action1 … actionp}

agents = null ; | {agName1, agName2, …, agNameq}

}

activityity = name {

message = null | message ;

conditions = null | condition ;

do { process }

effects = null ;| { effect1 ; …; effectf }

}

actions
Actions

defineAgent agentName{

parent = null | agentName ;

knowledge = null ;| {knowledge1; …; knowledgem}

goals = null;| {goal1; … ; goaln}

activities = null ; {activity1 … activityo}

actions = {action1 … actionp}

agents = null ; | {agName1, agName2, …, agNameq}

}

action = name {

message = null | message ;

conditions = null | condition ;

do { process }

duration = dur ;

}

outline7
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
agent definition to planning translator
Agent Definition to Planning (Translator)

Agent Description File

Knowledge

Goals

Activities

Actions

Translator

(JavaCC)

Initial State

Goals

Methods

Operators

Problem File

Domain File

Planner

slide52
Messages Handler
  • Waits for messages from other agents
  • Message is a request to achieve a goal?
    • Assigns priority to the goal
    • Reactive Goal  puts it in Global Reactive Goals (GRG) queue
    • Proactive Goal  puts it in Global Proactive Goals (GPG) priority queue
  • Message is an information?
    • Store the information in the knowledge base of the agent
slide54
2- GPG Goals are accessed only when GRG is empty

Planner

GRG

GPG

1- Fetch goals one by one from GRG and GPG and calls Compute_Plan to compute a plan for the goal

Main Algorithm

3- Sends a suspension signal to Executor if the goal is reactive i.e. from GRG

Compute Plan

Temporal Converter

plan computation
Plan Computation

T1

M1

T11

T12

M11

M12

  • JSHOP2 algorithm [Nau et el. 2003] is used to compute a totally ordered plan for each goal
    • An HTN planning algorithm
    • Decomposes the task into sub-tasks by applying methods
    • Recursively applies the same procedure on every composite sub-task until there are only primitive tasks
temporal converter
Temporal Converter
  • Input to procedure
    • A totally ordered plan
    • Actions’ information (Add, Del, Pre, Durations)
  • Output of procedure
    • A position constrained parallel plan
      • Every action is assigned a time stamp
      • Multiple actions can possibly lie in parallel
slide57
Temporal Converter (Example)

Input Plan

a

P[1]

-a

+d

+e

+f

f

P[2]

-f

+g

+h

e

P[3]

+i

P[4]

h

-h

+j

P[5]

g

i

+k

P[6]

k

+l

l

P[7]

+m

m

P[8]

+c

c

m

P[9]

-c

e

-k

-c

+h

P[10]

Makespan =150

Output Plan

m

P[8]

+n

+c

P[1]

a

-a

+d

+e

+f

f

P[2]

-f

+g

+h

P[4]

h

-h

+j

P[6]

k

+l

l

P[7]

+m

P[9]

c

m

n

-c

e

P[3]

+i

P[5]

g

i

+k

e

P[10]

-k

-c

+h

Makespan =105

Makespan Gain: 30%

merging the new plan to global plan1
Merging the New Plan to Global Plan

Planner

Reactive Goal

Proactive Goal

Merge at the start of Pexec

Append at the end of Pexec

Plan Under Execution (Pexec)

plan mender1
Plan Mender

Compute Plan Using Sapa

Compute Plan Using Sapa

SW

ReplacementPlan

ContinuationPlan

G

No Plan

SP(Pexec[4])

SP(Pexec[3])

SP(Pexec[2])

SP(Pexec[1])

Pexecnew = ReplacementPlan + ContinuationPlan

outline8
Outline
  • Introduction
    • Background
    • Problem Overview
  • Plan Coordination Mechanisms
    • Coordinated Planning Problem
    • Proactive-Reactive Coordination Problem
  • P-CLAIM: AOP Language supporting Temporal Planning
    • Language Definition
    • Planning Mechanism
  • Conclusion
conclusion
Conclusion
  • An agent oriented programming language supporting:
    • Temporal Planning
    • Plan Repairing
    • Dealing with different priority goals
  • Coordinated Planning Problem
    • Computing plan while coordinating it with another plan
      • SATPLAN  µ-SATPLAN
      • Sapa  Coordinated-Sapa
  • Proactive-Reactive Coordination Problem
    • Modifying a plan to remove conflicts with a higher priority plan
      • Plan Merging Algorithm
publications
Publications
  • A. El Fallah Seghrouchni, M. A. Hashmi, “Multi-Agent Planning”, Book chapter in Software Agents, Agent Systems and Their Applications. M. Essaaidi et al. (Eds.), 2012, IOS Press.
  • Y. Dimopoulos, M. A. Hashmi, P. Moraitis, “µ-SATPLAN: Multi-Agent Planning as Satisfiability”, Knowledge Based Systems Journal, 2011
  • M. A. Hashmi, A. El Fallah Seghrouchni, “Merging of Temporal Plans supported by Plan Repairing”, Proceedings of 22nd IEEE International Conference on Tools with Artificial Intelligence (ICTAI 2010), Aras, France
  • M. A. Hashmi, A. El Fallah Seghrouchni, “Coordination of Temporal Plans for the Reactive and Proactive Goals”, Proceedings of IEEE/WIC/ACM International Conference on Intelligent Agent Technology (IAT’ 10), Toronto, Canada
  • Y. Dimopoulos, M. A. Hashmi, P. Moraitis, “Extending SATPLAN to Multiple Agents”, Proceedings of 30th SGAI International Conference on Artificial Intelligence 2010, Cambridge, UK.
  • M. A. Hashmi, A. El Fallah Seghrouchni, “Temporal Planning in Dynamic Environments for P-CLAIM Agents”, In proceedings of Languages, Methodologies and Development Tools for Multi-Agent Systems (LADS’09), Torino, Italy, Springer-Verlag.
publications1
Publications
  • M. A. Hashmi, A. El Fallah Seghrouchni, “Temporal Planning in Dynamic Environments for Mobile Agents”, Proceedings of International Conference on Frontiers of Information Technology (FIT’ 09), Abottabad, Pakistan, Publisher ACM press.
  • M. A. Hashmi, “A Planning Component for CLAIM Agents”, In the proceedings of 17th International Conference on Control Systems and Computer Science, Bucharest, Romania, Volume 2, pages 485-492, Politehnica Press
ad