## 2 Modeling and Problem Formulation
### Process-Planning Problem Formulation for Sustainable CPS  
In this subsection, the process-planning problem will be formulated for a sustainable CPS. We use \(\Reeq_{n}\) to represent the requirements of the process agent \(n\). \(\Reeq_{n}\) can be specified based on the operations in the production process and the desirable properties of the production process. For example, suppose the process agent \(n\) requires a number of operations to be performed and the upper bound of total processing time is \(\omega_{n}\). Let \(K_{n}\) be the maximum number of operations in the workflow of process agent \(n\). In this case,\(\Re eq_{n}\) can be described by \(\Re eq_{n}=(d_{n1},d_{n2},d_{n3},\ldots,d_{nK_{n}},\omega_{n})\), where \(d_{nk}\) is equal to \(1\) if operation \(k\) is required to be performed in the requirements of process agent \(n\), \(d_{nk}\) is equal to \(0\) otherwise and the overall processing time must be no greater than \(\omega_{n}\). In this study, we use the concept of agents to model resources in CPS. A CPS consists of a set of resource agents such as machine agents and robot agents. The set of agents in the system is denoted by \(RA\). Each agent is autonomous and may submit bids in the CPS to indicate its capability to perform a set of operations. A bid indicates the capability for the resource agent to perform operations in the requirements \(\Re eq_{n}=(d_{n1},d_{n2},d_{n3},\ldots,d_{nK_{n}},\omega_{n})\) of the process agent \(n\). We use \(J_{a}\) to represent the number of bids submitted by resource agent \(a\). The \(j\)-th bid submitted by a resource agent \(a\) is denoted by \(B_{aj}=\big{(}o_{aj1},o_{aj2},o_{aj3},\ldots,o_{ajK_{n}},\tau_{aj}\big{)}\), where \(o_{ajk}\) is one if operation \(k\) can be performed by resource agent \(a\) in the \(j\)-th bid, \(o_{ajk}\) is zero otherwise and \(\tau_{aj}\) is the overall processing time for performing the specified operations. The set of all bids is denoted by \(B=\{B_{aj}\), where \(a\in\{1,2,3,\ldots,|RA|\}\) and \(j\in\{1,2,3,\ldots,J_{a}\}\}\). Based on the resource activity model, each resource agent submits bids to indicate the operations it can perform. For the motivating example, the resource activity model \(A_{na_{1}}^{1}\) for resource agent \(a_{1}\) consists of transition \(t_{1}\) and transition \(t_{2}\). As transition \(t_{1}\) is the start transition of Cyber World model \(\Omega_{1}^{1}\) and transition \(t_{2}\) is the end transition of Cyber World model \(\Omega_{1}^{1}\), resource agent \(a_{1}\) can perform the first operation. Therefore, resource agent \(a_{1}\) submits a bid \(B_{a_{1}j}=(o_{a_{1}j1},o_{a_{1}j2},o_{a_{1}j3},\ldots,o_{a_{1}jK_{n}},\tau_{ a_{1}j})=(1,0,0,0,0,25)\), where \(25\) is the processing time of resource agent \(a_{1}\) for the first operation. Other types of resource agents also submit bids similarly. The energy consumption information of the \(j\)-th bid submitted by agent \(a\) is denoted by \(E_{aj}=\big{(}o_{aj1},o_{a2},o_{aj3},\ldots,o_{ajK_{n}},e_{aj}\big{)}\), where \(e_{aj}\) is the overall energy consumption for performing the specified operations in the bid. The set of energy consumption information for all bids is denoted by \(E=\{E_{aj}\), where \(a\in\{1,2,3,\ldots,|RA|\}\) and \(j\in\{1,2,3,\ldots,J_{a}\}\}\). We use \(x_{aj}\) to denote the decision variable of the optimization problem. The value of \(x_{aj}\) is one if the \(j\)-th bid of agent \(a\) is accepted and is zero otherwise. To assess the quality of a process in CPS, an objective function that considers both total processing time and energy consumption is defined. We use \(\Gamma(x,B)\) to denote a function that calculates the total processing time of a configuration of process agent \(n\) based on the solution \(x_{aj}\) and \(B_{aj}\), where \(a\in\{1,2,3,\ldots,|RA|\}\) and \(j\in\{1,2,3,\ldots,J_{a}\}\). We use \(Eng(x,B)\) to denote a function that calculates the energy consumption according to the solution \(x_{aj}\) and \(B_{aj}\), where \(a\in\{1,2,3,\ldots,|RA|\}\) and \(j\in\{1,2,3,\ldots,J_{a}\}\).