Sunteți pe pagina 1din 12

Task Petri Nets for Agent based computing

P RAJNA D EVI U PADHYAY1 S UDIPTA ACHARYA2 A NIMESH D UTTA3

1 2
Indian Institute of Technology, Delhi, Indian Institute of Technology, Patna,
Department of Computer Science and Engineering, Department of Computer Science and Engineering,
New Delhi-110016, India Patna-800005, India
kirtu26@gmail.com sudiptaacharya.2012@gmail.com
3
National Institute of Technology,
Department of Information Technology,
Durgapur-713209, India
animeshrec@gmail.com

Abstract. Agent Based Computing is an emerging area of research for the last couple of decades. The
agents must be capable of maintaining the inherent dependencies between different tasks or handling
resource constraints while working together. There is a need of a formal tool that can represent this
autonomous behavior and task delegation property of agents. This paper proposes a new formal tool
called Task Petri Nets to represent the collaboration of agents in Multi agent system (MAS). A Task
Petri Nets is an extended Petri Nets tool which can represent the autonomous behavior of agents while
executing any task maintaining the happened before relationships and handling resource constraints.
It can also evaluate the performance of the system using three metrics- Total Execution Time, Agent
Utilization and Resource Utilization.

Keywords: Agent; Multi Agent System; Petri Nets; Task Assignment; Resource Constraint.

(Received February 23rd, 2013December 8th, 2010 / Accepted July 30th, 2013July 16th, 2011)

1 Introduction models the real world problem in a better way.


An agent is a computer system or a software entity
The history of computing has been marked by various which can act autonomously in an environment. Agent
ongoing trends [25]. Computing has become ubiquitous autonomy relates to an agent’s ability to make its own
due to availability and interconnection of large num- decisions about what activities to do, when to do, what
ber of processors. The aim of many theoretical works type of information should be communicated and to
has been to portray computing as a process of interac- whom, and how to assimilate the information received.
tion between humans and machines. The complexity Thus, an intelligent agent inhabits an environment and
of tasks that we are capable of automating and delegat- is capable of conducting autonomous actions in order
ing to computers has grown steadily. We are moving to satisfy its design objective [14], [18], [19], [24], [25].
away from machine-oriented views of programming to The environment is the aggregate of surrounding things,
ideas that more closely reflect the way we understand conditions, or influences with which the agent is inter-
the world. The advancement from assembly level pro- acting. Information is percepted by the agent and so this
gramming to procedures and functions and finally to ob- information is also called ’percepts’. The agent works
jects has taken place to model computing in a way we on the percepts in some way and produces ’actions’ that
interpret the world. But there are some inherent limita- affect the environment.
tions in an object which makes it incapable of modeling Multi agent systems are computational systems in
a real world entity. Therefore we move to agents, which which two or more agents interact or work together to
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 25
perform a set of tasks or to satisfy a set of goals [15], 2 Related Work
[23], [25]. Agents of a multi agent system need to in-
teract with each other to fulfill their common or individ- There has been a wide spectrum of research work in the
ual objectives. A multi-agent system can be studied as area of Multi Agent Based Computing. Most of these
a computer system which is concurrent, asynchronous, are concerned with the task assignment problems, de-
stochastic and distributed. A multi agent system allows termining the assignment of tasks to agents keeping in
coordinating the behavior of agents which are interact- mind the constraints associated with them. In [27] au-
ing and communicating in an environment. It allows the thors consider a problem where only a specific num-
decomposition of complex task into simple sub-tasks so ber of agents can perform a certain task. This means
that the problem can be addressed at a more granular the problem is agnostic to the actual coalition serving
level. a given task and that their algorithm considers a much
Petri Nets and Color Petri Nets [5] are graphical smaller search space. Also, they assume a central plan-
tools for the formal description of systems whose dy- ner that allocates tasks to agents i.e they follow a cen-
namics are characterized by concurrency, synchroniza- tralized method. Similarly, in [4] authors use a cen-
tion, and mutual exclusion, which are typical features tralized mechanism based on random neural networks
of distributed environment. A Basic Petri Net structure to allocate responders to perform a number of rescue
is a tuple, P N = (P, T, I, O, T OK) where tasks. The drawback of using centralized method in pa-
per [27] and [4] is overcomed in [10], where authors
• P ={p1, p2, . . . , px}, where x≥ 1, is a finite set of consider completely decentralized solutions to an al-
places. location problem which considers teams of agents but
ignores the spatial constraints and show how differ-
• T ={t1, t2, . . . , ty}, where y≥ 1, is a finite set of
ent DCOP formulations of the problem result in differ-
transitions, P ∩ T = ∅ i.e., the set of places and
ent degrees of computational and communication effi-
transitions are disjoint.
ciency when used with typical DCOP algorithms such
• I: P → T is the Input Arc, a mapping from places as ADOPT [12] or DPOP [16]. Authors of paper [20]
to bags of transitions. and [3] have applied DCOP and other decentralized
heuristics to the general assignment problem (GAP).
• O: T → P is the Output Arc, a mapping from Now, while these approaches consider heterogeneous
transitions to bags of places. agents (i.e., agents with different capabilities) and ex-
• T OK = {T OK 1, T OK 2, . . . , T OK z }, where z≥ ecution constraints for tasks (e.g., two tasks that must
1 is a finite set of dynamic markings on places. be executed at the same time), they ignore the bene-
fit of forming coalitions of agents (i.e., with synergistic
Our work proposes a new formal tool called Task capabilities) to work on the same task. Problems of ne-
Petri Nets which represents the autonomous behavior glecting spatial constraints in [10] and benefit of form-
of the agents in a Multi Agent System. The MAS con- ing coalitions of agents in [20] and [3] are overcomed
sists of a number of agents with different capabilities in [17], where authors model the RoboCupRescue do-
and according to the requirement, each task should be main in terms of a Coalition Formation with Spatial and
assigned to some capable agent. Initially, a user query Temporal constraints. Here a set of agents, such as res-
is submitted to the MAS. This query is mapped to a task cue agents in search and rescue, must work together to
by an interface agent. The interface agent also decom- perform a set of tasks, often within a set amount of
poses this task into a number of sub-tasks and deter- time. Authors provide a Distributed Constraint Opti-
mines the happened before relationships and resource mization Problem formulation of the problem and show
requirements of the sub-tasks. But, all the sub-tasks how to solve it using the Max-Sum algorithm. Based
cannot be executed concurrently because of the exis- on this, they develop the novel F-Max-Sum algorithm
tence of some inherent dependencies and some resource that improves upon Max-Sum in order to deal with dis-
constraints. Thus, the paper addresses the problem of ruptions in its underlying factor graph more effectively.
task assignment with a set of constraints and suggests a This paper lacks of expressing the fact that how task
formal solution for the same in the form of Task Petri allocation can be done such in a way where agent will
Nets. The Task Petri Nets model helps to analyze the complete all tasks in minimum time which is shown in
performance of the system with the help of three met- [8]. In this paper authors propose a distributed algo-
rics. A case study has been modeled with Task Petri rithm to get efficient distribution of tasks across hetero-
Nets, the scenario has been simulated and measured geneous agents. Each task has an execution time which
performance with the help of MATLAB tool. is different if different agents execute them. Here it is
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 26
assumed that run time to perform a task by an agent behaviour of an agent in a Multi Agent System. Here,
is known initially. Authors have shown how to assign each token of a place represents an agent and the tran-
tasks to agents to finish all tasks in minimum time. But sition is capable of a set of functions that describes, in
it is not realistic to know the execution time taken by particular, the condition of its firings and relations be-
different agents in different environments to complete tween the agents. There are Predicate Transition Nets
a task before their actual execution. Also, the inher- [26], [13] which are a high level formalism of Petri Nets
ent dependencies between the tasks are not considered for modeling and analyzing Multi Agent behaviors. In
which may not allow the tasks to be executed concur- Multi Agent Systems, plans are built to specify how a
rently. The paper lacks to evaluate the performance set of agents accomplish their individual or common
of the system. Methodology described in [7] presents goal. Predicate Transition Nets allow us to make sure
scheduling algorithms on unrelated parallel machines. that the plans are reliable.
A novel distributed algorithm for multi agent task al-
location problems is proposed in [9] where the sets of 3 Scope of Work
tasks and agents constantly change over time. But both
in paper [7] and [9] the inherent dependencies between The work done so far is concerned with task assign-
tasks are not considered which is considered in paper ment problems i.e. assigning a set of tasks to a set
[21]. Here authors have considered dependencies be- of agents in MAS considering the constraints associ-
tween tasks and defined a dynamic ontology for coor- ated with each agent. But few authors have consid-
dination among agents in the MAS. They have defined ered the dependencies between the tasks and resource
different types of dependencies between tasks based on constraints together for task assignment in MAS. Petri
happened before relationship and resource constraints. Nets are chosen to model this scenario because they are
But, the task delegation and autonomous properties of best suited to model the features of a distributed system.
agents are not shown explicitly to solve the problem. But, the existing Petri Net tools are incapable of doing
so, so there is a need to extend its features. In this paper,
There are many forms of Petri Nets proposed over we propose Task Graph to represent the dependencies
the years which serve specific purposes of a Multi between the tasks and Task Petri Nets to model the task
Agent System. A Color Petri Net is a high level assignment problem. A Task Petri Nets is an extended
Petri Net which provides a graphical oriented lan- Petri Nets capable of representing agent autonomy and
guage for design, specification, simulation and verifi- task delegation property. It can also evaluate the perfor-
cation of systems. It is in particular well-suited for mance of the system using some metrics whose values
systems consisting of a number of processes which can be obtained from the tool itself.
communicate and synchronize. It is a combination of
Petri Nets and programming language where Petri Nets 4 System Model
control the structures, synchronization, communication
while functional programming language describes the A Multi Agent System can be formally stated
resource sharing and data manipulation. It allows the set of tuples M AS = (S, t, A, inst_A, Q, T, G, R,
definition of different data types for the tokens describ- inst_R, gen_task, gen_goal, req_res, able) where
ing data manipulation, and for creating compact and pa- each tuples are described in detail below,
rameterizable models. Petri Nets and Color Petri Nets
have been widely used to describe the Multi Agent Sys- • S = {si | 1 ≤ i ≤ u }, where si is a state of the sys-
tems for a long time. Color Petri Nets have been used tem. Therefore S is a set of states of environment.
in [1] to achieve agent scheduling in open dynamic en-
• t = {t1, t2, . . . , tn}, each ti, 1≤ i ≤ n, is an atomic
vironments. The representation of composite behaviors
task which the agents in the system are capable of
through Color Petri Nets have been done in [6]. In [2]
performing.
Petri Nets have been used to model the abstract archi-
tecture for intelligent agents and structural analysis of • A = {a1, a2, . . . , ap}, be the set of agents in the
the net provides an assessment of the interaction prop- system. Each ai, 1≤ i ≤ p, is a type of agent in
erties of Multi Agent Systems. Deadlock Avoidance in the system.
Multi Agent System is considered and is evaluated us-
ing the liveness and boundedness property of the Petri • inst_A is a function defined as: inst_A: A →
Net Model. Color Petri Net model is introduced to rep- N , A = set of agents, N = set of natural numbers
resent flexible agent interactions in [1] Agent Petri Nets inst_A defines the number of instances of each
[11] provides more importance to the internal state and agent available in the system.
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 27
• Q = {Q1, Q2, . . . , Qm}, where each Qi, 1≤ i ≤ • If a is the event of sending a message m in a pro-
m, is a query which the user may submit to the cess and b is the event of receipt of the same mes-
system. sage m by another process then a → b is also true.
A message cannot be received before it is sent or
• T = {T 1, T 2, . . . , T m}, where each T i, 1≤ i ≤ m, even at the same time it is sent, since it takes a
is a task, which is generated from a specific user finite, nonzero amount of time to arrive.
query, T i ∈ ϕ(t)
• Happened-before is a transitive relation i.e. If a →
• G = {g 1, g 2, . . . , g m}, where each g i, 1≤ i ≤ m,
b and b → c then a → c .
is a goal which is generated for each task require-
ment in the system. A goal is some set of states
achieved after successful completion of T i. g i ∈ ρ 5.2 Formal Definition of a Task Graph
(S) A task graph GT =(V t, E t) is an ordered pair consisting
of:
• R = {r1, r2, . . . , rq}, where each ri, 1≤ i ≤ q, is a
type of resource in the system. • A set V t={V t1, . . . , V ta}, where each V ti, 1≤ i ≤
a, is a vertex which represents a task ti ∈ T which
• inst_R is a function defined as: inst_R : R → N ,
should be performed.
R = set of resources, N = set of natural numbers.
inst_R defines the number of instances of each • A set E t={E 1, . . . , E b}, where each E i, 1≤ i ≤ b,
resource type available in the system. is an edge identified with an ordered pair of ver-
• gen_task is a function which maps each query to tices (V tm, V tn), which represents the happened-
a task and is defined as: gen_task : Q → T before relationship between two tasks identified by
those vertices.
• gen_goal is a function which maps each task to a
goal and is defined as: gen_goal : T → G Given a set of happened before relationships be-
tween tasks, we can form the task graph by listing all
• req_res is a function which maps each task T i ∈ the vertices representing the tasks and drawing a di-
T to a subset of (RXI), where I is the set of non- rected edge from V ti to V tj if the happened before re-
negative integers. lationship ti → tj exists in the set of happened before
req_res :T → ρ (RXI), each task is mapped to a relationships. Given two tasks ti and tj represented by
set of tuples indicating the resource and its number the vertices V ti and V tj respectively in the task graph,
of requirement. we can infer the following about them:

• able is a function which maps each agent ai ∈ A • If there exists a directed path from vertex V ti to
to a subset of t, So able : A → ϕ(t) V tj in GT , i.e. there exists a sequence of vertices
and edges starting from V ti and ending at V ti, we
5 Task Graph can say ti → tj .
A Task Graph is a formal representation of the • Two tasks ti and tj are concurrent if there is no
happened-before relationships between tasks. The hap- directed path either from V ti to V tj or from V tj to
pened before relationship is described in the following V ti.
sub-section.
• There are no circuits and self loops in a task graph.
5.1 Lamport Happened Before Relationship
If a and b are two events taking place in a system, the 6 Petri Nets model of the problem
expression a → b is read as ’a happened before b’, The existing Petri Net tool lacks for modeling this sce-
which means all processes agree that before occuring nario. So, a new tool called Task Petri Nets is proposed
event b, event a should occur [22]. The happened- which is described in following sections,
before relation can be observed directly in two situa-
tions: 6.1 Task Petri Nets
• If events a and b occur on the same process and the Task Petri Nets is an extended Petri Net tool which can
occurrence of event a preceded the occurrence of model a problem. It can be defined by set of tuples,
event b then a → b = TRUE T P N = (P, T R, I, O, T OK, F n)
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 28
• P = P is a finite set of places. It can be defined – tc: This transition fires if the task represented
by union of 8 number of places. So we can write by the token of corrosponding place P h is as-
P = (P t ∪ P h ∪ P c ∪ P e ∪ P f ∪ P r ∪ P a ∪ signed with an agent which is capable of per-
P d). Places P h, P c, P e, P f ∈ P exist for each forming it.
task already identified by the interface agent. The – te: This transition fires if all the resources re-
description of the different types of places are fol- quired by the task represented by the token
lows: of corrosponding place P c are allocated to it.
– P h: Here the presence of a token indicates – tf : This transition fires if the task represented
that the task represented by this place can by the token of corrosponding place P e is
run, i.e. all predecessor tasks that are re- completed.
quired to be completed before this task are – td: This transition is dynamically created
completed. when the agent assigned for the task repre-
– P c: Here the presence of a token indicates sented by the token of corrosponding place
that an agent has been assigned for the task P d decides to split the task further into sub-
represented by the token of corrosponding tasks. The subnet that is formed dynamically
place P h. consists of places and transitions all of which
are categorized as P d or td respectively.
– P e: Here the presence of a token indicates
agent and resources have been allocated for • I is the set of input arcs, which are of the following
the task represented by the token of cor- types,
rosponding place P h and the task is under
execution by the allocated agent. – I 1=P t X th : task checked for dependency.
– P f : Here the presence of a token indicates – I 2=P r X te : request for resources.
that the task represented by the token of cor- – I 3=P e X tf : task completed.
rosponding place P h has finished it’s execu- – I 4=P f X th : interrupt to successor task.
tion.
– I 5=P c X td ∪ I 1=P a X td ∪ I 1=P r X td
– P r: This place exists for each type of a re- ∪ I 1=P d X tf are input arcs of the subnet
source in the system. i.e. ∀ ri ∃ P ri where, formed dynamically.
ri ∈ R and 1≤ i ≤ q.
– P a: This place exists for each instance of an • O is the set of output arcs, which are of the follow-
agent in the system. i.e. ∀ ai ∃ P ai where ai ing types:
∈ R and 1≤ i ≤ p. – O1=thXP h: task not dependent on any other
– P t: Here the presence of a token represents task.
initially identified task by the interface agent – O2=tcXP c: agent assigned.
.
– O3=teXP e: resource allocated.
– P d: This place is created dynamically after
– O4=tf XP r: resource released.
the agent has been assigned for the task(in
place P c) and the agent decides to divide the – O5=tf XP f : Task completed by agent.
tasks into subtasks. For each subtask, a new – O6=tf XP a: agent released.
place is created.
– O7=tdXP d: output arcs of the subnet formed
• T R is the set of 5 transitions which can be repre- dynamically.
sented as, T R = (th ∪ tc ∪ te ∪ tf ∪ td). where • T OK is the set of color tokens present in the
th , te , tf exist for every task identified by the in- places of Petri net. So we can write, T OK =
terface agent. The description of different types of {T OK 1, T OK 2, . . . ,T OK X }, where each T OK i
transition is as below, where 1≤ i ≤ X, is associated with a function
– th: This transition fires if a task represented assi_tok defined as:
by the token of place P t is enabled i.e. all the assi_tok: T OK → (CategoryXT ypeXN ),
preceeding tasks which should be completed where, Category = set of all categories of to-
for the task to start are completed. kens in the system= {T, R, A }, T ype = set of all
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 29
types of each category i ∈ Category i.e. Type= • Construct places P ai for each type of agent aj , 1≤
{T ∪ R ∪ A }, j ≤ p, aj ∈ A. The number of tokens in P aj place
N is the set of natural numbers. is inst_A(aj ).
Let assi_tok(T OK i) = (category i, typei, ni).
• Construct places for each type of resource rk, 1≤
The function assi_tok satisfies the following con-
j ≤ p, rk ∈ R. The number of tokens in P rk place
straints:
is inst_R(rk). For each task i ∈ T ASK, add an
arc from,
– ∀T OK i (category i = R)→{(typei∈ R) ∧
(1 ≤ ni≤ inst_R(typei))} – place P t to transition thi and thi to place P hi.
– ∀T OK i (category i = A)→{(typei∈ R) ∧ – place P ci to transition tei and tei to place P ei.
(1 ≤ ni≤ inst_A(typei))}
– place P ei to transition tf i and tf i to place P f i.
– ∀ T OK i (category i = T ) → {(typei ∃ T ) ∧
(ni = 1) }. • For each task i, if there are ’n’ number of differ-
ent type agents (aj1, . . . , ajn) capable of perform-
assi_tok defines the category, type and number of ing it, construct ’n’ number of tci transitions (tci1,
instances of each token. tci2, . . . , tcin) and add arcs from P hi to all of them
• F n is a function associated with each place and and from the places (P aj1, . . . , P ajn) to transitions
token. It is defined as: (tci1, . . . , tcin) respectively. Add arcs from all tci
transitions (tci1, tci2, . . . , tcin) to place P ci.
F n: P XT OK → (T IM E X T IM E).
For a token T OK k ∈ T OK, 1≤ k ≤ x, • For all (rk, nk), where (rk, nk) ∈ req_res(task i),
add an arc(P r X te ) from P rk to tei. The weight
and place P i ∈ P , F n(P i, T OK k) = {(ai, aj )}, of the arc is equal to nk. Add an output arc(tf X
ai is the entry time of T OK k to place P i and aj P r) from each tf i to all P rk. The weight of the arc
is the exit time of T OK k from place P l. For a is equal to nk.
token entering and exiting a place multiple times, |
F n(P i, T OK k)| = number of times T OK k entered • From the task graph, if task i → task j , then add an
the place P i. arc (P f X th) from place P f i to transition thj .

6.2 Rules to construct Task Petri Nets • Create ’m’ number of tdi transitions (tdi1, tdi2, . . . ,
tdim) and add an arc (P c X td) from P ci to each
A Task Petri Nets can be created if the following infor- tdij , 1≤ j ≤ m, if the agent assigned to task i
mation is provided: wishes to divide task i into âmâ sub-tasks. Create
• An initial set of tasks, identified by the interface a place for each of âmâ subtasks. These places will
agent, called T ASK. be categorized as P d. Add arcs from each transi-
tion (tdi1, tdi2, . . . , tdim) to places (P di1, P di2, . . . ,
• The happened before relationships between the P dim) respectively.
tasks, described in the form of Task Graph.
• From each P dij place, the subnet is created in a
• The resource requirements of each task, task i ∈ similar way as the subnet is created from P ci place
T ASK. for task i. The subnet consists of P e, P f places
and te, tf transitions all categorized as P d and td
• The capabilities of the agents present in the sys- respectively. The resource requirements and the
tem. happened before relationships between the newly
Given this information, we can construct the Task Petri created tasks are determined by the agent dividing
Nets by following rules: the task. The petri nets is modified by adding such
places and transitions dynamically. The arcs are
• Construct place P t. It will represent the user’s added according to the rules described for a task i.
query mapped to a single task.
6.3 Metrics for Performance Analysis
• Construct places P hi, P ci, P ei, P f i and transitions
thi, tci, tei, tf i for each task i ∈ T ASK identified We define the following three metrics for performance
by the interface agent. analysis of the system. These are:
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 30
6.3.1 Total Execution Time 7 Comparison of Task Petri Nets with other
This metric gives the total execution time of the system. forms of Petri Nets
∀ T OK i, assi_tok(T OK i) = (T , typei, ni), There are other forms of Petri nets avaialble but they
F n(P h, (T , typei, ni)) = {(ap, aq) | ap is the time at have been found inefficient to model the task assign-
which token entered place P h and aq is the time at ment process. A comparison of some of these with Task
which token left the place.}. Petri Nets is given in Table 1. Task Petri Nets have been
compared with Color Petri Nets, Agent Petri Nets and
The start time of execution is the time at which the Predicate Transition Nets on the following areas
first task started, i.e. the minimum of the entry times to
P h place of all tokens. So, • Supports MAS
S t(Starting Time) = • Deals with Task Assignment
min{ap |(ap, aq) ∈ F n(P h,(T ,typei, ni))},
∀ T OK i, assi_tok(T OK i) = (T , typei, ni). • Evaluates Performance
The finish time of execution is the finishing time of • Capacity to model interactions between agents
the last task of the system. So,
F t(Finish time)=
max {ap | (ap, aq) ∈ F n(P h, (T , typei, ni))}, Table 1: Comparison of Task Petri Nets with other forms of Petri
Nets
where ∀ T OK i, assi_tok(T OK i) = (T , typei, ni).
Supports Deals with Task Evaluates Capacity to model
Type of Petri Nets
MAS Assignment performance interactions between agents
So, total execution time Color Petri Nets/
No No No No
Object Petri Nets
(T et) = max {ap | (ap, aq) ∈ F n(P h, (T , typei, ni))}- Agent Petri Nets Yes Yes No Yes

min{ap | (ap, aq) ∈ F n(P h, (T , typei, ni))}, ∀ T OK i, Predicate


Transition Nets
Yes Yes No No

assi_tok(T OK i) = (T , typei, ni)}. Task Petri Nets Yes Yes Yes Yes

6.3.2 Resource Utilization


8 Case Study
This metric determines to what extent each resource in
8.1 Problem
the system has been utilized. For each resource token
T OK i, assi_tok(T OK i)=(R, typei, ni), Consider the scenario where the user submits a query Q
F n(P r, (R, typei, ni))={(ap, aq) | ap to the system. The interface agent maps Q to a set of
is the entry time of this token to place P r, aq is the exit tasks. Let this set be T ASK = {a, b, c, d, e}. There
time of this token from place P r}, are two types of resources R = {r1, r2 }and three types
Total time for which a token resided at place P r is given of agents A= {a1, a2, a3}. There are 2 instances of r1
by: and r2 each and 3 instances of a1, a2, and a3 each. The
T pr= Σ (ap - aq), ∀(ap,aq) ∀ F n(P r, (R, typei, ni)) capabilities of the agents and the resource requirements
Total amount of time the resource was utilized of the tasks are defined as:
= (T et - T pr)/T et able(a1)={a };
= [1-(T pr/T et)] able(a2)={b, d}; able(a3)={e}.
req_res(a)={(r2, 2)};
6.3.3 Agent Utilization req_res(b)={(r1, 2)};
req_res(c)={(r1, 2), (r2,2)};
This metric determines to what extent each agent in the req_res(d)={(r2, 2)};
system has been utilized. For each agent token T OK i, req_res(e)= {(r1, 1), (r2, 1)}The happened before re-
assi_tok(T OK i)=(A, typei, ni), lationships between these tasks identified by interface
F n(P a, (A, typei, ni))={(ap, aq) | ap is the entry time agent are: a→ b; a → c; b→d; b→ e; c→ d
of this token to place
P a, aq is the exit time of this token from place P a}, 8.2 Model of the problem
Total time for which a token resided at place P r is given
8.2.1 Task Graph
by:
T ar= Σ (ap - aq), ∀(ap,aq) ∀ F n(P r, (A, typei, ni)) Figure 1 given below represents the task graph for the
Total amount of time the agent was utilized problem described in previous sub-section. Given a set
= (T et - T ar)/T et of happened before relationships, we construct the task
=[1-(T ar/T et)] graph as defined in the section 5.
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 31
a
70

65

b c
60

total execution time


55

d e 50

Figure 1: Task Graph for the problem 45

40
Pt Pa 2 2.5 3 3.5 4 4.5 5
TASK a1 a2 a3

no. of agents
th
Figure 3: Graph showing total execution time against no. of agents
Ph a b c d e

tc
execution time against the three parameters.
Pr
Pc a b c d e
r1 r2
Figure 3 shows the change of total execution time
against number of agents for a fixed number of tasks
2 2 2 2 2 and resources. 7 tasks are taken and random happened
te
before relationships are generated between them. There
are 10 types of resources each having 4 instances. The
Pe a b c d e
resource requirements of the tasks are also generated
randomly. There are 5 types of agents each having
2 2 2 2 2 instances initially. Their abilities are generated ran-
2
tf domly. Keeping the number of tasks and the number of
resources fixed, the number of instances of each agent
Pf a b c d e type is increased by 1 along the X-axis. The total ex-
ecution time for 2, 3, 4 and 5 number of instances of
agents is plotted in Figure 3. The number of agents
Figure 2: Task Petri Nets Model for the problem available in the system is a bottleneck as it determines
the number of tasks executing concurrently. If a task is
not dependent on any other task/tasks for execution, it
should be assigned to an agent. But, if all the agents
8.2.2 Task Petri Nets capable to perform that task are busy executing other
According to the rules described in section 6.2, we can tasks, the task cannot execute. So, the task has to wait
draw the Task Petri Nets based on the given set of tasks until a capable agent is free. From the graph, it is ob-
identified by the interface agent, their requirement of served that as the number of agents in the system in-
resources and the capabilities of agent. Figure 2 shows creases, the execution time decreases or remains same.
the Task Petri Nets for the problem described above. It is because as the number of agents in the system in-
creases, the tasks which could not be assigned to agents
due to their unavailability earlier are assigned due to
8.3 Simulation Results and Discussion
an increase in their number. So, number of tasks exe-
The above scenario is simulated in MATLAB. The cuting concurrently increases which decreases the total
value of one metric, total execution time has been cal- execution time. The total execution time remains same
culated and its variation studied over three parameters when the system achieves the maximum possible con-
1) number of tasks, 2) number of resources and 3) num- currency or the concurrency depends on the availability
ber of agents. The duration of each task is assumed to of resources.
be 10 sec. The following graphs show the change of Figure 4 shows the change of execution time against
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 32

60 90

59
85
58
80
57
total execution time

total execution time


75
56

55 70

54
65
53
60
52
55
51

50 50
3 3.5 4 4.5 5 5.5 6 5 6 7 8 9 10
no. of resources no. of tasks

Figure 4: Graph showing total execution time against no. of re- Figure 5: Graph showing total execution time against no. of tasks
sources

before relationships are generated between them. There


number of resources for a fixed number of tasks and are 5 types of agents each having 2 instances. Their
agents. 7 tasks are taken and random happened before abilities are generated randomly. There are 10 types
relationships are generated between them. There are 5 of resources each having 2 instances. The resource re-
types of agents each having 3 instances. Their abili- quirements of the tasks are also generated randomly.
ties are generated randomly. There are 10 types of re- Keeping the number of resources and the number of
sources each having 3 instances initially. The resource agents fixed, we increase the number of tasks by 1 along
requirements of the tasks are also generated randomly. X-axis. When a new task is added to the system, it is
Keeping the number of tasks and the number of agents either made independent or dependent on some other
fixed, we increase the number of instances of each re- task/tasks randomly. The total execution time for 5,
source type by 1 along the X-axis. The total execution 6, 7, 8, 9 and 10 tasks is plotted in Figure 5. If the
time for 3, 4, 5 and 6 number of instances of resource new task is dependent on previous task/tasks, then the
types is plotted in Figure 4. The number of resources execution time increases or remains same, otherwise it
available in the system is also a bottleneck as it deter- executes concurrently provided the agents and required
mines the number of tasks executing concurrently. If a resources are allocated. So, we get an increasing graph
task is not dependent on any other tasks for execution when we plot the total execution time against the num-
and it is assigned an agent, it should get the required ber of tasks.
resources to start execution. But, if all the resources re- Figure 6 shows the change in total execution time
quired are not available, the task cannot execute. It has against two parameters 1) number of tasks, 2) number
to wait until the requested resources are available. As of resources. There are 10 types of resources each hav-
we increase the number of resource instances in the sys- ing 5 instances initially. The resource requirements of
tem, the execution time decreases or remains same. The the tasks are generated randomly. There are 5 types of
reason is that as we increase the number of resources in agents each having 4 instances. Their abilities are gen-
the system, the tasks which could not execute due to erated randomly. The number of resources is increased
unavailability of resources can now execute due to their by 1 along Y axis i.e. 5, 6, 7 and 8 and number of tasks
increased availability. So, number of tasks executing is increased by 1 along X axis i.e. 5, 6, 7, 8, 9 and
concurrently increases which decreases the total execu- 10. The total execution time is plotted in Figure 6. It is
tion time. The execution time remains the same when clear from the graph that the execution time increases
the added resources are not utilized, i.e. the system al- or remains same when the number of tasks increases
ready achieves maximum possible parallelism. while decreases or remains same when the number of
Figure 5 shows the change of execution time against resources increased.
number of tasks for a fixed number of resources and Figure 7 shows the change in total execution time
agents. 5 tasks are taken initially and random happened against two parameters 1) number of tasks, 2) number
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 33
Figure 8 shows the change in total execution time
against two parameters 1) number of agents, 2) number
of resources. There are 10 types of resources each hav-
50 ing 2 instances initially. The resource requirements of
40
the tasks are generated randomly. There are 5 types of
total execution time

agents each having 3 instances initially. Their abilities


30
are generated randomly. The number of tasks is fixed
20 at 5. The number of agents is increased by 1 along Y
axis i.e. 3, 4, 5 and 6 and number of resources is in-
10
creased by 1 along X axis i.e. 2, 3, 4 and 5. The total
0
10
execution time is calculated and plotted in Figure 8. It
8 is clear from the graph that the execution time decreases
6
5
4
or remains same along both axes, when the number of
2 agents and resources increases.
no. of tasks 0 0
no. of resources

Figure 6: Graph showing total execution time against no. of tasks


and no. of resources
60

50
total execution time

40
of agents. There are 10 types of resources each having
30
3 instances. The resource requirements of the tasks are
generated randomly. There are 5 types of agents each 20

having 2 instances initially. Their abilities are gener- 10


ated randomly. The number of agents is increased by 0
6
1 along Y axis i.e. 2, 3, 4 and 5 and number of tasks
6
is increased by 1 along X axis i.e. 5, 6, 7, 8, 9 and 10. 4 5
4
The total execution time is plotted in Figure 7. Simi- 2 3
2
lar to the previous case, execution time increases or re- no. of resources 0 1
no. of agents
mains same when the number of tasks increases while
decreases or remains same when the number of agents
Figure 8: Graph showing total execution time against no. of agents
increases. and no. of resources

100
9 Conclusion

80
In this paper, a Task Petri Nets tool to address the task
total execution time

assignment problem in MAS is developed. It can rep-


60
resent agent autonomy and task delegation property. It
40 can also evaluate the performance of the system using
three metrics. This tool proves better than the existing
20
tools on grounds as described in Table 1 to model such
0 scenario. A scenario is simulated in MATLAB and the
10
5 value of one of the three metrics is measured. From
5 4 the results and discussion, we conclude that to reduce
3
2 the total execution time, we have to increase the num-
no. of tasks 0 1
no. of agents ber of tasks executing concurrently. This can be done
by increasing the number of agents or resources avail-
Figure 7: Graph showing total execution time against no. of tasks able in the system. Thus, the overall impact on the sys-
and no. of agents tem can be analysed with the help of this tool. The
future work is to develop a co-ordination mechanism
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 34
between agents to resolve resource conflicts to increase [10] Maheswaran, R. J., Pearce, J., and Tambe,
concurrency of tasks. It may so happen that some of M. A family of graphical-game-based al-
the agents will crash while executing some tasks. So, gorithms for distributed constraint optimization
the future work can also be to develop a fault tolerant problems. In Coordination of Large-Scale Multi-
system which will continue to work even if some of the agent Systems, Springer-Verlag, Heidelberg Ger-
agents crash while execution. many, pages 127–146, 2005.

[11] Marzougui, B., Hassine, K., and Barkaoui, K. A


References new formalism for modeling a multi agent sys-
[1] Bai, Q., Zhang, M., and Zhang, H. A coloured tems: Agent petri nets. J. Software Engineering
petri net based strategy for multi-agent schedul- and Applications, 3:1118–1124, 2010.
ing. In Proceedings of the Rational, Robust, and
Secure Negotiation Mechanisms in Multi-Agent [12] Modi, P. J. and et. al et. al, W. S. Adopt: Asyn-
Systems, 2005. chronous distributed constraint optimization with
quality guarantees. Artificial Intelligence Journal,
[2] Celaya, J. R., Desrochers, A. A., and Graves, R. J. 161, pages 127–146, 2005.
Modeling and analysis of multi-agent systems us-
ing petri nets. Journal of Computers, 4:981–996, [13] Murata, T. and Nelson, P. C. A predicate - transi-
2009. tion net model for multiple agent planning. Infor-
mation Sciences, pages 57–58, 361–384, 1991.
[3] Ferreira, P. R. and et. al et. al, F. S. Robocup res-
[14] Nilsson, N. J. Artificial intelligence: a new syn-
cue as multiagent task allocation among teams:
thesis. In Morgan Kaufmann Publishers Ltd.,
experiments with task interdependencies. In Au-
1998.
tonomous Agents and Multiagent Systems, 2009.
[15] Padgham, L. and Winikoff, M. Developing intelli-
[4] Gelenbe, E. and Timotheou, S. Random neural
gent agent systems- a practical guide. John Wiley
networks with synchronized interactions. Neural
& Sons, Ltd., 2002.
Computation, 20, pages 2308–2324, 2008.
[16] Petcu, A. and Faltings, B. Dpop: A scalable
[5] Jensen, K. Colored petri nets – basic concepts,
method for multiagent constraint optimization. In
analysis methods and practical use. Software en-
Proceedings of the Nineteenth International Joint
gineering, Springer-Verlag, Berlin, 1992.
Conference on Artificial Intelligence, pages 266–
[6] Jindian, S., Heqing, G., and Shanshan, Y. A 271, 2005.
coloured petri net model for composite behaviors
[17] Ramchurn, S. D. and et. al et. al, A. F. Decen-
in multi-agent system. In Proceedings of the IEEE
tralised coordination in robocuprescue. In The
Conference on Cybernetics and Intelligent Sys-
Computer Journal 53(9), pages 1447–1461, 2010.
tem, 2008.
[18] Rouff, C. and et. al et. al, M. H. Agent technol-
[7] Lenstra, J. K. and Tardos, D. B. S. E. Approxima- ogy from a formal perspective. Springer-Verlag
tion algorithms for scheduling unrelated parallel London Limited., 2006.
machines. In Proceedings of 28th Annual Sympo-
sium on Foundations of Computer Science, 1987. [19] Russell, S. J. and Norvig, P. Artificial intelligence:
A modern approach. In Pearson Education., 2003.
[8] Macarthur, K. S. and et. al et. al, M. V. De-
centralised parallel machine scheduling for multi- [20] Scerri, P. and et. al et. al, A. F. Allocating tasks in
agent task allocation. In Proceedings of Fourth extreme teams. In Proceedings of the Fourth Inter-
International Workshop on Optimisation in Multi- national Joint Conference on Autonomous Agents
Agent Systems, 2011. and Multi-Agent Systems, ACM New York, NY,
USA, pages 727–734, 2005.
[9] Macarthur, K. S. and et. al et. al, R. S. A dis-
tributed anytime algorithm for dynamic task allo- [21] Tamma, V., Aart, C., and et. al. et. al., T. M. An
cation in multi-agent systems. In Proceedings of ontological framework for dynamic coordination.
Twenty-Fifth Conference on Artificial Intelligence In Proceedings of 4th International Semantic Web
(AAAI), 2011. Conference. (ISWC 2005), 2005.
INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.
Upadhyay et al. Task Petri Nets for Agent based computing 35
[22] Tanenbaum, A. Distributed operating systems. In
Pearson Education., 1995.

[23] Vidal, J. M. Fundamentals of multi agent systems,


2007.

[24] Weiss, G. Multi agent systems: a modern ap-


proach to distributed artificial intelligence. In MIT
Press, 1999.

[25] Wooldridge, M. J. Introduction to multi agent sys-


tems, 2001.

[26] Xu, D., Volz, R. A., Ioerger, T. R., and Yen, J.


Modeling and verifying multi-agent behaviors us-
ing predicate transition nets. In Proc. of the 14th
International Conference on Software Engineer-
ing and Knowledge Engineering, pages 193–200.
ACM Press, 2002.

[27] Zheng, X. and Koenig, S. Reaction functions


for task allocation to cooperative agents. In Pro-
ceedings of the International Joint Conference on
Autonomous Agents and Multi-agent Systems AA-
MAS 08, pages 559–566, 2008.

INFOCOMP, v. 12, no. 1, p. 24-35, June 2013.

S-ar putea să vă placă și