# Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-Physical Collectives +
## 4 Digital Twins and Virtual Nodes in Self-Organising Cyber-Physical Systems
### The Pulverisation Meta-Model of Self-Organising Cyber-Physical Systems  
The _pulverisation meta-model_ of self-organising Cyber-Physical Systems [11] can be summarised with the following elements:  
1. _Platform_ subsystem: an abstraction over the physical networked system consisting of _hosts_ possessing a _network identity_, these can be either physical (bare metal), virtualised, or containerised systems, as far as they can be identified as network devices (e.g., through an IP address or a URI), and can communicate with other hosts. 2. _Cyber_ subsystem: a network of _logical devices_ connected as per a logical _neighbouring relationship_; logical devices are segmented (i.e., \"pulverised\") into five _logical components_ (computation \(\beta\), sensors \(\sigma\), actuators \(\alpha\), state \(\kappa\), and communication \(\lambda\)); these can be deployed independently (see Figure 3), as far as the physical devices where they are located can communicate with each other. 3. _Deployment_: a cyber-physical mapping between logical device components and hosts, defining the way the former are _deployed_ on the latter (the so-called execution relationship). See Figure 4.  
In such a system, the software architect focusses on the cyber subsystem, while the system integrator and the middleware provider focus, respectively, on the platform and the deployment. Figure 4: A view of an instance of the extended pulverisation architectural meta-model. The image shows the correspondence between the logical system (**top**) and its actual physical deployment, over an infrastructure enriched with support nodes (e.g., fog devices, edge servers, or cloud service providers). Different colours are associated with different logical devices: in some cases, components (dotted boxes) of a single logical device (dotted circle) are spread across multiple physical nodes (solid boxes), as intra-logical-device connections (not shown here, refer to Figure 3) are allowed to cross the host boundaries. Logical inter-device connections are represented with thick dotted red lines. Figure 3: Two neighbouring logical devices, depicted as pulverised into their logical components. Arrows mark directional data flows among pulverised components. The neighbour relationship is reified by the existing connection between the two communication components of the devices. The meta-model enforces an architectural organisation principle that _fosters_ deployment-independent logic, thus fostering self-organisation by allowing the software designer to reason without any constraint in terms of the underlying platform. Although providing an ideal substrate, the architectural model by itself does not imply self-organisation: behavioural and interaction logic are still to be designed and injected into the logical components. More specifically, self-organising behaviour can be achieved by organising the roles of the pulverised components as follows:  
* Sensors \(\sigma\) perceive the context if the logical device, integrating their readings into the device state \(\kappa\);
* based on the current state, the behaviour component \(\beta\) performs a \"reasoning step\", and accordingly updates the latter;
* the communication component \(\chi\) integrates information from neighbours into the device state \(\kappa\), and shares the results of the reasoning step with the \(\chi\) components of neighbouring virtual devices to enable coordination;
* finally, Actuators \(\alpha\) retrieve state information to control the device itself. The model abstracts away the actual implementation of the logical components and does not mandate any specific platform. In [11], the model has been instantiated into the aggregate computing framework [21; 22]. In this incarnation, all devices share the same behaviour component \(\beta\); namely, they run the same program, represented by a pure function operating over the previous state \(\kappa\) and producing a new state that includes messages to be forwarded through \(\chi\) and actuations to be performed by \(\alpha\).