# An Approach for Deployment of Service-Oriented Simulation Run-Time Resources
## 4 System Model and Problem Formulation
### Definitions
Without the loss of generality, live and virtual users only make small movements around their original positions. We ignore their movements and treat their positions as fixed. For a constructive user, its location is the same as the location of the server deploying it. Thus, the location of user \(U_{i}\) can be expressed as \(L_{U_{i}}=(x_{U_{i}},y_{U_{i}})\). As a kind of software resource, the computing resource demand of constructive member \(C_{i}\) is defined as \(r_{C_{i}}=[cpu_{C_{i}},gpu_{C_{i}},ram_{C_{i}}]^{T}\). * **Deployment scheme**: Resources to be deployed include edge servers, simulation services, and constructive members. Servers need to be deployed on BSs and need to deploy software resources. Therefore, a deployment scheme \(DS\) can be represented by a matrix, with the \(i\)-th column representing the deployment scheme for server \(R_{i}\). The matrix is divided into three parts from top to bottom: \(DS_{R}\), \(DS_{S}\), and \(DS_{C}\). The first part, \(DS_{R}=[DS_{1}^{R},\cdots,DS_{k}^{R}]_{1\times k}\), occupies one row of the matrix, indicating the mapping relationship between edge servers and BSs. The value of the \(i\)-th element in this row, \(DS_{i}^{R}\), represents that the \(i\)-th edge server is determined to be deployed on BS \(DS_{i}^{R}\). Note that a BS can deploy one edge server at most, so \(1\leq DS_{i}^{R},DS_{j}^{R}\leq q\) and \(DS_{i}^{R}\
eq DS_{j}^{R}\), for \(\forall i,j=1,\cdots,k\) and \(i\
eq j\). The second part, \(DS_{MS}=[DS_{1}^{MS},\cdots,DS_{k}^{MS}]_{n\times k}\), is a n-row sub-matrix of matrix \(DS\), where \(DS_{j}^{MS}=[DS_{1}^{MS},\cdots,DS_{m}^{MS}]^{T}\). \(DS_{j}^{MS}\) indicates the number of instances of the \(j\)-th type of micro-services deployed on server \(R_{i}\). The number of instances is non-negative integer, so \(DS_{j}^{MS}\in N\) for \(\forall i=1,\cdots,k\) and \(\forall j=1,\cdots,n\), where \(N\) is the set of natural numbers. Note that as a special simulation service, one and only one middleware is necessary for training simulation activities. To reduce the interaction cost, we assume that it is deployed on edge servers rather than the cloud. To distinguish it from other simulation services, we use \(DS_{M}=[DS_{1}^{M},\cdots,DS_{k}^{M}]_{1\times k}\), the first row of matrix \(DS^{MS}\) as the deployment decision for it. Due to limitations mentioned above, \(DS_{i}^{M}\) are binary variables for \(\forall i=1,\cdots,k\), and \(\sum_{i=1}^{k}DS_{i}^{M}=1\). The third part, \(DS_{C}=[DS_{1}^{C},\cdots,DS_{k}^{C}]_{n\times k}\), is also a sub-matrix, with h rows, of \(DS\), where \(DS_{i}^{C}=[DS_{1}^{C},\cdots,DS_{i}^{C}]^{T}\). The binary variable \(DS_{i}^{C}\) indicates that if the \(j\)-th constructive member is deployed on edge server \(R_{i}\). We assume that all constructive users are deployed on the edge instead of the cloud, thus \(\sum_{i=1}^{k}DS_{ji}^{C}=1\) for \(\forall j=1,\cdots,h\). Therefore, the deployment scheme decision \(DS\) can be defined as  
\[DS=\left[ \begin{array}{c}DS_{R}\\ \hline DS_{S}\\ \hline DS_{C}\end{array} \right]_{(1+n+h)\times k}=\left[ \begin{array}{c} \dfrac{DS_{R}}{DS_{M}}\\ \dfrac{DS_{S/M}}{DS_{C}}\end{array} \right]_{(1+n+h)\times k} \tag{1}\]In addition to the previous definitions, we also define a few symbols for convenience. * \(R(M)\): the edge server deploying the middleware;
* \(R_{U_{i}}(t_{j})\): the closest edge server to user \(U_{i}\) that deploying instances can execute \(t_{j}\);
* \(R(t_{i})\): the edge server can process \(t_{i}\), with the shortest summation of distances between the current server and other servers executing the predecessor tasks of \(t_{i}\), i.e., the server executing task \(t_{i}\);
* \(R(C_{i})\): the edge server deploying constructive member \(C_{i}\);
* \(R(U_{i})\): the edge server closest to user \(U_{i}\).