Entrevistas 7 a 16 usuarios, gamers y figuras relevantes en el ´area de desa- desa-rrollo de videojuegos y promoci ´ on de actividades gamer :
6. Ejecuci ´ on y Gesti ´ on del Proyecto
6.1. Metodolog´ıa del Desarrollo
This section develops an algorithm to synthesize an optimal liveness-enforcing su-pervisor M∗and the controlled system(Nm, M0m) for an S3PR(N, M0) when such a supervisor exists. With the aid of the MIP-based deadlock detection method [7], this synthesis algorithm enjoys high computational efficiency. It generates an optimal controlled system with liveness represented by(Nm, M0m) or reports “Undecided”.
The latter means that the algorithm cannot sufficiently decide whether there exists an M∗for a plant model(N, M0).
Algorithm 6.1Synthesis of an M∗ Input: an S3PR plant model(N, M0) Output:(Nm, M0m) or “Undecided”
6.4 Synthesis of Optimal Supervisors 179 N1:= N
M1:= M0
L:= |PA| + |P0| + |PR| ΠE:= /0
ΠD:= /0 Π:= /0 PV := /0 flag a := 1 flag b := 1
while (GMIP(M1) < L and flag b = 1) do find a maximal unmarked siphon Smax
ΠSmax:= {S|S is a minimal siphon derived from Smaxand∀p ∈ S, p ∈ PV} find a siphon S fromΠSmax\Π such that∀S′∈ΠSmax,|S′R| ≥ |SR|
Π:=Π∪ {S}
if S is elementary with respect toΠEthen ΠE:=ΠE∪ {S}
add monitor VSfor S by Proposition 6.3 withξS= 1 PV := PV∪ {VS}
L:= L + 1
the augmented net is denoted by(Nm, M0m) N1:= Nm
M1:= M0m else
ΠD:=ΠD∪ {S}
add monitor VSfor S by Proposition 6.3 withξS= 1 ifηSis optimally controlled then
PV:= PV∪ {VS} L:= L + 1
the augmented net is denoted by(Nm, M0m) N1:= Nm
M1:= M0m else
flag a := 0 flag b := 0 end if end if end while
if (flag a= 1) then Nm:= N1
M0m:= M1
output(Nm, M0m) else
output “Undecided”
end if
This algorithm can synthesize an M∗for a plant S3PR model(N, M0) if some conditions are satisfied. Note that if there is no emptiable siphon in the plant,(N, M0) itself can be considered to be optimally controlled already. An intuitive but naive algorithm to synthesize such a supervisor is first to compute the set of strict minimal siphonsΠin(N, M0). Then, a monitor VSis added for each siphon S inΠwithξS= 1. For each dependent siphon, if its T -vector is optimally controlled, the intuitive algorithm can output an M∗. Note that the number of additional monitors exactly equals that of strict minimal siphons in(N, M0), i.e., |PV| = |Π|, which is in theory exponential with respect to the size of N.
The naive algorithm suffers from two problems: computational complexity and structure complexity. For example, as shown in [16], it takes more than 6 hours to compute all 169 strict minimal siphons in an S3PR with 68 places and 54 transitions by using INA [27]. However, it takes 178 CPU seconds only for the MIP-based deadlock detection method to find 24 strict minimal siphons among the 169, where Lindo [19] is used to solve the MIP problems. The high efficiency of the MIP-based method is also fully shown in [7] by case studies.
The structural complexity of a supervisor is usually measured by the number of monitors. The intuitive algorithm adds exactly|Π| monitors. However, the potential redundancy of some monitors motivates us to develop a method to systematically remove them.
Algorithm 6.2Structural reduction of M∗ Input:(Nm, M0m), an optimal controlled system
Output(NRm, M0Rm), a structurally reduced controlled system suppose that PV = {VSi|i ∈ Nn} is the set of monitors
L:= |PA| + |P0| + |PR| + |PV| N1:= Nm
M1:= M0m i:= 1
while (i≤ n) do
remove VSi and its related arcs from(N1, M1) denote the resultant net as G= (N2, M2) if GMIP(M2) = L − 1 then
L:= L − 1 N1:= N2
M1:= M2
i:= i + 1 PV := PV\{VSi} else
i:= i + 1 end if end while NRm:= N1
M0Rm:= M1
output(NRm, M0RM)
6.4 Synthesis of Optimal Supervisors 181 Algorithm 6.2 can sufficiently distinguish monitors whose removal does not change the liveness property of the optimal controlled system computed by Algo-rithm 6.1. It depends on the order in which monitors are taken into consideration.
Furthermore it requires that all monitors are generated first. Note that a redundancy test algorithm for monitors is also proposed in [30], which needs the complete state enumeration.
To illustrate the supervisor synthesis and reduction algorithms, the net in Fig.
6.5(a) is taken as an example.
Example 6.7.Applying the MIP-based deadlock detection method to the net shown in Fig. 6.5(a), we can first obtain a maximal unmarked siphon Smax= {p5, p6, p9, p12
− p14} from which a strict minimal siphon S1= {p5, p9, p12, p13} with M0(S1) = 3 is derived. It is easy to see that[S1] = {p3, p4}. By Proposition 6.3, a monitor VS1is added such that VS1+ p3+ p4is a P-invariant of the resultant net that is denoted by (Nα, M0α) withξS1 = 1 and M0α(VS1) = 2, as shown in Fig. 6.5(b).
The MIP-based deadlock detection method is applied to(Nα, M0α) and we can obtain a maximal unmarked siphon Smax= {p4, p6, p9, p12− p14, VS1}. From Smax, we can derive a minimal siphon S2= {p4, p6, p13, p14} with [S2] = {p5, p8}. Since ηS1 andηS2are linearly independent, we add monitor VS2. The resultant net system, as shown in Fig. 6.5(b), is denoted by(Nα, M0α), where M0α(VS2) = 2.
The same method is applied to(Nα, M0α). A maximal unmarked siphon Smax= {p4, p6, p9, p12− p14, VS1, VS2} is detected, from which a strict minimal siphon S3= {p6, p9, p12− p14} is found. The factηS3=ηS1+ηS2indicates that S3is a strongly dependent siphon. A monitor VS3is added withξS3= 1. The resultant net is denoted by(Nα, M0α). Clearly, we have M0α(VS3) = 3. Since M0(SR1,2) = M0(p13) = 2 > 1, ηS3 =ηS1+ηS2 is optimally controlled. When the MIP-based deadlock detection method is applied to G= (Nα, M0α) that has three monitors, we have GMIP(M0α) = 18, implying that no unmarked siphon can be derived. As a result, the net shown in Fig. 6.5(b) is an optimal controlled system for the plant model in Fig. 6.5(a).
For this example, Algorithm 6.2 indicates that the removal of any monitor de-teriorates the liveness of the controlled system. Hence, we have the monitor set PV = {VS1,VS2,VS3}. ByΠ = {S1, S2, S3}, we conclude |PV| = |Π|.
Remark 6.2.A hybrid policy that combines deadlock prevention and avoidance is developed in [1, 4], and [6], respectively. It consists of two stages. First, a monitor VS is added by Proposition 6.3 for each strict minimal siphon S with ξS= 1 on condition that all strict minimal siphons in a plant net model(N, M0) are known.
Then, the exertion of an online deadlock avoidance policy depends on whether the net(Nα, M0α) resulting from the first stage contains deadlocks, which is verified via computing the existence of emptiable siphons in(Nα, M0α).
A two-stage deadlock prevention policy is developed in [13]. The first stage adds monitors to plant model(N, M0) such that no siphons in it can be unmarked, leading to an augmented net(Nα, M0α). The second stage, control-induced siphon control, becomes necessary via adding monitors if(Nα, M0α) contains deadlocks, which is verified by solving an MIP problem.
The deadlock control strategy presented in [5] is also of two stages. The first is identical to those proposed in [1, 4], and [6], leading to an augmented net(Nα, M0α).
The second stage aims to eliminate deadlocks in(Nα, M0α) by properly modifying the initial markings of the monitors added in the first stage. Likewise, the second stage is put into execution provided that (Nα, M0α) contains deadlocks, which is verified by finding the emptiable siphons in it.
The two-stage policies mentioned above suffer from the siphon computation problem in the augmented net(Nα, M0α) resulting from the first stage. As is known, the number of siphons in a net is exponential with respect to its size. Since each strict minimal siphon needs a monitor to add to prevent it from being emptied or insufficiently marked, in theory, the size of (number of the monitors in)(Nα, M0α) is exponential with respect to the size of(N, M0). Therefore, siphon computation in (Nα, M0α) is time-consuming or impossible by the above methods in the case of a large-sized plant model.
However, the results in this chapter indicate that onceΠE=Π in an S3PR plant model is true, the first stage of these two-stage policies can result in an M∗, leading to the fact that the second stage is no longer needed.