0% found this document useful (0 votes)
51 views10 pages

Deadlock Avoidance For Multiple Tasks in A Self Organizing Production Cell

Uploaded by

soniathalavoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views10 pages

Deadlock Avoidance For Multiple Tasks in A Self Organizing Production Cell

Uploaded by

soniathalavoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

2020 IEEE International Conference on Autonomic Computing and Self-Organizing Systems (ACSOS)

Deadlock Avoidance for Multiple Tasks in a


Self-Organizing Production Cell
Joseph Hirsch, Martin Neumayer, Hella Ponsar, Oliver Kosak and Wolfgang Reif
Institute for Software & Systems Engineering, University of Augsburg, Germany
E-Mail: [email protected], {neumayer, ponsar, kosak, reif}@isse.de

Abstract—Deadlocks represent situations in which two par- instead of using conveyor belts can further increase the degree
ticipants are waiting for each other to finish an activity so of flexibility and automation [6].
that neither of them will ever finish. Deadlocks can occur in
Self-organizing production systems are also not tailored to
complex computer-integrated systems, such as flexible and self-
organizing production systems. As deadlocks bring production a specific type of product. Instead, self-organizing production
to halt, methods for deadlock control in production systems are systems consist of agents or machines offering capabilities
widely studied. Yet most algorithms proposed are not suited for such as milling or drilling and AGVs connecting those agents
the use in decentral multi-agent systems, as they require central as needed. We consider machines that process one product1
control or can not handle concurrency. Other algorithms can be
at a time while having no buffers. Products are described
used in a decentral fashion but assume that only one type of
product will be manufactured at a time. But in times of mass as a sequence of capabilities and given to the system. The
customization, where customers choose a product from a variety matching between the capabilities needed to manufacture the
of options, support for several product types is required. To type of product and the capabilities offered by the agents is
meet both the requirements of mass customization and decentral termed task allocation [2]. Task allocation is formulated as
multi-agent systems, we present a new decentralized approach
a Constraint Satisfaction Problem (CSP) [7] and solved at
for avoiding deadlocks in a self-organizing production cell, where
several types of products are being manufactured in parallel. runtime. We denote the result of task allocation as product
Our approach is based solely on local knowledge and does not flow. Task allocation at runtime has two main advantages:
assume central control. We evaluate our approach in terms of 1) Robustness: A self-organizing production system can
effectiveness and message overhead to conclude that it avoids
starvation and deadlocks with a reasonable message overhead. deal with partial breakdowns by detecting faults, finding,
Index Terms—deadlock avoidance, decentral mechanisms, self- and implementing a new task allocation.
organization, production systems, multi-agent systems 2) Flexibility: Self-organizing production systems offer
flexibility in terms of the product manufactured. As long
I. I NTRODUCTION as the needed capabilities for a new type of product
exist in the system, new task allocations can be found
Mass production systems are tailored to produce one prod- by solving the corresponding CSP.
uct in high quantities. The machinery used is highly special-
ized for its operation and rigidly linked. As every machine However, the shift towards finding a task allocation at
performs only one specific task before the product is handed runtime, instead of design time, yields the problem of cycles
over to the next machine, cycles are prevented by design, as emerging. Cycles arise if an agent receives a product he has
they may become a bottleneck for throughput or yield hold- processed before, or if two different product flows are arranged
and-wait-conditions. While this design enables high through- in a circle. Cycles can then overflow with products and result
put and low costs, these traditional production lines are also in deadlocks, as demonstrated in Fig. 1. Cyclic arrangements
prone to failure and do not offer the flexibility to manufacture should be avoided in the first place as they may lead to
different types of products at once [1]. Due to rigid linkage, inefficiency and the hazard of deadlocks. However, this is not
often realized with conveyor belts, the breakdown of a single always possible, assuming limited redundancy of machinery
machine or conveyor might bring the whole line to halt. and capabilities per machine. In cases of agent or component
failures, there could no longer be any task allocation left that
With mass customization, small lot sizes, and ever-
prevents cyclic arrangements. Even in such a state, production
increasing cost pressure, production systems are about to
should continue to ensure the desired robustness.
change [2]. Manufacturers strive for flexible automation to pro-
vide customers with just the product they need while keeping In this paper, we present a new approach for preventing
production costs low [1]. Self-organizing production systems deadlocks in a decentralized, self-organizing production cell,
represent an approach to meet these requirements. Modeling where several products are being manufactured in parallel. To
production systems as a set of self-organizing agents offers prevent deadlocks, the approach detects cycles in the product
a way to increase autonomy, responsiveness, and openness flow whenever the configuration of the system changes. For
[3]. Self-organizing production systems also leverage decentral 1 We refrain from using the word resource as it is ambiguous in the
control to ensure scalability [4] and robustness [5]. Connecting manufacturing domain and can serve as a term for a machine as well as
production agents with automatically guided vehicles (AGVs) for a product [2].

978-1-7281-7277-4/20/$31.00 ©2020 IEEE 178


DOI 10.1109/ACSOS49614.2020.00040

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
presented AGV 1 and Agent 1 hold blue products, while Agent
2 and AGV 2 hold orange products.
This arrangement is problematic: AGV 1 cannot pass on the
product it holds to Agent 1, as Agent 1 also holds a product.
Yet Agent 1 cannot pass on its product to AGV 2, as AGV 2
holds a product. This pattern continues until we reach AGV 1
again. As every participant is waiting for another participant
in a way that none ever finishes, a deadlock emerges and the
production halts.

B. Deadlocks
Formally, deadlocks are situations where two or more
participants are waiting for another to finish in a way that
no one ever finishes. Coffman et al. describe four conditions
that have to be met for a deadlock to occur [9]:
1) Mutual exclusion: Two participants can’t use the same
resource at the same time.
2) No preemption: Participants keep their resources until
their computing finishes. Under no circumstances, re-
sources are removed from the participants forcibly.
3) Hold and wait: Participants can wait for a resource if
they already hold another one.
Fig. 1. A production system, consisting of two agents and two AGVs,
encounters a deadlock caused by two opposing product flows. As every agent 4) Circular wait: The participants wait relationships are
and AGV is holding a product while cyclically waiting for another agent or arranged in a circle so that each participant waits for
AGV, the system comes to a halt. another one to release a resource.
We assume the first three criteria are met in self-organizing
each cycle, the maximum permissible number of products production systems. Circular wait situations might arise de-
is calculated and then enforced at runtime. This approach pending on the arrangement of agents, as pointed out in the
extends previous work done in [8]. It supports multiple types motivating example in Fig. 1. Especially after partial failures
of products and is based solely on local knowledge. of the system, there may be no arrangement of agents left,
The remainder of this paper is structured as follows: In which is both free of cycles and able to keep up production.
Section II, we introduce a motivating example and review Consequently, a mechanism to deal with deadlocks is needed.
the fundamentals of deadlocks and dealing with deadlocks.
Section III examines previous work and other approaches C. Dealing with deadlocks
towards the problem. In Section IV our approach is explained.
Coffman et al. [9] distinguish between three approaches to
We evaluate our approach in terms of messages sent and
deal with deadlocks:
effectiveness in Section V. We conclude this paper with future
a) Deadlock prevention: The approach of designing a
work and further research directions in Section VI.
system in a way that no circular wait situations can emerge
II. P ROBLEM D EFINITION because no product flow contain any cycles and product flows
In this section, we present a motivating example to illus- are not arranged in cycles. Prevention of deadlocks results in
trate how deadlocks can emerge in self-organizing production a system that is deadlock-free. But the design requires global
systems. To better understand the phenomenon of deadlocks, knowledge about the product flows and the arrangement of
a formal introduction into deadlocks and deadlock control is agents within it. In scenarios, where only task allocations
given. Finally, we lay out the requirements for a possible exist that yield cyclic arrangements, no task allocation can
solution and match these requirements with the methods for be implemented. This contradicts our motivation to continue
deadlock control presented before. production as long as possible.
b) Deadlock detection and recovery: This approach does
A. Motivating example not prevent deadlocks in the design of the system. Instead,
Consider the motivating example depicted in Fig. 1: Assume the system detects deadlocks at runtime and recovers from
a production system consisting of two processing agents and them. In general, this approach yields a higher utilization of
two AGVs, where there are two types of products to be the system. Yet, deadlock recovery is a non-trivial challenge,
manufactured. While the blue products (dashed product flow) especially when not only computer processes and data but also
require processing by Agent 1, the orange products (solid physical objects such as products are affected. Therefore, we
product flow) have to be processed by Agent 2. In the situation concentrate on a third approach.

179

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
c) Deadlock avoidance: The goal of deadlock avoidance An adequate system configuration that satisfies all given tasks
is to prevent the system from reaching a deadlock at runtime. need to include corresponding roles for each capability of
This is achieved by monitoring the product flow and using the each task. The roles must be distributed among the agents
knowledge about the future behavior of each agent to detect in a way that each capability of the task is met and that a
circular wait situations before they emerge. The advantage of valid product flow is represented by matching pairs of pre-
this approach is a system that can adapt to different situations and postconditions.
while having a high utilization of the available agents. There As an example, let’s consider the system lined out in Fig. 1:
is no need for the recovery of deadlocks, but communication Agent 1 might have a role, that tells him to take products for
between the agents might be required. a given task and state from AGV 1 (its precondition port),
perform one or several capabilities on the product and hand
D. Problem Statement
the product over to AGV 2 (its postcondition port). AGV 2
In summary, deadlocks can appear in production systems, then must have the corresponding role that has Agent 1 as its
when there are circular wait situations. These circular wait precondition port.
situations are the result of cyclic arrangements of agents. Yet, b) Specification of a system: In the ODP a system is
in self-organizing production systems, cyclic arrangements specified using sets: Each system consists of a set of agents.
cannot be ruled out, as the product flow is determined at An agent has a set of capabilities that it can apply and a set of
runtime. Therefore, an approach for dealing with deadlocks roles allocated defining the function of the agent in the system.
is required. The tasks are defined by the conditions that are stored in the
As deadlock prevention approaches inhibit cyclic arrange- roles of the agents.
ments of agents, these approaches rule out configurations that c) Processing of products: To keep the system running
could keep up production. This contradicts our motivation to and process products according to their tasks, each agent
manufacture products as long as possible. Deadlock recovery checks two things periodically:
approaches are not further considered in this paper, as recover- 1) If it has any input requests meaning another agent
ing from deadlocks involving physical products is beyond the finished applying its capabilities to a product and wants
scope of this work. Therefore, to solve the problem presented, to hand it over to the agent. In this case, the agent
a decentral deadlock avoidance approach inhibiting circular chooses a role which precondition fits one of the input
wait relationships is suited. requests and executes this role.
Besides the functional requirement of avoiding deadlocks in 2) If it has any producer roles. A producer role has a
production with different types of products, the approach has capability list that consists of or starts with a so-called
to match the decentral nature of multi-agent systems and allow produce capability, which adds a product to the system,
for concurrency. Lastly, the message overhead to provide the e.g., by taking it out of storage. If a producer role exists,
aforementioned functionality should be as low as possible. the agent chooses one randomly and executes it.
III. R ELATED W ORK B. Deadlock control in production systems
A. The Organic Design Pattern (ODP) Dealing with deadlocks in production systems is a well-
Self-organizing production systems in this paper are spec- known and widely studied problem. Therefore, only a fraction
ified and modeled using the Organic Design Pattern (ODP), of the available literature is covered in this paper. For a
described in [10] and [11]. The relevant parts of the pattern are comprehensive survey of graph-theoretic, automata-based, and
described in the following paragraphs. For more information, Petri Net approaches for controlling deadlocks in production
please refer to the cited sources. systems refer to [12]. For a survey on detecting deadlocks in
a) Definitions: The active participants of the system are distributed systems, see [13].
called agents, while products are processed by the agents. In In [14] and [15], Petri Nets are used to generate a restriction
contrast to previous work, we refrain from using the term policy to avoid deadlocks in Flexible Manufacturing Systems
resource as it is ambiguous in the context of manufacturing (FMS). Both approaches require a global view of the system
systems [2]. The blueprint on how to manufacture a product to generate these restrictions, therefore they are not suitable
is called task. A task consists of a set of capabilities in a for distributed systems.
specified order. The task’s state specifies which capabilities Another approach is presented in [16] and [17]. The authors
were already applied and which capability has to be executed introduce an algorithm that leverages global knowledge about
next. To meet the required capabilities of a product, each agent the system to detect cycles in the graph representing the
has a set of capabilities it can provide. The concept of a role working procedures (tasks). For each event in the system (i.e.
encompasses three aspects: a new product is created or transmitted to another agent) a
1) A precondition that includes an agent to take products central controller unit determines which transactions are save
from, called port, as well as the product’s task and state. to execute in the next step. Due to the required central control,
2) A set of capabilities to apply to the product. this approach is also not applicable to distributed systems.
3) A postcondition that comprises an agent to pass products A distributed cycle detection algorithm is presented in [18].
on to (port), as well as the product’s task and state. It makes use of messages, traveling along the edges of a graph.

180

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
Messages are forwarded until they return to the agent that has b) Entrance agents: An entrance agent (of a cycle) has at
sent the message or they hit a sink and can’t be forwarded least one role that places a new product into the cycle. Agents
further. Although the authors present a well-designed and can detect whether they are an entrance agent locally. An agent
lightweight algorithm, it is only capable of deciding if a given is a potential entrance agent, if the following condition does
agent is in a cycle. The algorithm cannot determine the agents apply:
in the cycle or the cycle’s size, which is essential for deadlock
avoidance. ∃(r1 , r2 ) ∈ roles × roles :
In [8], the authors discuss deadlock avoidance for systems r1 .precondition.port = r2 .precondition.port
modeled with the Organic Design Pattern (ODP). An algorithm ∨ r1 .postcondition.port = r2 .postcondition.port
for distributed systems without central control or knowledge
is introduced. The algorithm is based on cycle detection and An agent is an entrance agent to a cycle c if the following
controlling the resource flow at runtime. However, systems condition applies:
with multiple tasks being processed at the same time are not
considered and left as future work. ∃r ∈ roles : r.postcondition.port ∈ c
∧ r.precondition.port ∈/c
IV. A PPROACH
In [19] and [20], Wysk et al. study the detection of dead- The other agents in the cycle, however, don’t know the agent’s
locks in manufacturing systems. The authors elaborate on the roles so they need to be informed, that the agent is an entrance
idea of circular wait relationships in production systems. They agent.
prove that the following two conditions must be met for a
deadlock to occur: A. Cycle detection
1) There exists at least one cycle in the product flow graph Each agent stores the set of cycles it is involved in along
2) Each agent in the cycle has to be occupied by a product with the entrance agents. To reduce the message overhead,
In the introduction, we have pointed out that cycles cannot cycle detection is split into two steps.
be completely avoided, therefore in this section, we propose
a decentral deadlock avoidance approach, that addresses the Data:
second condition and ensures that the number of products in roles : the roles assigned to agent a
each cycle is lower than the number of agents in the cycle at MR : the cycle detection messages that a has to receive
any time. To realize this behavior, our approach consists of cycles : the cycles stored by a in its context
two steps. for (r1 , r2 ) ∈ roles × roles do
1) Whenever the configuration of the system changes, e.g., if r1 .postcondition.port = r2 .precondition.port
because a new type of product enters or an agent breaks then
down, cycle detection will be performed. If a cycle is c ← new Cycle
detected, the algorithm determines how many products c.agents ← [a, r1 .postcondition.port]
are allowed to enter. c.maxP roducts ← 1
2) At runtime, the agents keep track of the number of Add c to cycles
products that are currently in each cycle in a product Call Alg. 3
counter (pc). They enforce the limits calculated in cycle end
detection by coordinating the agents that are entrances end
and exits of the cycles. In the following, this step is if a is a potential entrance agent then
referred to as enforcing the limits for products in MR ← []
cycles. for r ∈ roles do
Before cycle detection and enforcing the limits for products m ← new cycle detection message
in cycles are explained in detail, some basic definitions are m.originalSender ← a
introduced. m.isCycle ← T rue
a) Cycles: Cycles are groups of agents, each of which m.f orks ← []
can only contain a certain number of products to avoid m.cycle ← new cycle
deadlocks. This also includes cycles that are not directly m.cycle.agents ← [a]
identifiable in the production plan, but are detected by the m.cycle.maxP roducts ← 0
combination of cycles. Further detail will be given later on. Add m to MR
For cycles the following information is stored: The agents that Send m to r.postcondition.port
are part of the cycle, the tasks that are responsible for the cycle, end
the maximum number of products that the agents in the cycle end
can handle without overloading it (maxP roducts) and if the Algorithm 1: Start of the cycle detection.
cycle was detected by combining other cycles.

181

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
Data: t1
m : the cycle detection message received by agent a a1 a2
MR : the cycle detection messages that a has to receive t2
roles : the roles of agent a
cycles : the cycles stored by a in its context Fig. 2. Cycle with two involved agents. This cycle can be detected without
message overhead, based on local knowledge.
if a = m.originalSender then
if m.isCycle then
Add m.cycle to cycles
Call Alg. 3
end
Add all m.f orks to MR
if received all MR then
finish cycle detection and start production
end
end
else
nextAddressees ← []
for r ∈ roles do
if r.postcondition.port ∈
/
m.cycle ∨ r.postcondition.port = Fig. 3. Cycle detection messages. Agent α1 is possibly an entrance agent
to a cycle because of its roles of the two tasks which are depicted in yellow
message.originalSender then and blue. It initiates a cycle detection message with the identifier #1. This
add r.postcondition.port to message is forwarded along the product flow. Agent α3 splits the message
nextAddressees to message #1 and message #1.1. Message #1 eventually returns to agent α1
with the information that it does not represent a cycle but that this message
end has been split and that the sender has to wait for message #1.1. As agent α1
end receives message #1.1 it knows about the cycle since it was the origin of the
if nextAddressees is empty then message.
m.isCycle ← F alse
Send m to m.originalSender
end 2) Cycle detection based on the analysis of the product
else flow graph: Cycles with more than two agents are detected
Add a to m.cycle.agents by sending messages along the product flow. Fig. 3 gives
m.cycle.maxP roducts ← an overview of this process. Agents send out and forward
m.cycle.maxP roducts + 1 detect cycle messages. Alg. 1 shows how and when messages
copies ← Create |nextAddressees| − 1 copies are created, Alg. 2 explains how agents react when receiving
of m a message. These messages include a set of agents that
Add all copies to m.f orks forwarded the message. Each agent forwarding the message
Send m to first agent of nextAddressees adds itself to this set, before passing the message on. If the
Send copies to other agents of message returns to its sender, the sender is part of a cycle,
nextAddressees and the set of forwarding agents is equal to the agents in the
end cycle.
end a) Agents that send out cycle detection messages: To
Algorithm 2: Receive and forward a cycle detection further reduce the number of messages sent, only potential
message. These steps are performed whenever agent a entrance agents send out cycle detection messages. To check
receives a cycle detection message. if an agent is a potential entrance agent, it analyzes its roles
in pairs. If the agent has two roles with different pre- or
postcondition ports, it is a potential entrance. In contrast, an
agent with only one role or the same pre- and postcondition
1) Cycle detection based on local knowledge: With its port for all roles can’t be an entrance-agent. An entrance
local knowledge, an agent detects all cycles it is involved in agent has to have at least two different pre- and postcondition
consisting of only two agents. If the agent receives a product combinations thus two roles: One role has to be transporting
from another agent, it is also giving a product to, the agent is products within the cycle or out of the cycle and one has to be
in a cycle with the other agent, meaning that only one of them transporting products into the cycle. If the agent is a potential
can accept a product at a time. Fig. 2 shows a cycle like this. entrance agent, it is sending out a detect cycle message to
Both agents are entrance agents to the cycle. These cycles are every postcondition port of every role.
based on opposing tasks, so they are referred to as encounter b) Receiving and forwarding detect cycle messages: If
cycles in the following. a detect cycle message is received, the agent checks if it is

182

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
the origin of the message. If the agent is not the origin of is the case, the agent sends a inform entrance message
the message, it forwards the message to all of its successive to all agents in the cycle to inform them about it.
agents according to the product flow. To prevent infinite 3) Check for combined cycles
looping messages, they are only forwarded under the following The agent checks its stored cycles and the new cycle
condition: Either the postcondition port of the role is the in pairs if a role exists, which transfers a product from
message’s original sender or the postcondition port is not yet one to another cycle. If a role like this exists, the cycles
in the set of agents of the cycle stored in the message. If the need to be combined to a bigger cycle because both
message has to be forwarded to more than one agent, it is cycles depend on each other. To remove a product of one
split into multiple messages which we refer to as forks. The cycle, the other one has to have space for the product.
identifiers of the forks are stored in the original message so Fig. 4 shows two different types of cycles, where the
the agent that initiated the message knows for which forks to second one is detected by combining cycles. Whenever
wait. When forwarding a message, the agent adds itself to the two cycles are combined, the set of agents, as well as
set of agents stored in the message because if the message the set of tasks, are merged. The capacity maxP roducts
returns to the original sender, the agent is part of the deadlock of the new cycle is calculated in step 4. Therefore, the
cycle the message represents. If all the postcondition ports of new combined cycle is stored without removing the old
the agent’s successive roles are in the set of agents already, cycles and the agent proceeds to do all the checks of
the message is running in a loop and the corresponding cycle this list for the new cycle.
has been detected before, so the message is returned to the 4) Calculate the maximum number of products of each
original sender with this information. cycle
If the agent is the source of the message it receives, it stores The calculation of the maximum number of products
the message and checks if it received all messages and all forks in the cycles is mainly done when detecting them: If an
of the messages it has initiated. agent creates a detect cycle message, it initiates the cycle
3) Processing the cycles: Whenever a cycle is stored, a with maxP roducts = 0. Each agent that is added to the
series of tests, which are described in the following, is applied. cycle then increases maxP roducts by one. Encounter
Alg. 3 summarizes these tests. cycles are stored with maxP roducts = 1. Following
this algorithm, the maximum number of products for
Data: each cycle c is |c| − 1, where |c| is the number of agents
c: the new cycle detected in the cycle. If some cycles are nested, maxP roducts
cycles : the cycles stored by a in its context has to be adjusted. To calculate the final value for
c.maxP roducts it is necessary to check if other cycles
if nested cycles are contained in c then are contained in c, meaning that the cycle’s agents are a
Inform every agent of c about all nested cycles
subset of the agents of c. If there is a product in a cycle
inside c
cin that is inside cycle c, all agents of cin are reserved
end
for that product, while the present calculation assumes
if agent is entrance agent of c then
that a product only occupies one agent. If that is the
Inform every agent of c about the entrance agent
case, c.maxP roducts has to be decreased: Let c be the
end
cycle observed and C in the cycles inside of c that are
if another cycle exists, which the agents transports
not combined cycles. Then following formula applies:
products into when transporting them out of c then
Combine the cycles c.maxP roducts = |c.agents|+
 
end    
in  in 
for c ∈ cycles do c .maxP roducts −  c .agents −
 in in 
Recalculate c .maxP roducts in
c ∈C

in c ∈C

end  

 
Remove unneccessary cycles from cycles  ci .agents ∩ cj .agents
in in

Algorithm 3: Tests when agent a detects a new cycle. (cin ,cin )∈C in ×C in 
i j

This calculation is evaluated for every cycle whenever


1) Check for cycles contained in the new cycle a new cycle is detected. The detection of a new cycle
If a cycle cin is contained in another cycle c it is could have an impact on already known cycles e.g., if
important that all the agents of c know cin for step the new cycle is nested inside a known cycle.
5 (calculating maxP roducts). If an inner cycle is 5) Check for unnecessary cycles
detected, the agent informs all the agents in c that aren’t The agent checks for all of its cycles if a combination
in cin about cin . of cycles (cin , cout ) exist so that cin is contained in cout
2) Check if the agent is an entrance agent of the new and cin .maxP roducts ≥ cout .maxP roducts. Cycle
cycle cin then gets removed from the cycle list because cout
The agent checks if it is an entrance to the cycle. If this is more restrictive.

183

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
wait for relationship cle is capable of handling another product (maxP roducts >
a3
pc) and sends back either an accepting message or a declining
production plan message. The necessity of take back messages is rooted
a1 a2
in the concurrency of the system. Ideally an announcement
should not be declined since the announcing agent should
a4
not have asked for permission in the first place because
(a) A cycle of wait for relationships because of a cycle in the of its local knowledge. Yet, problems arise, if two agents
product flow. The number of agents in the wait-for cycle is equal announce products at the same time. Then the local counter
to the number of agents in the product flow cycle.
was already updated and the product is declined. If the agent
wait for relationship sends back an accepting message it will assume that the
sending agent will put a new product into the cycle and
increase the corresponding product counter.
Apart from checking whether the product can be accepted
a1 cycle c1 a2 cycle c2 a3
regarding deadlocks, fairness between the tasks is brought
into account as well: Each agent keeps track of how often it
executed each role. If the agent has an input request of a role
(b) Agent a2 has to wait for cycle c2 to have a space for a product that has been executed less frequently than the average of all
before it can hand over a product from agent a1 (out of the cycle roles, it declines products belonging to other roles to execute
c1 ) to agent a2 (into the cycle c2 ). The number of agents in this
wait for relationship is 3 while the number of participants is 2. the underrepresented role in the next choose role iteration.
The number of products that is allowed to enter this configuration c) Handling a take-back message: If an agent receives a
is 1 in order to avoid a deadlock. The algorithm would combine take back message for a cycle it will decrease its local product
c1 and c2 to a new cycle and find maxP roducts = 1.
counter, as it optimistically increased its product counter for
Fig. 4. Different types of cycles.
a product that never entered the cycle. Although take-backs
are very unlikely to occur, this fallback mechanism is needed
due to the concurrent nature of the system: Two or more
B. Enforcing the limits for products in cycles
agents may decide to execute a role adding a product to a
The following section describes the part of the mechanism cycle that can only handle one more product at the same time.
executed at runtime when a role is chosen to be executed First, they decide locally, and due to the lack of knowledge
or when other agents send announcements and take back about the other agents’ intentions, they assume the role to be
messages: executable. Then they announce the product at the respective
a) Choosing role: Before an agent accepts an input other agents and get a declining response. If an additional
request to execute a capability or produces a product, it checks agent is also an entrance-agent to the concerning cycle, this
if it can execute the corresponding role without producing agent also received a product announcement of the other agents
a deadlock. If the agent is an entrance-agent to a cycle, and has already accepted the product of one of the agents
the agent checks if the locally stored number of products and optimistically updated the product counter. This additional
in the cycle is less than maxP roducts by at least one. If agent has to decrease the product counter again.
so, it sends an announce product message to every other
entrance-agent of the cycle and waits for all of them to V. E VALUATION
accept the product. If it receives a declining message, it In this section, we experimentally evaluate, if our approach
will not execute the role but instead, notify all agents that presented in Section IV is capable of avoiding deadlocks under
already accepted the product (take back message). Thus, the varying conditions. Therefore, we run several simulations with
notified agents know the product wasn’t processed and adjust different system configurations and measure the following
their product counter respectively. Fig. 5 shows an exemplary properties:
communication sequence of an agent sending out announce 1) Runtime in seconds
product messages and handling the decline of a product. Take 2) Number of deadlocks encountered
back messages are necessary since the agents accept a product 3) Number of messages sent
and update their product counter optimistically. If the product Additionally, we divide the number of manufactured products
can’t be processed, this update has to be rolled back. If all by the runtime to calculate the system’s throughput.
agents accept an announced product, the announcing agent This allows us to compare our approach to a conservative
can safely execute the role. locking algorithm. The conservative locking algorithm uses
After executing a role, an agent that is an exit of a cycle the cycle detection mechanism described earlier but does not
decreases its product counter and informs the entrance agents consider the combination of cycles. We announce a product
of the cycle to decrease their product counter for this cycle as whenever it enters any cycle. That means the agent sends a
well. message alongside the product flow for every product and
b) Handling announce product messages: An agent re- waits until all agents that will eventually handle the product
ceiving an announce product message locally checks if the cy- accept it (they only do if there is space in all of their cycles).

184

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
If a product is processed completely, the previously reserved
Product capacity in all cycles is released at once. The difference
a1
between this and our approach described in Section IV is
that, once a product is announced, it has to be processed
completely before the cycles are considered to have capacity
again. Our approach detects combined cycles and thus gets
by with fewer messages. We also assume our approach to
APM APM APM have a higher utilization as it frees reserved capacity earlier.
As another benefit, we expect fewer declines for announced
products.
We also run the simulations without any deadlock avoid-
a2 a3 a4
ance. In this case, only the deadlocks encountered are mea-
pc=0 pc=0 pc=0 sured. The other properties are not comparable as we cannot
quantify the cost for deadlock recovery. Measuring the dead-
(a) Agent a1 wants to insert a product to a cycle of which the locks encountered gives the reader an order of magnitude on
Agents a2 , a3 and a4 are the other entrance agents, so it sends how prone to deadlocks a configuration is and finally stresses
a announce product message (APM) to all of them. the need for deadlock control.
We formulate the following hypotheses to test in our eval-
a1 uation:
• Hypothesis 1: Both the conservative locking algorithm
and our approach avoid deadlocks effectively in different
configurations with more than one type of product to be
manufactured.
• Hypothesis 2: To do so, our approach requires fewer
ACK ACK DEC
messages than the conservative locking approach.
• Hypothesis 3: Our approach outperforms the conservative
locking algorithm in terms of throughput.
a2 a3 a4
A. Experimental setup
pc=1 pc=1 pc=0
To verify our hypotheses experimentally, we examine two
(b) Agents a2 and a3 accept the product of a1 and send back systems configurations depicted in Fig. 6. For each system
a acknowledge message (ACK) after increasing their product configuration, we perform 100 runs and average the results.
counter. Agent a4 declines the product of a1 , does not increase
pc and sends a declining message (DEC) to a1 .
Each run simulates the manufacture of 100 products, while
products are split equally among the existing types of products.
Both configurations draw inspiration from manufacturing
a1 furniture, where wooden panels are first taken from storage and
sawn into parts. Then holes for connectors, such as dowels,
are drilled. Afterward, edges are applied to cover the exposed
sides. This process is termed edgebanding. Finally, the product
is assembled and stored, e.g., for shipping. However, often
the order of drilling and edgebanding can be interchanged.
TBM TBM Therefore in Fig. 6a, we present a system with two such types
of furniture products: The first product type requires drilling
before edgebanding (dashed product flow), while the second
a2 a3 a4 type requires edgebanding before drilling (solid product flow).
For each required capability, there is one agent, alongside two
pc=0 pc=0 pc=0 storages.
Fig. 6b introduces Configuration 2 as a variation of Config-
(c) Agent a1 sends a take back message (TBM) to Agents a2 uration 1. In Configuration 2, we assume the manufacturer not
and a3 who update their product counters correspondingly.
to cut parts himself, but instead, buy cut parts for two different
Fig. 5. Communication when announcing a product. types of products from suppliers. Parts for different types of
products are stored in different storages. Again, the first type of
product requires drilling before edgebanding (dashed product
flow), while the other product requires edgebanding before
drilling (solid product flow). After assembly, all products are

185

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
(a) Configuration 1 (b) Configuration 2
Fig. 6. System configurations for the experimental evaluation. AGVs are omitted for the sake of simplicity. Note the cyclic arrangement of the two tasks
between the drilling and the edgebanding machine.

stored in a third storage. Note the cyclic arrangement between Conservative locking
the drill and the edgebander in both configurations.

B. Experimental results Our approach

The results for Configuration 1 in Table I support our hy- 200 300 400 500 600
potheses: While we identified 6 deadlocks on average without seconds
deadlock avoidance, conservative locking and our approach
did avoid deadlocks effectively (Hypothesis 1). For this, our
approach required about 70% of the runtime, the conservative Conservative locking
locking algorithm needed, also resulting in higher throughput
(Hypothesis 3). Besides, the difference in terms of message
Our approach
overhead is notable: While with conservative locking 915
messages were sent, our approach required only 319 messages
400 600 800 1,000 1,200
with a standard deviation of 0 messages (Hypothesis 2).
messages
Compared to Configuration 1, in Configuration 2 deadlocks
occur more frequently if deadlock avoidance is omitted. We Fig. 7. In-depth comparison of conservative locking and our approach for
measured about 28 deadlocks on average with a standard Configuration 2. The plots show the result of 100 runs in terms of runtime
deviation of 14 deadlocks. The main reason is that the two (above) and messages sent (below) for the production of 100 products.
Whiskers denote minimum and maximum values.
storages simultaneously add products to the cycle, while in
Configuration 1 the saw could only add one product at a time.
Therefore, the results for Configuration 2 are slightly more
scattered, yet the analysis in Table I and Fig. 7 confirms our outperforms the conservative locking algorithm though the
hypotheses as well: Our approach and the conservative locking results are not as conclusive as in Configuration 1.
algorithm prevent any deadlocks, reinforcing Hypothesis 1. We, therefore, conclude that our hypotheses hold in the
Again, our approach requires significantly fewer messages configurations considered. While the configurations considered
(Hypothesis 2). While the conservative locking algorithm are typical for furniture production, further investigations must
required 1065 messages on average, our approach got by with show whether our results also apply to other domains.
416 messages on average. As for Hypothesis 3, our approach

186

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.
TABLE I. E XPERIMENTAL RESULTS OF THE COMPARATIVE EVALUATION OF THE CONSERVATIVE LOCKING AND OUR APPROACH . F OR EACH
CONFIGURATION AND STRATEGY, THE MEASUREMENTS OF 100 RUNS , EACH SIMULATING THE MANUFACTURING OF 100 PRODUCTS , ARE AVERAGED .

No. of deadlocks: Runtime in seconds: Throughput in products/s: No. of messages sent:


Configuration Strategy
mean (std) mean (std) mean (std) mean (std)
No deadlock avoidance 6.11 (3.77) - - -
1 Conservative locking 0 (0) 218 (25) 0.46 (0.05) 915 (0)
Our approach 0 (0) 155 (14) 0.65 (0.06) 319 (0)
No deadlock avoidance 27.80 (14.14) - - -
2 Conservative locking 0 (0) 393 (61) 0.26 (0.04) 1065 (36)
Our approach 0 (0) 312 (44) 0.33 (0.04) 416 (21)

VI. C ONCLUSION [5] P. Leitão, J. Barbosa, and D. Trentesaux, “Bio-inspired multi-agent


systems for reconfigurable manufacturing systems,” Engineering Appli-
In this paper, we consider the problem of deadlocks in cations of Artificial Intelligence, vol. 25, no. 5, pp. 934 – 944, 2012.
self-organizing production systems. Deadlocks can occur in [6] L. Ribas-Xirgo, J. M. Moreno-Villafranca, and I. F. Chaile, “On using
automated guided vehicles instead of conveyors,” in 2013 IEEE 18th
production systems if there is a cycle in the product flow, and Conference on Emerging Technologies Factory Automation (ETFA),
each agent in this cycle is occupied by a product. Therefore, 2013, pp. 1–4.
we present an approach that detects cycles in the system’s [7] S. C. Brailsford, C. N. Potts, and B. M. Smith, “Constraint satisfaction
problems: Algorithms and applications,” European Journal of Opera-
product flows and controls the number of products in each tional Research, vol. 119, no. 3, pp. 557 – 581, 1999.
cycle. Detecting cycles and controlling the number of products [8] J.-P. Steghöfer, P. Mandrekar, F. Nafz, H. Seebach, and W. Reif, “On
is realized by sending messages, hence our approach works deadlocks and fairness in self-organizing resource-flow systems,” in
Architecture of Computing Systems - ARCS 2010, C. Müller-Schloer,
without central knowledge or control. Furthermore, our ap- W. Karl, and S. Yehia, Eds. Berlin, Heidelberg: Springer Berlin
proach detects cycles arising from the combination of several Heidelberg, 2010, pp. 87–100.
product flows and thus is suitable for production systems with [9] E. G. Coffman, M. Elphick, and A. Shoshani, “System deadlocks,” ACM
Computing Surveys (CSUR), vol. 3, no. 2, pp. 67–78, 1971.
several types of products to be manufactured in parallel. [10] H. Seebach, F. Ortmeier, and W. Reif, “Design and construction of
To demonstrate the effectiveness of our approach, we con- organic computing systems,” in 2007 IEEE Congress on Evolutionary
duct several experiments measuring the time to manufacture Computation, Sep. 2007, pp. 4215–4221.
[11] H. Seebach, F. Nafz, J.-P. Steghöfer, and W. Reif, “How to design and
a fixed number of products, the number of deadlocks en- implement self-organising resource-flow systems,” in Organic Comput-
countered, and the number of messages sent. Our evaluation ing—A Paradigm Shift for Complex Systems. Springer, 2011, pp. 145–
indicates that our approach avoids deadlocks in various system 161.
[12] M. P. Fanti and M. Zhou, “Deadlock control methods in automated
configurations. Compared to a conservative locking algorithm, manufacturing systems,” IEEE Transactions on systems, man, and
our approach requires considerably less message and time cybernetics-part A: systems and humans, vol. 34, no. 1, pp. 5–22, 2004.
overhead. Therefore, systems using our approach can achieve [13] M. Singhal, “Deadlock detection in distributed systems,” Computer,
vol. 22, no. 11, pp. 37–48, 1989.
higher throughput. [14] Z. A. Banaszak and B. H. Krogh, “Deadlock avoidance in flexible
In future experiments, we plan to investigate the effect manufacturing systems with concurrently competing process flows,”
of adding buffers in front of and after every agent. Buffers IEEE Transactions on robotics and automation, vol. 6, no. 6, pp. 724–
734, 1990.
are well studied in literature and known to increase the [15] N. Wu and M. Zhou, “Modeling and deadlock avoidance of automated
decoupling of machines [21]. Another approach towards the manufacturing systems with multiple automated guided vehicles,” IEEE
problem is considering deadlocks in task allocation. Adding Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics),
vol. 35, no. 6, pp. 1193–1202, 2005.
hard constraints to the CSP to prevent cyclic arrangements is [16] M. P. Fanti, B. Maione, S. Mascolo, and A. Turchiano, “Event-based
not desirable. But the idea of adding soft constraints to prefer feedback control for deadlock avoidance in flexible production systems,”
configurations without cycles seems like a promising way to IEEE Transactions on Robotics and Automation, vol. 13, no. 3, pp. 347–
363, 1997.
relax the problem. [17] M. P. Fanti, “Event-based controller to avoid deadlock and collisions
Finally, we strive for a theoretical proof that verifies the in zone-control agvs,” International Journal of Production Research,
deadlock avoidance property of our approach and confirms vol. 40, no. 6, pp. 1453–1478, 2002.
[18] A. Boukerche and C. Tropper, “A distributed graph algorithm for the
our simulation results. detection of local cycles and knots,” IEEE Transactions on Parallel and
Distributed Systems, vol. 9, no. 8, pp. 748–757, 1998.
R EFERENCES [19] R. A. Wysk, N.-S. Yang, and S. Joshi, “Detection of deadlocks in flexible
manufacturing cells,” IEEE Transactions on robotics and automation,
[1] Y. Koren, The global manufacturing revolution: product-process- vol. 7, no. 6, pp. 853–859, 1991.
business integration and reconfigurable systems. John Wiley & Sons, [20] H. Cho, T. Kumaran, and R. A. Wysk, “Graph-theoretic deadlock
Ltd, 2010. detection and resolution for flexible manufacturing systems,” IEEE
[2] Y. Chevaleyre, U. Endriss, J. Lang, P. Dunne, M. Lemaitre, N. Maudet, Transactions on Robotics and Automation, vol. 11, no. 3, pp. 413–421,
J. Padget, S. Phelps, J. Rodriguez-Aguilar, and P. Sousa, “Issues in 1995.
multiagent resource allocation,” Informatica, vol. 30, pp. 3–31, 2006. [21] Y. Dallery and S. B. Gershwin, “Manufacturing flow line systems: a
[3] L. Monostori, J. Váncza, and S. Kumara, “Agent-based systems for review of models and analytical results,” Queueing Systems, vol. 12,
manufacturing,” CIRP Annals, vol. 55, no. 2, pp. 697 – 720, 2006. no. 1, pp. 3–94, Mar 1992.
[4] A. Dorri, S. S. Kanhere, and R. Jurdak, “Multi-agent systems: A survey,”
IEEE Access, vol. 6, pp. 28 573–28 593, 2018.

187

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 16:32:29 UTC from IEEE Xplore. Restrictions apply.

You might also like