integrating a priority-based scheduler of behaviours in jade
DESCRIPTION
Presentation at ESAW 2006TRANSCRIPT
![Page 1: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/1.jpg)
Integrating aPriority-Based Scheduler of
Behaviours in JADE
Juan A. Suárez-RomeroAmparo Alonso-BetanzosBertha Guijarro-Berdiñas
Laboratory for Research and Development in Artificial Intelligence
Department of Computer Science, University of A Coruña, Spain
Supported under PGIDT03TIC10501PR project
![Page 2: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/2.jpg)
2
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Outline
• JADE• Need for priorities• Current implementation of JADE’s scheduler
• Proposed implementation of priority-based scheduler
• Examples• Summary
![Page 3: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/3.jpg)
3
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
JADE
• Java Agent DEvelopment Framework
• FIPA compliant
• Agent tasks encapsulated in Behaviours
.
.
.public void action();
public boolean done();...
.
.
.public void action();
public boolean done();...
.
.
.public void action();
public boolean done();...
.
.
.publicvoidaction();
publicbooleandone();...
.
.
.publicvoidaction();
publicbooleandone();...
.
.
.publicvoidaction();
publicbooleandone();...
.
.
.publicvoidaction();
publicbooleandone();...
.
.
.publicvoidaction();
publicbooleandone();...
.
.
.publicvoidaction();
publicbooleandone();...
![Page 4: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/4.jpg)
4
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities
• Agent that resolves requests from other agents.– Some requests requires more attention that
others
Listener
![Page 5: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/5.jpg)
5
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities
• Agent that uses its full time
– In normal time, it executes several specific tasks
– When it is idle (i.e. these tasks can not be executed)
it runs other tasks of maintenance.
Specific Tasks Idle Tasks
![Page 6: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/6.jpg)
6
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Adding priorities to JADE
• Add priorities to Behaviours
– Reuse of existing Behaviours → Wrapper
• Adding a scheduler that manages these
encapsulated Behaviours
– Add a scheduler as add-on → CompositeBehaviour
![Page 7: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/7.jpg)
7
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Behaviours with priority
• Each Behaviour are encapsulated in a wrapper that adds priority
• Wrapper is transparent to users• Priority is a number ≥0
• The lesser the number, the greater the priority• Two priorities
– Static priority: specified by user
– Dynamic priority: used internally by the scheduler
![Page 8: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/8.jpg)
8
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Current implementation
• Two class of CompositeBehaviour– ParallelBehaviour
B1 B2 B3 B4
![Page 9: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/9.jpg)
9
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B3
0
0
B2
1
1
B1
2
2
B3
0
0
DynamicPriority
StaticPriority
Ready
List
![Page 10: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/10.jpg)
10
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B2
1
1
B1
2
2
Ready
List
![Page 11: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/11.jpg)
11
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
0
B2
1
0
B1
2
1
Ready
List
B2
1
0
B4
1
0
![Page 12: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/12.jpg)
12
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B2
1
1
B1
2
1
Ready
List
B2
1
1
B4
1
1
![Page 13: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/13.jpg)
13
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B2
1
1
B1
2
1
Ready
List
B2
1
1
B4
1
1
![Page 14: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/14.jpg)
14
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
0
B2
1
0
Ready
List
B2
1
0
B4
1
0
B1
2
0
B1
2
0
![Page 15: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/15.jpg)
15
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B2
1
1
Ready
List
B2
1
1
B4
1
1
B1
2
2
B1
2
2
![Page 16: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/16.jpg)
16
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
ParallelPriorityBehaviour
• Manages sub-behaviours in a parallel way using priorities
B4
1
1
B2
1
1
Ready
List
B2
1
1
B4
1
1
B1
3
3
![Page 17: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/17.jpg)
17
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Current implementation
• Two class of CompositeBehaviour– ParallelBehaviour– SequentialBehaviour
B1 B2 B3 B4
![Page 18: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/18.jpg)
18
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
SequentialPriorityBehaviour
• Manages sub-behaviours in a sequential way using priorities
B2
1
B3
0
B1
3
B4
1
StaticPriority
![Page 19: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/19.jpg)
19
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
SequentialPriorityBehaviour
• Manages sub-behaviours in a sequential way using priorities
B2
1
B1
3
B4
1
![Page 20: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/20.jpg)
20
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
SequentialPriorityBehaviour
• Manages sub-behaviours in a sequential way using priorities
B2
1
B1
3
![Page 21: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/21.jpg)
21
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
SequentialPriorityBehaviour
• Manages sub-behaviours in a sequential way using priorities
B2
1
B1
0
![Page 22: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/22.jpg)
22
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities
• Agent that resolves requests from other agents.– Some requests requires more attention that
others
Listener
![Page 23: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/23.jpg)
23
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities. Solution
• Encapsulate each new Behaviour inside a ParallelPriorityBehaviour
Listener
1
P1
P3
P2
P4
![Page 24: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/24.jpg)
24
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities
• Agent that uses its full time
– In normal time, it executes several specific tasks
– When it is idle (i.e. these tasks can not be executed)
it runs other tasks of maintenance.
Specific Tasks Idle Tasks
![Page 25: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/25.jpg)
25
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Need for priorities. Solution
• Use SequentialPriorityBehaviour to encapsulate specific and idle tasks
SequentialPriorityBehaviour
ParallelBehaviour [1] ParallelBehaviour [2]
Specific Task 1
Specific Task 2
Specific Task 3
Idle Task 1
Idle Task 2
Idle Task 3
![Page 26: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/26.jpg)
26
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
Summary
• Two new priority-based scheduler Behaviours are proposed– ParallelPriorityBehaviour– SequentialPriorityBehaviour
• They are able to run as the current scheduler implementations
• The use of priorities penalizes the performance of the scheduler
![Page 27: Integrating a Priority-Based Scheduler of Behaviours in JADE](https://reader033.vdocuments.site/reader033/viewer/2022060122/559508f41a28ab69068b4625/html5/thumbnails/27.jpg)
27
Inte
grat
ing
a P
rior
ity-
Bas
ed S
ched
uler
of B
ehav
iour
s in
JA
DE
ESAW’06
T ha n
ky o
uf o
r
y ou r
a tt e
n ti o
n
Integrating a Priority-Based Scheduler of Behaviours in JADE