# Mobility- and Energy-Aware Cooperative Edge Offloading for Dependent Computation Tasks +
## 3 System Model
### Mobility Model  
Based on recent studies, most user trajectories contain similar patterns [51, 62]. To incorporate this insight so as to achieve effective mobility-aware task offloading, we employ machine learning to predict the UE's and the UHs' paths to estimate their available service coverage time. Specifically, we employ a Predicted Endpoint Conditioned Network (PECNet) [63] as a deep-learning-based method for predicting socially compliant trajectories which infer users' destinations to assist prediction. This enhances the plausibility of predictions for trajectories in addition to using the historical data of motion paths, yielding coherent user trajectories. The main idea of PECNet is to divide the prediction problem into two parts. The first part estimates the potential destinations of users using an endpoint estimation variational autoencoder (VAE). The second part predicts socially compliant trajectories while jointly considering the motion history and potential destinations of all users in the scene. The PECNet system model [63], which is illustrated in Figure 4, includes three key elements: a past trajectory encoder, endpoint VAE, and social pooling module. First, a user's motion histories are encoded via the past trajectory encoder. Then, the result is fed into the endpoint VAE to estimate the user's destination. Subsequently, the social pooling module uses the encoded past trajectory and the estimated destinations of all users to jointly predict the future path of every user in the scene. The final output are paths whose future segments (i.e., the predictions) are strongly dependent on the past locations (i.e., the inputs). Similar to prior studies involving mobility prediction, e.g., [12, 54], we consider time to be suitably slotted (whereby we consider the typical 0.4 s slot duration for pedestrian mobility). In our scenario, the positions of the UE and a helper node \(\text{UH}_{i}\) at time \(t\) are defined as \(X_{t}^{\text{UE}}=(x^{t},y^{t})\) and \(X_{t}^{\text{UH}_{i}}=(x_{i}^{t},y_{i}^{t})\), respectively. The trajectories of the UE and helpers \(\text{UH}_{i}\) from time \((t-n+1)\) to \(t\) are:  
\[\mathbf{X}^{\text{UE}}=\Big{\{}X_{t-n+1}^{\text{UE}},X_{t-n+2}^{\text{UE}}, \dots,X_{t}^{\text{UE}}\Big{\}} \tag{15}\]  
Figure 4: PECNet system model [63]: Past trajectory encoder and endpoint estimation variational encoder (VAE) feed into social pooling module to predict paths. \[\mathbf{X}^{\text{UH}_{i}}=\Big{\{}X^{\text{UH}_{i}}_{t-n+1},X^{\text{UH}_{i}}_{t- n+2},\dots,X^{\text{UH}_{i}}_{t}\Big{\}}. \tag{16}\]  
This information can be collected by the macro BS. The PECNet takes as input the trajectories of the UE and helpers UH\({}_{i}\) and outputs the predicted movements from time \((t+1)\) to \((t+l)\):  
\[\widehat{\mathbf{Y}}^{\text{UE}}=\Big{\{}\widehat{Y}^{\text{UE}}_{t+1}, \widehat{Y}^{\text{UE}}_{t+2},\dots,\widehat{Y}^{\text{UE}}_{t+l}\Big{\}} \tag{17}\]  
\[\widehat{\mathbf{Y}}^{\text{UH}_{i}}=\Big{\{}\widehat{Y}^{\text{UH}_{i}}_{t+ 1},\widehat{Y}^{\text{UH}_{i}}_{t+2},\dots,\widehat{Y}^{\text{UH}_{i}}_{t+l} \Big{\}}, \tag{18}\]  
where \(\widehat{Y}^{\text{UE}}_{t}=(\hat{x}^{t},\hat{y}^{t})\) and \(\widehat{Y}^{\text{UH}_{i}}_{t}=(\hat{x}^{t}_{i},\hat{y}^{t}_{i})\). A D2D link can be established between the UE and helper UH\({}_{i}\) at time \(t\) if the UE is in the coverage area of helper UH\({}_{i}\) with radius \(R_{i}\), i.e., if  
\[\sqrt{(\hat{x}^{t}-\hat{x}^{t}_{i})^{2}+(\hat{y}^{t}-\hat{y}^{t}_{i})^{2}} \leq R_{i}. \tag{19}\]  
The sojourn time of the UE in UH\({}_{i}\)'s coverage from time \(t\) is then  
\[T^{h_{i}}_{s,t}=\text{ max }l,\text{ s.t. }\sqrt{(\hat{x}^{\tau}-\hat{x}^{\tau}_{ i})^{2}+(\hat{y}^{\tau}-\hat{y}^{\tau}_{i})^{2}}\leq R_{i},\text{ }\forall\tau\in[t,t+l],\tau\in\mathbb{Z}. \tag{20}\]  
The same process can be utilized to obtain the sojourn time \(T^{\text{s}m}_{s,t}\) of the UE in the coverage of MEC server \(S_{m}\), as well as the sojourn time \(T^{\text{s}m}_{s,t}\) of UH\({}_{i}\) in the coverage of MEC server \(S_{m}\).