# An ANN-Based Approach for Real-Time Scheduling in Cloud Manufacturing
## 2 Mathematical Modeling for the CMfg Scheduling Problem
### Formal Expression of the Main Components  
The main components of the CMfg environment are MT and MR. Due to the consideration of management granularity, these two components are not directly presented to the scheduling problem. Providers distributed in different locations register their encapsulated and virtualized MR capabilities to the CMfg platform. Then, the platform operator classifies these MRs according to  
Figure 2: Real-time Schedule Procedure in the Cloud Manufacturing (CMfg) Environment. their capability types and abstracts them into MS, which is an integrated form of MRs for the demander to use. Specifically, MS of type \(k\) can be expressed by a tuple, as shown in Equation (1). \[\mathbb{S}_{k}\triangleq(\mathcal{I}_{k},\mathcal{Q}_{k}(t))\quad\forall k\in \mathcal{K} \tag{1}\]  
where \(\mathcal{I}_{k}\) represents the label set of MR in the same type, and \(\mathcal{Q}_{k}(t)\) denotes the allocation pending queue of MTs at time \(t\). For MR labeled \(i\) in \(\mathbb{S}_{k}\), its attributes are expressed as Equation (2). \[\mathbb{R}_{i}^{(k)}\triangleq\left(C_{i}^{(k)},P_{i}^{(k)},V_{i}^{(k)}(t), \mathcal{Q}_{i}^{(k)}(t),\mathcal{M}_{i}^{(k)}(t)\right)\quad\forall i\in \mathcal{I}_{k} \tag{2}\]  
where \(C_{i}^{(k)}\) and \(P_{i}^{(k)}\) represent unit cost and service quality, respectively. \(V_{i}^{(k)}(t)\) is the maximum available capacity at time \(t\), and \(\overline{V}_{i}^{(k)}\) is its upper bound. \(\mathcal{Q}_{i}^{(k)}(t)\) and \(\mathcal{M}_{i}^{(k)}(t)\) denote the processing pending queue of MTs and the active MT set defined in Equation (3) at time \(t\), respectively. \[\mathcal{M}_{i}^{(k)}(t)\triangleq\left\{(j,c)\Big{|}b_{j}^{(c)}\leq t<e_{j}^{ (c)},x_{i,j}^{(c)}=1,j\in\mathcal{J}_{c},c\in\mathcal{C}\right\}\quad\forall i \in\mathcal{I}_{k} \tag{3}\]  
where \((j,c)\) is the label mark of MT, \(b_{j}^{(c)}\) and \(e_{j}^{(c)}\), respectively, represent the start time and finish time of processing this MT. Symbol \(x_{i,j}^{(c)}\) is a 0-1 decision variable defined as Equation (4). \[x_{i,j}^{(c)}= \begin{cases}1&\text{if }\mathbb{T}_{j}^{(c)}\text{ is allocated to }\mathbb{R}_{i}^{(k)}\text{ for processing}\\ 0&\text{otherwise.}\end{cases} \quad i\in\mathcal{I}_{k};j\in\mathcal{J}_{c};c\in \mathcal{C} \tag{4}\]  
In the cloud platform, MP that is published by the demander will be pooled, and the precedence relationship of the contained MTs can be described as the activity-on-vertex network, as shown in Figure 3.  
Where \(\mathbb{T}_{0}^{(c)}\) and \(\mathbb{T}_{-1}^{(c)}\) are dummy MTs to help stylize the MP into a single-input-single-output graph. Specifically, an MP labelled \(c\) can be expressed by a tuple shown in Equation (5). \[\mathbb{P}_{c}\triangleq(\mathcal{J}_{c},B_{c},\boldsymbol{L}_{c})\quad \forall c\in\mathcal{C} \tag{5}\]  
where \(\mathcal{J}_{c}\) represents the label set of MT included in \(\mathbb{P}_{c}\), \(B_{c}\) denotes the publish time, and \(\boldsymbol{L}_{c}\) is the logistics duration vector defined as Equation (6). \[\boldsymbol{L}_{c}\triangleq\left[L_{c,i}^{(k)}\right]_{i\in\mathcal{I}_{k},k \in\mathcal{K}}\quad\forall c\in\mathcal{C} \tag{6}\]  
where \(L_{c,i}^{(k)}\) is the logistics duration between \(\mathbb{P}_{c}\) and \(\mathbb{R}_{i}^{(k)}\). For MT labelled \(j\) in \(\mathbb{P}_{c}\), its attributes can be represented as Equation (7). Figure 3: Activity-on-Vertex of Manufacturing Project (MP) \(\mathbb{P}_{c}\) (n/a means not applicable). \[\mathbb{T}_{j}^{(c)}\triangleq\left(v_{j}^{(c)},\kappa_{j}^{(c)},p_{j}^{(c)}, \mathcal{P}_{j}^{(c)},\mathcal{S}_{j}^{(c)}\right)\quad\forall j\in\mathcal{J}_{c };c\in\mathcal{C} \tag{7}\]  
where \(v_{j}^{(c)},\kappa_{j}^{(c)}\), and \(p_{j}^{(c)}\) represent required service capacity, service capability type, and processing time, respectively. \(\mathcal{P}_{j}^{(c)}\) and \(\mathcal{S}_{j}^{(c)}\), respectively, denote the immediate predecessor and the successor set.