3.5 Solution To the Constraint Model
3.5.2 Partial Order Schedule On Resources
Given a solution, for each resourcerwe create aPOS(r)which is a directed weighted graph, as follows:
• For eachsupport-relevanttransition pairTrandTr0on the resourcer, ifsupport(Tr,Tr0)> 0, then we addTrandTr0as nodes inPOS(r)and add a directed edge fromTrtoTr0that
has the weightsupport(Tr,Tr0).
We only add a transition as a node inPOS(r), if it doesn’t exist before. Note that each edge represents a precedence relation between the transitions. For each resourcer, thePOS(r)has the following properties:
1. All active transitionsTr, i.e. inplan(Tr) = true, are included as a node in POS(r).
This is the case because, for each transitionTron the resourcer, ifinplan(Tr) = f alse
then Constraint 15 ensures that for each support relevant pair, either < Tr,Tr0 > or < Tr0,Tr >, support(Tr,Tr0) = 0 or support(Tr0,Tr) = 0. We only add pair of
transitions< Tr,Tr0 >wheresupport(Tr,Tr0)> 0. This means that all the transitions
we add inPOS(r)are active transitions.
2. The node representing the dummy start transitionTrstarthas no incoming edge (or sup- port). This is due the fact that each pair< Tr,Trstart>is notsupport-relevant. Similarly,
the node representing the dummy end transitionTrendhas no outgoing edge because each pair<Trend,Tr>is notsupport-relevant.
Figure 3.6: Example ofPOS(r)for resourcer
3. For eachTrincluded in thePOS(r), whereTr6=Trstart, the total weight of the incoming
edges is equal to the req(Tr). Since all transitions included in the POS(r)are active
transitions, Constraint13ensures that each active transitions requirements are satisfied. Similarly, for each transitionTr in POS(r), whereTr 6= Trend, the total weight of the
outgoing edges is equal to thereq(Tr), due to Constraint14.
Given the above properties, its easy to see that eachPOS(r)represents aFlow Network, where Tstart
r represents thesource nodeandTrendis thesink node, and all other transitions inPOS(r)
represent the internal nodes. For each transition in the flow network, the correspondingreq(Tr)
represents the capacity of the node, and each edge weight represents the flow from one node to other. Each internal node has the flow conservation property, i.e. total inflow is equal to total outflow. Note that eachPOS(r)is a special sort of flow network where total in and out flow is equal to the capacity of each internal node. The flow of the network is the sum of all out-going flow from the source node, i.e. fromTstart
sv in this case. Note that total out-going flow from
each node is equal to req(Tr)where the node represents the transitionTr, and we know that req(Trstart) = capacity(r). This means that eachPOS(r)represents a flow network which has the flow equal tocapacity(r).
Figure3.6describes aPOS(r)for a resourcer, wherestartandendrepresent the dummy start transitionTrstartand dummy end transitionTrendonrrespectively. For example, the tran- sitionT4in the Figure3.6, hasreq(T4) =5, and there are 3 incoming edges fromT1,T2, and Trstart, with total weight of 5. Similarly, T4 has two outgoing edges to T5 and T6 with total
§3.5 Solution To the Constraint Model 67
On each resourcerthe partial order schedule,POS(r), that represents a flow network that has a flow equal tocapacity(r), has the following property.
• For any given transition set k ⊂ POS(r) of transitions, such that there are no edges between the corresponding nodes inPOS(r), the total requirement of the setkis always less than or equal tocapacity(r).
For example, consider the set {T1,T2}, where T1 and T2 have no precedence constraint be-
tween them, and total requirement of them req(T1) +req(T2), 2+2=4, which is less than 6
which is the capacity ofr. The other independent set{T5,T6}, has the total requirement of 6.
For each resourcer, each edge in thePOS(r)represents a precedence constraint between a pair of transitions. Each precedence constraint implies a temporal constraint that prevents the transition pair to overlap during execution, but if a pair of transition has no precedence constraint, then the transitions in the pair can overlap during their execution. The above prop- erty ensures that each set of transitions in thePOS(r), where transitions in the set can pair- wise overlap, can execute in parallel without over-consuming, -producing or -borrowing the resource.
For each resourcer, eachexecutionof thePOS(r)represents avalid scheduleas described in Definition8in the previous chapter (page36). This is because each execution:
• Creates an evolution of the resourcer, where at each time pointt ∈[0,H],level(r,t)∈ [0, capacity(r)].
• Satisfies the requirement of reservation of free-space for each transition. Each CON- SUME transition reserves the free-space it creates and release the free-space at the end. Each PRODUCE transition is supported by CONSUME transitions. This means that CONSUME transitions provide unreserved free-space to PRODUCE transition to re- serve. If a transition’s requirement is fulfilled, then it has enough free-space to reserve. Since each execution creates an evolution ofr, and all transitions requirements are ful- filled, the total amount of reservations of free-space will be always less than or equal to the amount of free-space available.
• Creates an evolution ofr, such that that it respects the initial condition of the resource r, i.e. at time point 0,level(r)≤ init(r). In the case of reusable resources, since each POS(r)starts withTrstart, this means that at 0req(Trstart) = capacity(r)amount of resource is available for use. Since each BORROW transition consumes at the start, and each transition have non-zero positive duration, conditionlevel(r)≤init(r)holds. In case of reservoir resources,Tstart
r immediately followed by dummy transitionsTrStartConsume
andTrStartProduce which simulates production of initial level of resource, and creation of initial free-space respectively. All CONSUME transitions can only starts afterTrStartProduce
because, in each reservoir resource,Trstartdoes not support any transitions other than the dummy start consume and produce transitions. This means that on each reservoir re- source, each execution ofPOS(r)satisfies the initial condition.
• Achieves the goal condition, i.e. at time point H, level(r,H) ∈ goal(r). Note that goal condition on each resourcer is an intervalgoal(r) = [minr,maxr]. In the case
of reusable resources, the last transition inPOS(r)isTrend. Since each transition’s pre- condition is satisfied inPOS(r), there must be a set of BORROW transitions B, such that the following condition must hold:
∑
T∈B
support(T,Trend) =req(Trend) =capacity(r)
Note that for each reusable resource r, goal(r) = [capacity(r), capacity(r)], and there are no other transitions that execute in between the setBandTrend, i.e. transition in Bare the last transitions to execute onrin each execution ofPOS(r). This means that each execution ofPOS(r), whereris a reusable resource, satisfies the goal condition. In the case of a reservoir resource r, the last transition in POS(r), Tend
r , is imme-
diately preceded by the dummy transitions TrEndProduce and TrEndConsume. Recall that
req(TrEndConsume) = minrandreq(TrEndProduce) = capacity(r)−maxr. In POS(r)
there is a set of CONSUME transitionsC, that provides supports to the CONSUME tran- sition TrEndConsume, and a set of PRODUCE transitionsP, that provides support to the PRODUCE transitionTrEndProduce. This means that the setPproducesminramount of
resource and the setCproducescapacity(r)−maxramount of free-space. Note that for
each execution ofPOS(r), transitions inCandPare among the last transitions that exe- cute onr. There can be other PRODUCE and CONSUME transitions additional to these sets of transition executing last on r. Note that by executing last, the transitions inC, that producescapacity(r)−maxr amount free-space, ensures that maximum amount
of resource available inratHismaxr. Similarly, the transition setPensures that atH
amount of resource available inr is at least minr. This means that, each execution of
POS(r), whereris a reservoir resource, achieves the goal condition.
This means that, similar to thePOSof state variables, each realization ofPOS(r)represents avalid scheduleon the resourcer. In other words, for each resourcer,POS(r)represents a set ofvalid schedulesonr.