## 6 Conclusions and Future Work  
This study develops an RFR that substantially enhances the accuracy of mobility prediction and energy efficiency in D2D communication systems. We utilized human mobility patterns to develop an efficient data transmission process that requires fewer resources, specifically in terms of energy and bandwidth. Our proposed model incorporates knowledge of energy usage and occupant behavioral trends within buildings. Additionally, we focus on encounter prediction, which involves forecasting when two or more users will converge at a specific location and time. Accurate encounter prediction can help to minimize resource consumption by reducing the need for continuous searches for potential encounters. For encounter prediction, we employ the RFR, which organizes historical human mobility traces into a tree structure. The model first predicts future location based on past mobility patterns and, using similar mobility preferences, forecasts encounters for a specific day of the month and hour of the day. We also developed a mathematical computational model to predict encounters between different users.  
In our experiments, we trained the USC dataset using both a benchmark Gaussian model and the RFR. The results were analyzed for observed versus predicted encounters using both approaches. The accuracy of encounter prediction was compared, and the findings indicated that the RFR outperformed the benchmark Gaussian model. In fact, at some locations, the encounter prediction exceeded 85%. Our proposed method demonstrates that the RFR can effectively save energy in smart, connected buildings. Future research can expand the current model by integrating it with other emerging technologies, such as quantum computing and edge computing, and apply the expanded model to many uses in different mobility cases.  
The reliance of Opp-Nets on user-installed and active applications or protocols is acknowledged as a limitation, as it may introduce biases in data collection and limit its generalizability. Future work will focus on integrating the proposed model with widely used existing networks, such as Wi-Fi or 5G, to ensure broader data collection and improved representativeness. Leveraging these infrastructures can mitigate the dependency on specific user-installed applications while enhancing the applicability of the findings in diverse real-world scenarios.  
Conceptualization, A.M. and S.M.N.I; methodology, M.N.A., A.M., S.M.N.I. and B.-S.K.; validation, M.N.A., A.M. and B.-S.K.; formal analysis, A.M. and S.M.N.I. investigation, M.N.A., A.M., S.M.N.I. and B.-S.K.; resources, S.M.N.I. and B.-S.K.; writing--original draft preparation, A.M. and M.N.A.; writing--review and editing, A.M. and B.-S.K.; supervision, S.M.N.I. and B.-S.K.; funding acquisition, B.-S.K. All authors have read and agreed to the published version of the manuscript.  
This work was funded by the National Research Foundation of Korea: Korea government (MSIT) (No. RS-2022-NR069069).  
Not applicable.  
[PERSON], [PERSON]. (2022). CRAWDAD usc/mobilib. IEEE Dataport. [[https://dx.doi.org/10.15783/C79W25](https://dx.doi.org/10.15783/C79W25)]([https://dx.doi.org/10.15783/C79W25](https://dx.doi.org/10.15783/C79W25)).  
The authors declare no conflicts of interest.