# An Approach for Deployment of Service-Oriented Simulation Run-Time Resources
## 4 System Model and Problem Formulation
### Definitions  
* **Service**: In a system implemented with MS architecture, the granularity of service requests submitted by users is usually greater than the granularity of individual micro-services (also called simulation services) that the system can provide. In such cases, it is necessary to combine simulation services into a composite service (CS) to meet user needs. Typically, users' service requests are modeled as DAG. Assuming that the MS library consists of \(n\) classes of micro-services, expressed by set \(MS=[MS_{1},\cdots,MS_{n}]\). To simplify the problem, assume that the resource requirement of \(MS_{i}\) is expressed as \(r_{MS_{i}}=[cpu_{MS_{i}},gpu_{MS_{i}},ram_{MS_{i}}]^{T}\) and the input size and output size of \(MS_{i}\) are \(ms_{i}^{in}\) and \(ms_{i}^{out}\), respectively. All micro-services can be combined to generate \(m\) composite services, represented by \(S=[S_{1},\cdots,S_{m}]\), to meet users' demands. \begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Description** \\ \hline \(MS_{i}\) & the \(i\)-th type of MS \\ \(r_{MS_{i}}\) & the resource requirement of \(MS_{i}\) \\ \(S_{i}\) & the \(i\)-th type of CS combined by micro-services \\ \(S_{ij}\) & the \(j\)-th type of service request from the \(i\)-th user \\ \(t_{ijl}\) & the \(l\)-th task in \(S_{ij}\) \\ \(R_{i}\) & the \(i\)-th edge server \\ \(R_{c_{i}}\) & the resource capacity of \(R_{i}\) \\ \(L_{R_{i}}\) & the location coordinate of \(R_{i}\) \\ \(U_{i}\) & the \(i\)-th user \\ \(r_{C_{i}}\) & the resource requirement of the \(i\)-th constructive member \\ \(DS\) & the deployment scheme, i.e., the solution of the problem to be solved \\ \(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 smallest average data \\  & transmission time from the server executing the predecessor tasks of \(t_{i}\) \\ \(R(C_{i})\) & the edge server deploying constructive member \(C_{i}\) \\ \(R(U_{i})\) & the edge server closest to user \(U_{i}\) \\ \(t_{i}^{C}\) & the communication time caused by the service request \(S_{i}\) \\ \(t_{i_{c}}^{M}\) & the total queuing time of all tasks in the service request \(S_{i}\) \\ \(t^{S}\) & the data transmission time caused by users’ service requests \\ \(t^{M}\) & the interaction time cost among users \\ \(B_{i}\) & the resource usage rate of \(R_{i}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of key notations. * **Task**: The execution of a fine-grained simulation service is referred to as a task. In the \(j\)-th type of service request \(S_{ij}\) submitted by a user \(U_{i}\), the \(l\)-th task \(t_{ijl}\) has its predecessor and successor tasks, represented by sets \(pred(t_{ijl})\) and \(succ(t_{ijl})\), respectively. The initial task and final task in the request are \(t_{ijl}\) and \(t_{ijr}\), whose \(pred(t_{ijl})=succ(t_{ijr})=U_{i}\). To facilitate the description of tasks and their corresponding micro-services, we define \(tms_{i}\) to represent the MS whose instances can process task \(t_{i}\). * **Server**: Assuming there are \(k\) available edge servers \(R=[R_{1},\cdots,R_{k}]\) for training simulation. The resource capacity of edge server \(R_{i}\) is \(Rc_{i}=[cpu_{R_{i}},gpu_{R_{i}},ram_{R_{i}}]^{T}\). Generally, each edge server is deployed on a BS. Assuming \(q\) (\(q\geq k\)) BSs are available, and each BS can deploy one edge server at most. Once the mapping relationship between edge servers and BSs is determined, each server's location can be described by a two-dimensional coordinate as \(L_{R_{i}}=(x_{R_{i}},y_{R_{i}})\). Thus, the distance between \(k\) edge servers can be calculated as a matrix \(A=[a_{ij}]_{k\times k}\). * **User**: Simulation users include live, virtual and \(h\) constructive simulation members, with a total of \(u\) (\(u>h\)), so the user set can be represented as \(U=[U_{1},\cdots,U_{u-h},U_{u-h+1},\cdots,U_{u}]\).