# Application Scenarios of Digital Twins for Smart Crop Farming through Cloud-Fog-Edge Infrastructure
## 4 High Level Architecture for Proposed Digital Twin Use Cases in Agriculture  
Figure 1 illustrates the proposed architecture of a DT system for smart agriculture that integrates cloud, fog, and edge computing layers and multi-agent systems. Farmers or users can access a DT system through a farm management GUI (Graphical User Interface). The overall architecture consists of three layers: Cloud, Fog, and Edge. Figure 1: Proposed Architecture for Digital Twins in Smart Agriculture. The Cloud layer plays multiple roles, including accessing external services like growth stage estimators, weather services, routing services, and disease identification tools. It also offers data storage and anonymisation services for farm data and supports machine learning and data analysis. Additionally, data collected from satellites that help with growth stage estimation, weather prediction, and disease identification are stored in this layer. This layer is also responsible for handling complex processing tasks that are not time-sensitive and can utilise the vast resources of cloud computing. The Fog layer consists of two sub-zones: the Static Fog Zone and the Mobile Fog Zone. In a smart or precision farming setup, an array of sensors and actuators are employed, along with machinery like harvesters, tractors, and innovative devices such as drones and agricultural robots. These devices function as mobile fog nodes, gathering data directly from the fields. Located at the field level, the Static Fog Zone hosts agents, microservices, and digital twins, providing localised data storage and computing capabilities for immediate analysis of farm data. The mobile fog nodes serve to extend the reach of the Fog network, ensuring data collection and processing capabilities in parts of the farm that may have intermittent or no internet access. Furthermore, the Fog layer incorporates a collection of microservices, which facilitate access to both internal APIs for farm data retrieval and third-party APIs (Application Programming Interfaces) for extended functionality. It also houses various agents, such as the Farm Manager and Field Agents, who are tasked with resource scheduling, task management, and the execution of field plans. These components function seamlessly within both the static and mobile zones of the Fog layer. The Edge layer comprises various devices with embedded sensors and actuators utilised in agricultural environments. These devices can include soil moisture sensors located directly in the field or NDVI sensors mounted on farm machinery such as tractors. These Edge devices connect to the static Fog layer to transmit data when internet connectivity is present. In the absence of connectivity, mobile Fog nodes provide data collection services, gathering information from the Edge devices either opportunistically or upon request. This allows for continuous data acquisition and integration into the farm's DT system, ensuring that the farm management has access to the most updated information for decision-making. Additionally, the overall architecture incorporates MAMS (Multi-agent Micro-services) [39] as illustrated in Figure 2. In this setup, microservices are tasked with ongoing activities like weather monitoring and are engaged in the continuous processing of data. The system's flexibility allows seamless transitions between different data sources, like switching from one weather station to another, by simply re-configuring the appropriate microservice. This adaptability level is a fundamental feature of DT technology and is further enhanced by the integrated multi-agent system. In this interconnected environment, actions in one field can influence outcomes in another. The DT plays a crucial role in fine-tuning these decisions, utilising data-centric simulations. At the core of this architecture is the utilisation of established agricultural guidelines, such as the RB209 recommendations, providing a solid foundation.