## 4 Configuration/Scheduling Feasibility Problem and Context Generation Problem in CPS
Figure 8: (**a**) A discrete timed Petri nets (DTPN) model for resource agent \(R1\); (**b**) A DTPN model for resource agent \(R2\); (**c**) A DTPN model for resource agent \(R3\); (**d**) A DTPN model for resource agent \(R4\); (**e**) A DTPN model for resource agent \(R5\). Figure 9: (**a**) A DTPN model \(\Psi_{1}\) for collaboration of process agent \(W1\), resource agent \(R1\) and resource agent \(R2\); (**b**) A DTPN model \(\Psi_{2}\) for collaboration of process agent \(W2\) and resource agent \(R3\) A DTPN model for resource agent \(R2\); (**c**) A DTPN model \(\Psi_{3}\) for collaboration of process agent \(W3\), resource agent \(R4\) and resource agent \(R5\). Due to the limited number of resources, \(m^{k}_{na0}\), for performing the \(k\)-th operation of process agent \(w_{n}\), the firing time \(\mu^{r}_{n}\Big{(}t^{k}_{ns}\Big{)}\) for transition \(t^{k}_{ns}\), the firing time \(\mu^{r}_{n}\Big{(}t^{k}_{ne}\Big{)}\) for transition \(t^{k}_{ne}\) and the number of tokens that may enter the place \(p^{kb}_{n}\) must satisfy capacity constraints and flow balance constraints. However, these constraints cannot be described in DTPN conveniently. As the above constraints must be satisfied, in the following section we will show that the evolution of a DTPN \(\Psi_{n}=(P_{n},T_{n},F_{n},m_{n0},\mu_{n})\) can be represented by a graph with constraints to facilitate the optimization processes and analysis of the system dynamics. In this section, we will state the Configuration/Scheduling Feasibility Problem based on the DTPN models. Let \(WA^{*}\) denote a set of process agents. The collaboration of the set of process agents in \(WA^{*}\) and relevant resource agents \(RA^{*}~{}=~{}\underset{n\in WA^{*}}{\cup}\underset{k\in\{1,\dots,K_{n}\}}{ \cup}R^{k}_{n}\) can be modeled by DTPN \(\Psi=\|_{n\in WA^{*}}\Psi_{n}~{}=~{}(P,T,F,m_{0},\mu)\). For the operations in three process agents and dependency among workflows and resources in Figure 3, based on the interactions between the task agent, process agents and resource agents in Figure 5a-d, collaboration of process agent \(W1\), resource agent \(R1\), resource agent \(R2\), process agent \(W2\), resource agent \(R3\), process agent \(R4\) and resource agent \(R5\) can be represented by \(\Psi_{1}\|\Psi_{2}\|\Psi_{3}\) as shown in Figure 10 (all resources are assumed to stay in the corresponding idle state places initially and all parts are in the corresponding input places of process agent \(W1\) and process agent \(W2\)). Note that the CSFP aims to determine whether there exist a set of a set of process agents, \(WA^{*}\), a set of resource agents, \(RA^{*}\) and associated workflow schedule \(S_{a}\) for each agent in \(RA^{*}\) to perform operations in \(WA^{*}\) such that demand quantity \(Q\) can be met by  
Figure 10: A DTPN model \(\Psi_{1}\|\Psi_{2}\|\Psi_{3}\) for collaboration of process agent \(W1\), resource agent \(R2\), process agent \(W2\), resource agent \(R3\), process agent \(W3\), resource agent \(R4\), and resource agent \(R5\). the deadline \(\theta\). Let \(f\) be the last process agent that produces \(Q\) final products for the task agent. A formal statement of this problem based on the DTPN model is as follows:  
Centralized Configuration/Scheduling Feasibility Problem Formulation based on DTPN Model:  
Given the requested product quantity \(Q\) and deadline \(\theta\), find a set \(WA^{*}\) of process agents and a set \(RA^{*}\) of resource agents such that there exists a firing sequence \(S\) of the DTPN \(\Psi\) that can bring the system to a marking \(m\left(p_{f}^{k_{\theta}}\right)=Q\) at \(t\) with \(t\leq\theta\), where \(S\) consists of the firing sequence \(S_{a}\) for each agent \(a\) in \(RA^{*}\) to perform operations specified by relevant process agent in \(WA^{*}\). Although collaboration of agents can be modelled by Figure 10, the above centralized model and problem formulation cannot be used in distributed agent based manufacturing environment.