# Efficient Dynamic Deployment of Simulation Tasks in Collaborative Cloud and Edge Environments
## 3 Problem Statements
### Problem Modeling  
To achieve the efficient execution of such a large-scale distributed simulation, various simulation tasks should be deployed properly with the consideration of communication patterns between tasks, as well as the network topology among computation nodes. Additionally, the resource capacity of hosts is an important constraint. **Simulation tasks. ** As stated in Section 3.1, federates in a large-scale simulation show various forms and characteristics. For live and virtual federates, their corresponding digital avatars need to be built to fulfill the interaction between other virtual or real objects. In this paper, these digital avatars together with the constructive computer programs are called tasks, and the real personnel, real equipment and simulators are called users. For constructive federates, they can also be allocated corresponding virtual users. We use \(\mathbb{T}\) to denote the set of tasks in a simulation application. For task \(i\), the volume of data sent from it to task \(j\) at time \(\tau\) can be denoted as \(s_{ij}^{\tau}\). On the other hand, \(d_{i}^{\tau}\) data should also be exchanged between task \(i\) and its corresponding user. For constructive tasks \(i\), \(d_{i}^{\tau}\) is set at 0. \(\mathbb{R}\) represents the set of regions and each user should be located in one of them. The resource requirements of task \(i\) at time \(\tau\) can be expressed as \(\pi_{i}^{\tau}=(\phi_{i}^{\tau},\psi_{i}^{\tau})\), where \(\phi_{i}\) and \(\psi_{i}\) indicate the number of CPU cores and the volume of memory, respectively. For each task, a basic image is needed to provide some necessary libraries or system APIs, no matter if it is encapsulated in a container or a virtual machine. We use \(\zeta_{i}^{\tau}\) to indicate the size of image for task \(i\). Similarly, the size of task \(i\) itself is denoted as \(l_{i}^{\tau}\). When a task is executing on a host, some data will be written into memory or cache to improve access speed or store temporary variables. Migrating a running task can, thus, cause extra cost to restore such cached data. In this paper, we use \(\rho_{i}^{\tau}\) to indicate how many time steps task \(i\) has been assigned in current host at time \(\tau\). In time \(\tau+1\), this value is incremented by \(1\) if task \(i\) is not migrated to other hosts, otherwise this value is set at \(0\). **Computation nodes. ** Constructive federates, as well as the digital avatars of real and virtual federates, should be deployed on some hosts with adequate resources. These hosts may belong to different cloud data centers or edge nodes. Data centers are usually located far away from users and have almost unlimited resources. By contrast, edge nodes are deployed near end users and have limited capacities. Without the loss of generality, we assume that all the data centers and edge nodes can exchange data with each other with deterministic and various unit data transmission costs (infinity if they are disconnected). The set of data centers and edge nodes are expressed as \(\mathbb{C}\) and \(\mathbb{E}\), respectively. \(\mathbb{H}\) denotes the set of hosts. The resource capacity of host \(h\) can be defined as \(\Pi_{h}^{\tau}=(\Phi_{h}^{\tau},\Psi_{h}^{\tau})\), where \(\Phi_{h}\) and \(\Psi_{h}\) indicate the number of cores and volume of memory host \(h\) can provide. Unit data transmission cost between region \(r\) and data center \(c\), region \(r\) and edge node \(e\), edge node \(e\) and data center \(c\), and data center \(p\) and data center \(q\) are expressed as \(\alpha_{rc}\), \(\beta_{rc}\), \(\gamma_{cc}\), and \(\lambda_{pq}\), respectively. In this paper, we assume that the capacities of hosts may change and hosts can be removed or added dynamically. **Optimization goal and constraints. ** Our main goal is to deploy all the simulation tasks properly with the consideration of minimizing overall communication cost and task migration cost when the status of tasks and hosts changes.