Large-scale and fully distributed cyber-physical sys-
tems (CPS), such as swarm robotics or IoT systems, pose
significant challenges for programming and design. These chal-
lenges include promoting the desired (emergent) collective and
self-organising behaviour, dealing with failures, enacting decen-
tralised coordination, and deploying efficient executions. Aggre-
gate computing is a promising approach that aims to simplify
the design of such systems by providing a high-level abstraction
for describing collective and self-organising behaviours. In this
tutorial, we introduce a toolchain that supports the development
of aggregate computing applications, based on ScaFi (a Scala-
based language and toolkit for aggregate computing) and Al-
chemist (a simulator for CPS scenarios). We will showcase the
toolchain by means of a series of examples, ranging from simple
collective behaviours to more complex self-adaptive and self-
organising ones. Finally, we provide several pointers to research
opportunities (e.g., related to learning collective behaviours
and adaptive large-scale deployments) and applications (e.g., in
swarm robotics, edge-cloud ecosystems, and more).
Novel scenarios like IoT and smart cities promote
a vision of computational ecosystems whereby heterogeneous
collectives of humans, devices and computing infrastructure
interact to provide various services. There, autonomous agents
with different capabilities are expected to cooperate towards
global goals in dependable ways. This is challenging, as deployments are within unknown, changing and loosely connected environments characterized by lack of centralized control, where
components may come and go, or disruption may be caused by
failures. Key issues include (i) how to leverage, functionally and
non-functionally, forms of opportunistic computing and locality
that often underlie IoT scenarios; (ii) how to design and operate
large-scale, resilient ecosystems through suitable assumptions,
decentralized control, and adaptive mechanisms; and (iii) how
to capture and enact “global” behaviors and properties, when
the system consists of heterogeneous, autonomous entities. In
this paper, we propose a model for resilient, collaborative edge-
enabled IoT that leverages spatial locality, opportunistic agents,
and coordinator nodes at the edge. The engineering approach
is declarative and configurable, and works by dynamically
dividing the environment into collaboration areas coordinated
by edge devices. We provide an implementation as a collective, self-organizing workflow based on Aggregate Computing,
provide evaluation by means of simulation, and finally discuss
properties and general applicability of the approach.
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...Roberto Casadei
The opportunities and challenges of recent and
forthcoming distributed computing scenarios have been promot-
ing research on languages and paradigms aimed at modelling the
macro/collective behaviour of systems as well as mechanisms to
endow them with self-* capabilities. One example is the aggregate
computing paradigm, which supports the development of self-
organising systems (e.g., robot swarms, computational ecosys-
tems, and crowd-based services) through various formalisms and
tools developed over a decade. However, very limited work has
been done by a methodological and automation perspective. In
this paper, we explore the issue of organising the development
process of aggregate computing systems. Accordingly, we outline
novel research directions that arise from careful analysis of
the peculiar issues in collective and self-organising systems, the
cornerstones of effective software engineering practices, and
recent scientific trends and insights.
Introduction to the 1st DISCOLI workshop on distributed collective intelligenceRoberto Casadei
The 1st DISCOLI workshop on DIStributed COLlective Intelligence is co-located with the 42nd IEEE International Conference on Distributed Computing Systems (ICDCS 2022) that will take place in Bologna, Italy, 10-13 July 2022.
Recent technological and scientific trends are promoting a vision where intelligence is more and more distributed and collective. Indeed, as computing and communication technologies are becoming increasingly pervasive, and complexity of systems is growing in terms of scale, heterogeneity, and interaction, hence the focus tends to shift from the intelligence of individual devices or agents to the collective intelligence (CI) emerging from a dynamic collection of diverse devices. Such intelligence would allow systems to address complex problems through proper coordination (e.g., cooperation or competition), to self-organise to promote functionality under changing environments, and to improve decision-making capabilities.
The workshop aims to provide a forum where researchers and practitioners can share and discuss fundamental concepts, models, and techniques for studying and implementing collectively intelligent distributed systems. Accordingly, it welcomes original research work providing ideas and technical contributions for promoting scientific discussion and practical adoption of CI mechanisms in engineered systems. As such, the workshop also welcomes cross-disciplinary contributions (e.g., extracting computational mechanisms from natural systems exhibiting forms of CI) and contributions from related research areas like coordination (the study of interaction), multi-agent systems (MAS), socio-technical systems, organisational paradigms, Wireless Sensor and Actuator Networks (WSANs), the Internet of Things (IoT), crowd computing, and swarm robotics.
The topics of interest include (but are not limited to) the following:
Algorithms for self-adaptive/self-organizing system behaviour
Algorithms of artificial collective intelligence (e.g., multi-agent reinforcement learning)
Techniques for task-specific collective intelligence
Extraction of collective knowledge in Internet of Things systems
Collaborations of humans and artificial agents in socio-technical systems
Formal models for computational collective intelligence
Design and verification of emergent properties in distributed systems
Coordination models and languages
Programming languages for distributed CI systems
Languages for multi-tier programming or macro-programming
CI for distributed wearable computing systems
Techniques for crowd computing systems and applications
Applications of distributed CI for smart environments (e.g., smart cities, smart buildings)
Tools for programming and simulation of multi-agent systems
Collective Abstractions and Platforms for Large-Scale Self-Adaptive IoTRoberto Casadei
On the way to the materialisation of the pervasive computing vision, the technological progress swelling from mobile computing and the Internet of Things (IoT) domain is already rich of missed opportunities. Firstly, coordinating large numbers of heterogeneous situated entities to achieve system-level goals in a resilient and self-adaptive way is complex and requires novel approaches to be seamlessly injected into mainstream distributed computing models. Secondly, achieving effective exploitation of computer resources is difficult, due to operational constraints resulting from current paradigms and uncomprehensive software infrastructures which hinder flexibility, adaptation, and smooth coordination of computational tasks execution. Indeed, building dynamic, context-oriented applications in small- or large-scale IoT with traditional abstractions is hard: even harder is to achieve opportunistic, QoS- and QoE-driven application task management across available hardware and networking infras- tructure. In this insight paper, we analyse by the collective adap- tation perspective the key directions of the impelling paradigm shift urged by forthcoming large-scale IoT scenarios. Specifically, we consider how collective abstractions and platforms can syner- gistically assist in such a transformation, by better capturing and enacting a notion of “collective service” as well as the dynamic, opportunistic, and context-driven traits of space-time-situated computations.
Practical Aggregate Programming with Protelis @ SASO2017Danilo Pianini
Collective adaptive systems are an emerging class of networked and situated computational systems with a wide range of applications, such as in the Internet of Things, wireless sensor networks, and smart cities.
Engineering such systems poses a number of challenges, and in particular many approaches, based upon designing the machine-to-machine interaction directly, suffer from a local-to-global abstraction problem.
In this tutorial, we introduce the aggregate computing approach, rooted in the field calculus and practically available through the Protelis programming language, as a means to build collective, situated adaptive systems.
The approach focuses on programming the overall aggregate behaviour, making use of a ``resilience API,'' while leaving to these libraries and the language machinery the responsibility of mapping this to the behavior of individual devices.
This tutorial was first presented at the 11th IEEE International Conference on Self-Adaptive and Self-Organizing Systems (SASO 2017) in Tucson, AZ, USA.
Aggregate computing is a research topic that is addressed by multiple perspectives: computational models, programming languages, distributed adaptive algorithms, middleware architectures, formal analysis, tools.
Novel scenarios like IoT and smart cities promote
a vision of computational ecosystems whereby heterogeneous
collectives of humans, devices and computing infrastructure
interact to provide various services. There, autonomous agents
with different capabilities are expected to cooperate towards
global goals in dependable ways. This is challenging, as deployments are within unknown, changing and loosely connected environments characterized by lack of centralized control, where
components may come and go, or disruption may be caused by
failures. Key issues include (i) how to leverage, functionally and
non-functionally, forms of opportunistic computing and locality
that often underlie IoT scenarios; (ii) how to design and operate
large-scale, resilient ecosystems through suitable assumptions,
decentralized control, and adaptive mechanisms; and (iii) how
to capture and enact “global” behaviors and properties, when
the system consists of heterogeneous, autonomous entities. In
this paper, we propose a model for resilient, collaborative edge-
enabled IoT that leverages spatial locality, opportunistic agents,
and coordinator nodes at the edge. The engineering approach
is declarative and configurable, and works by dynamically
dividing the environment into collaboration areas coordinated
by edge devices. We provide an implementation as a collective, self-organizing workflow based on Aggregate Computing,
provide evaluation by means of simulation, and finally discuss
properties and general applicability of the approach.
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...Roberto Casadei
The opportunities and challenges of recent and
forthcoming distributed computing scenarios have been promot-
ing research on languages and paradigms aimed at modelling the
macro/collective behaviour of systems as well as mechanisms to
endow them with self-* capabilities. One example is the aggregate
computing paradigm, which supports the development of self-
organising systems (e.g., robot swarms, computational ecosys-
tems, and crowd-based services) through various formalisms and
tools developed over a decade. However, very limited work has
been done by a methodological and automation perspective. In
this paper, we explore the issue of organising the development
process of aggregate computing systems. Accordingly, we outline
novel research directions that arise from careful analysis of
the peculiar issues in collective and self-organising systems, the
cornerstones of effective software engineering practices, and
recent scientific trends and insights.
Introduction to the 1st DISCOLI workshop on distributed collective intelligenceRoberto Casadei
The 1st DISCOLI workshop on DIStributed COLlective Intelligence is co-located with the 42nd IEEE International Conference on Distributed Computing Systems (ICDCS 2022) that will take place in Bologna, Italy, 10-13 July 2022.
Recent technological and scientific trends are promoting a vision where intelligence is more and more distributed and collective. Indeed, as computing and communication technologies are becoming increasingly pervasive, and complexity of systems is growing in terms of scale, heterogeneity, and interaction, hence the focus tends to shift from the intelligence of individual devices or agents to the collective intelligence (CI) emerging from a dynamic collection of diverse devices. Such intelligence would allow systems to address complex problems through proper coordination (e.g., cooperation or competition), to self-organise to promote functionality under changing environments, and to improve decision-making capabilities.
The workshop aims to provide a forum where researchers and practitioners can share and discuss fundamental concepts, models, and techniques for studying and implementing collectively intelligent distributed systems. Accordingly, it welcomes original research work providing ideas and technical contributions for promoting scientific discussion and practical adoption of CI mechanisms in engineered systems. As such, the workshop also welcomes cross-disciplinary contributions (e.g., extracting computational mechanisms from natural systems exhibiting forms of CI) and contributions from related research areas like coordination (the study of interaction), multi-agent systems (MAS), socio-technical systems, organisational paradigms, Wireless Sensor and Actuator Networks (WSANs), the Internet of Things (IoT), crowd computing, and swarm robotics.
The topics of interest include (but are not limited to) the following:
Algorithms for self-adaptive/self-organizing system behaviour
Algorithms of artificial collective intelligence (e.g., multi-agent reinforcement learning)
Techniques for task-specific collective intelligence
Extraction of collective knowledge in Internet of Things systems
Collaborations of humans and artificial agents in socio-technical systems
Formal models for computational collective intelligence
Design and verification of emergent properties in distributed systems
Coordination models and languages
Programming languages for distributed CI systems
Languages for multi-tier programming or macro-programming
CI for distributed wearable computing systems
Techniques for crowd computing systems and applications
Applications of distributed CI for smart environments (e.g., smart cities, smart buildings)
Tools for programming and simulation of multi-agent systems
Collective Abstractions and Platforms for Large-Scale Self-Adaptive IoTRoberto Casadei
On the way to the materialisation of the pervasive computing vision, the technological progress swelling from mobile computing and the Internet of Things (IoT) domain is already rich of missed opportunities. Firstly, coordinating large numbers of heterogeneous situated entities to achieve system-level goals in a resilient and self-adaptive way is complex and requires novel approaches to be seamlessly injected into mainstream distributed computing models. Secondly, achieving effective exploitation of computer resources is difficult, due to operational constraints resulting from current paradigms and uncomprehensive software infrastructures which hinder flexibility, adaptation, and smooth coordination of computational tasks execution. Indeed, building dynamic, context-oriented applications in small- or large-scale IoT with traditional abstractions is hard: even harder is to achieve opportunistic, QoS- and QoE-driven application task management across available hardware and networking infras- tructure. In this insight paper, we analyse by the collective adap- tation perspective the key directions of the impelling paradigm shift urged by forthcoming large-scale IoT scenarios. Specifically, we consider how collective abstractions and platforms can syner- gistically assist in such a transformation, by better capturing and enacting a notion of “collective service” as well as the dynamic, opportunistic, and context-driven traits of space-time-situated computations.
Practical Aggregate Programming with Protelis @ SASO2017Danilo Pianini
Collective adaptive systems are an emerging class of networked and situated computational systems with a wide range of applications, such as in the Internet of Things, wireless sensor networks, and smart cities.
Engineering such systems poses a number of challenges, and in particular many approaches, based upon designing the machine-to-machine interaction directly, suffer from a local-to-global abstraction problem.
In this tutorial, we introduce the aggregate computing approach, rooted in the field calculus and practically available through the Protelis programming language, as a means to build collective, situated adaptive systems.
The approach focuses on programming the overall aggregate behaviour, making use of a ``resilience API,'' while leaving to these libraries and the language machinery the responsibility of mapping this to the behavior of individual devices.
This tutorial was first presented at the 11th IEEE International Conference on Self-Adaptive and Self-Organizing Systems (SASO 2017) in Tucson, AZ, USA.
Aggregate computing is a research topic that is addressed by multiple perspectives: computational models, programming languages, distributed adaptive algorithms, middleware architectures, formal analysis, tools.
Cloud computing is facing some serious latency issues due to huge volumes of data that need to be transferred from the place where data is generated to the cloud. For some types of applications, this is not acceptable.
One of the possible solutions to this problem is the idea to bring cloud services closer to the edge of the network, where data origi- nates. This idea is called edge computing, and it is advertised that it dramatically reduces the network latency as a bridge that links the users and the clouds, and as such, it makes the foundation for future interconnected applications.
Edge computing is a relatively new area of research and still faces many challenges like geo-organization and a clear separation of concerns, but also remote configuration, well defined native applications model, and limited node capacity. Because of these issues, edge computing is hard to be offered as a service for future real-time user-centric applications.
This thesis presents the dynamic organization of geo-distributed edge nodes into micro data-centers and forming micro-clouds to cover any arbitrary area and expand capacity, availability, and reliability. We use a cloud organization as an influence with adaptations for a different environment with a clear separation of concerns, and native applications model that can leverage the newly formed system.
We argue that the presented model can be integrated into existing solutions or used as a base for the development of future systems.
Furthermore, we give a clear separation of concerns for the proposed model. With the separation of concerns setup, edge-native applications model, and a unified node organization, we are moving towards the idea of edge computing as a service, like any other utility in cloud computing.
ScaFi-Web, A Web-Based application for Field-based CoordinationGianluca Aguzzi
Field-based coordination is a model for expressing the coordination logic of large-scale adaptive systems, composing functional
blocks from a global perspective. As for any coordination model, a proper toolchain must be developed to support its adoption across all development phases. Under this point of view, the ScaFi toolkit provides a coordination language (field calculus) as a DSL internal in the Scala
language, a library of reusable building blocks, and an infrastructure
for simulation of distributed deployments. In this work, we enrich such
a toolchain by introducing ScaFi-Web, a web-based application allowing in-browser editing, execution, and visualisation of ScaFi programs.
ScaFi-Web facilitates access to the ScaFi coordination technology by
flattening the learning curve and simplifying configuration and requirements, thus promoting agile prototyping of field-based coordination specifications. In turn, this opens the door to easier demonstrations and experimentation, and also constitutes a stepping stone towards monitoring
and control of simulated/deployed systems.
Repository: https://github.com/scafi/scafi-web
Event-Based vs. Multi-Agent Systems: Towards a Unified Conceptual Framework. ...Andrea Omicini
Multi-Agent Systems (MAS) and Event-Based Systems (EBS) are two fundamental paradigms for the engineering of complex software systems. In this talk, we summarise the most important features of the MAS and EBS, and discuss how they could be integrated within a unified conceptual framework. The resulting framework could work as the foundation of a principled discipline for the engineering of complex software systems, by promoting a coherent integration of agent-based and event-based abstractions, languages, technologies, and methods.
TuCSoN on Cloud: An Event-driven Architecture for Embodied / Disembodied Coor...Andrea Omicini
The next generation of computational systems is going to mix up pervasive scenarios with cloud computing, with both intelligent and non-intelligent agents working as the reference component abstractions. A uniform set of MAS abstractions expressive enough to deal with both embodied and disembodied computation is required, in particular when dealing with the complexity of interaction. Along this line, in this paper we define an event-driven coordination architecture, along with a coherent event model, and test it upon the TuCSoN model and technology for MAS coordination.
Augmented Collective Digital Twins for Self-Organising Cyber-Physical SystemsRoberto Casadei
Context. Self-organising and collective computing
approaches are increasingly applied to large-scale cyber-physical
systems (CPS), enabling them to adapt and cooperate in dynamic
environments. Also, in CPS engineering, digital twins are often
leveraged to provide synchronised logical counterparts of physical
entities, whereas in sensor networks the different-but-related
concept of virtual device is used e.g. to abstract groups of sensors.
Vision. We envision the design concept of “augmented collective
digital twin” that captures digital twins at a collective level
extended with purely virtual devices. We argue that this concept
can foster the engineering of self-organising CPS by providing a
holistic, declarative, and integrated system view.
Method. From a review and proposed taxonomy of logical
devices comprehending both digital twins and virtual devices,
we reinterpret a meta-model for self-organising CPSs and discuss
how it can support augmented collective digital twins. We illus-
trate the approach in a crowd-aware navigation scenario, where
virtual devices are opportunistically integrated into the system
to enhance spatial coverage, improving navigation capabilities.
Conclusion. By integrating physical and virtual devices, the
novel notion of augmented collective digital twin paves the way
to self-improving system functionality and intelligent use of
resources in self-organising CPSs.
Event-Based vs. Multi-Agent Systems: Towards a Unified Conceptual FrameworkAndrea Omicini
Event-based systems (EBS) are nowadays the most viable sources of technologies and solutions for large-scale distributed applications. On the other hand, multi-agent systems (MAS) apparently provide the most viable abstractions and coherent methods to deal with complex distributed systems, in particular when advanced features – such as mobility, autonomy, symbolic reasoning, knowledge management, situation recognition – are required. In this talk we discuss how the core concepts of EBS and MAS can in principle be matched and integrated, providing a sound conceptual ground for a coherent discipline for the engineering of complex software systems.
[Keynote Speech @ IEEE CSCWD 2015, May 6, 2015, Calabria, Italy]
Towards Reinforcement Learning-based Aggregate ComputingGianluca Aguzzi
Towards Reinforcement Learning-based Aggregate Computing is a paper presented @ COORDINATION 2022.
These slides show the main concepts of Aggregate Computing and discuss how it could be integrated with Learning techniques.
Particularly, in this work, we explore the process of programming sketching: the program is fully defined but a part of it is unknown. Then the learning is applied there in order to "fill" the missing "hole".
Paper: https://link-springer-com.ezproxy.unibo.it/chapter/10.1007/978-3-031-08143-9_5
Code: https://github.com/cric96/experiment-2022-coordination
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...Roberto Casadei
The engineering of large-scale cyber-physical systems (CPS) increasingly relies on principles from self-organisation and collective computing, enabling these systems to cooperate and adapt in dynamic environments. CPS engineering also often leverages digital twins that provide synchronised logical counterparts of physical entities. In contrast, sensor networks rely on the different but related concept of virtual device that provides an abstraction of a group of sensors. In this work, we study how such concepts can contribute to the engineering of self-organising CPSs. To that end, we analyse the concepts and devise modelling constructs, distinguishing between identity correspondence and execution relationships. Based on this analysis, we then contribute to the novel concept of “collective digital twin” (CDT) that captures the logical counterpart of a collection of physical devices. A CDT can also be “augmented” with purely virtual devices, which may be exploited to steer the self-organisation process of the CDT and its physical counterpart. We underpin the novel concept with experiments in the context of the pulverisation framework of aggregate computing, showing how augmented CDTs provide a holistic, modular, and cyber-physically integrated system view that can foster the engineering of self-organising CPSs.
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...Roberto Casadei
Coordination is a fundamental problem in the
engineering of collective adaptive systems (CAS). Prominent
approaches in this context promote adaptivity and collective
behaviour by founding coordination on local, decentralised in-
teraction. This is usually enabled through abstractions such as
collective interfaces, neighbour-based interaction, and attribute-
based communication. Application designers, then, use such
coordination mechanisms to enact collective adaptive behaviour
in order to solve specific problems or provide specific services
while coping with dynamic environments. In this paper, we
consider the other way round: we argue that a CAS model can
be used to provide support for high-level coordination models,
simplifying their implementation and transferring to them the
self-* properties it emergently fosters. As a motivating example,
we consider the idea of supporting tuple-based coordination by
Linda primitives such that tuples and operations have a position
and extension in space and time. Then, we adopt an aggregate
perspective, by which space-time is logically represented by a
mobile ad-hoc network of devices, and show that coordination
primitives can be implemented as true collective adaptive pro-
cesses. We describe this model and a prototype implementation
in the ScaFi aggregate programming framework, which is rooted
in the so-called computational field paradigm.
Towards XMAS: eXplainability through Multi-Agent SystemsGiovanni Ciatto
In the context of the Internet of Things (IoT), intelligent systems (IS) are increasingly relying on Machine Learning (ML) techniques. Given the opaqueness of most ML techniques, however, humans have to rely on their intuition to fully understand the IS outcomes: helping them is the target of eXplainable Artificial Intelligence (XAI). Current solutions – mostly too specific, and simply aimed at making ML easier to interpret – cannot satisfy the needs of IoT, characterised by heterogeneous stimuli, devices, and data-types concurring in the composition of complex information structures. Moreover, Multi-Agent Systems (MAS) achievements and advancements are most often ignored, even when they could bring about key features like explainability and trustworthiness. Accordingly, in this paper we (i) elicit and discuss the most significant issues affecting modern IS, and (ii) devise the main elements and related interconnections paving the way towards reconciling interpretable and explainable IS using MAS.
eCAS 2021: Towards Pulverised Architectures for Collective Adaptive Systems t...Gianluca Aguzzi
Engineering large-scale Cyber-Physical Systems–like robot swarms, augmented crowds, and smart cities – is challenging, for many issues have to be addressed, including specifying their collective adaptive behaviour and managing the connection of the digital and physical parts. In particular, some approaches propose self-organising mechanisms to actually program global behaviour while fostering decentralised, asynchronous execution. However, most of these approaches couple behavioural specifications to specific network architectures (e.g.,peer-to-peer), and therefore do not promote flexible exploitation of the underlying infrastructure. Conversely, pulverisation is a recent approach that enables self-organising behaviour to be defined independently of the available infrastructure while retaining functional correctness. Currently, however, no tools are available to formally specify and verify concrete architectures for pulverised applications. Therefore, in this work we propose to combine pulverisation with multi-tier programming, a paradigm that supports the specification of the architecture of distributed systems in a single code base, and enables static checks for the correctness of actual deployments. The approach can be seamlessly implemented by combining the ScaFi aggregate computing tool-chain with the ScalaLoci multi-tier programming language, paving the path fora coherent support to the development of self-organising cyber-physical systems, addressing both functional (behaviour) and non-functional concerns (deployment) in a single code base and modular fashion.
6th eCAS workshop on Engineering Collective Adaptive SystemsRoberto Casadei
This is the presentation introducing the 6th eCAS workshop on Engineering Collective Adaptive Systems. It recaps its scope, provides data regarding this edition, provides an overview of the program and related initiatives.
Ph.D. Thesis: A Methodology for the Development of Autonomic and Cognitive In...Universita della Calabria,
Doctoral Defence in ICT (Università della Calabria, Italy). Ph.D. candidate Claudio Savaglio. Thesis title: A Methodology for the Development of Autonomic and Cognitive Internet of Things Ecosystems.
On Execution Platforms for Large-Scale Aggregate ComputingRoberto Casadei
Aggregate computing is proposed as a computational model and associated toolchain to engineer adaptive large-scale situated systems, including IoT and wearable computing systems. Though originated in the context of WSN-like (peer-to-peer and fully distributed) systems, we argue it is a model that can transparently fit a variety of execution platforms (decentralised, server-mediated, cloud/fog-oriented), due to its ability of declaratively designing systems by global-level abstractions: it opens the possibility of intrinsically supporting forms of load balancing, elasticity and toleration of medium- and long-term changes of computational infrastructures. To ground the discussion, we present ongoing work in the context of scafi, a language and platform support for computational fields based on the Scala programming language and Akka actor framework.
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...Roberto Casadei
Engineering self-organising systems – e.g., robot
swarms, collectives of wearables, or distributed infrastructures
– has been investigated and addressed through various kinds
of approaches: devising algorithms by taking inspiration from
nature, relying on design patterns, using learning to synthesise
behaviour from expectations of emergent behaviour, and exposing
key mechanisms and abstractions at the level of a programming
language. Focussing on the latter approach, most of the state-
of-the-art languages for self-organisation leverage a round-based
execution model, where devices repeatedly evaluate their context
and control program fully: this model is simple to reason about
but limited in terms of flexibility and fine-grained management
of sub-activities. By inspiration from the so-called functional
reactive paradigm, in this paper we propose a reactive self-
organisation programming approach that enables to fully decouple
the program logic from the scheduling of its sub-activities.
Specifically, we implement the idea through a functional reactive
implementation of aggregate programming in Scala, based on
the functional reactive library Sodium. The result is a functional
reactive self-organisation programming model, called FRASP,
that maintains the same expressiveness and benefits of aggregate
programming, while enabling significant improvements in terms
of scheduling controllability, flexibility in the sensing/actuation
model, and execution efficiency.
IUI 2010: An Informal Summary of the International Conference on Intelligent ...J S
Highlights from the main track, poster/demo-session & the VISSW/UDISW/EGIHMI workshops. This is an informal compilation of personal notes from the conference & proceedings, twitter (#iui2010), Ian Ozsvald's blog (http://ianozsvald.com/), and other sources. Citations were not coherently possible, so I chose to stick with links instead. Please let me know if you'd like to see your work more thoroughly referenced.
[ADBIS 2021] - Optimizing Execution Plans in a MultistoreChiara Forresi
Multistores are data management systems that enable query processing across different database management systems (DBMSs); besides the distribution of data, complexity factors like schema heterogeneity and data replication must be resolved through integration and data fusion activities. In a recent work [2], we have proposed a multistore solution that relies on a dataspace to provide the user with an integrated view of the available data and enables the formulation and execution of GPSJ (generalized projection, selection and join) queries. In this paper, we propose a technique to optimize the execution of GPSJ queries by finding the most efficient execution plan on the multistore. In particular, we devise three different strategies to carry out joins and data fusion, and we build a cost model to enable the evaluation of different execution plans. Through the experimental evaluation, we are able to profile the suitability of each strategy to different multistore configurations, thus validating our multi-strategy approach and motivating further research on this topic.
Doctoral Symposium ACSOS 2021: Research directions for Aggregate Computing wi...Gianluca Aguzzi
Collective adaptive systems (CASs) are challenging from the engineering perspective. Different techniques aim at taming these systems, either using declarative or black-box approaches (e.g. Machine Learning, Evolutionary Algorithms, etc.).Among the many declarative approaches, Aggregate Computing is a novel technique by which developers can express collective system behaviours from a global perspective, using a compositional and functional programming technique. Over the years, Aggregate Computing has been applied in different scenarios, ranging from smart cities to a crowd of augmented people. Despite its promising capabilities, it is sometimes challenging to describe aggregate behaviours, so we aim at merging Aggregate Computing with black-box techniques to simplify the aggregate program synthesis
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...Roberto Casadei
Recent trends like the Internet of Things (IoT) suggest a vi-
sion of dense and multi-scale deployments of computing devices in nearly
all kinds of environments. A prominent engineering challenge revolves
around programming the collective adaptive behaviour of such compu-
tational ecosystems. This requires abstractions able to capture concepts
like ensembles (dynamic groups of cooperating devices) and collective
tasks (joint activities carried out by ensembles). In this work, we con-
sider collections of devices interacting with neighbours and that execute
in nearly-synchronised sense–compute–interact rounds, where the com-
putation is given by a single control program. To support programming
whole computational collectives, we propose the abstraction of a dis-
tributed collective process (DCP), which can be used to define at once
the ensemble formation logic and its collective task. We implement the
abstraction in the eXchange Calculus (XC), a core language based on
neighbouring values (maps from neighbours to values) where state man-
agement and interaction is handled through a single primitive, exchange.
Then, we discuss the features of the abstraction, its suitability for differ-
ent kinds of distributed computing applications, and provide a proof-of-
concept implementation of a wave-like process propagation.
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingRoberto Casadei
A recently proposed approach to the rigorous engineering of collective adaptive systems is the aggregate computing paradigm, which operationalises the idea of expressing collective adaptive behaviour by a global perspective as a functional composition of dynamic computational fields (i.e., structures mapping a collection of individual devices of a collective to computational values over time). In this paper, we present FScaFi, a core language that captures the essence of exploiting field computations in mainstream functional languages, and which is based on a semantic model for field computations leveraging the novel notion of “computation against a neighbour”. Such a construct models expressions whose evaluation depends on the same evaluation that occurred on a neighbour, thus abstracting communication actions and, crucially, enabling deep and straightforward integration in the Scala programming language, by the ScaFi incarnation. We cover syntax and informal semantics of FScaFi, provide examples of collective adaptive behaviour development in ScaFi, and delineate future work.
More Related Content
Similar to Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with ScaFi for Swarms, Edge-Cloud Ecosystems, and More
Cloud computing is facing some serious latency issues due to huge volumes of data that need to be transferred from the place where data is generated to the cloud. For some types of applications, this is not acceptable.
One of the possible solutions to this problem is the idea to bring cloud services closer to the edge of the network, where data origi- nates. This idea is called edge computing, and it is advertised that it dramatically reduces the network latency as a bridge that links the users and the clouds, and as such, it makes the foundation for future interconnected applications.
Edge computing is a relatively new area of research and still faces many challenges like geo-organization and a clear separation of concerns, but also remote configuration, well defined native applications model, and limited node capacity. Because of these issues, edge computing is hard to be offered as a service for future real-time user-centric applications.
This thesis presents the dynamic organization of geo-distributed edge nodes into micro data-centers and forming micro-clouds to cover any arbitrary area and expand capacity, availability, and reliability. We use a cloud organization as an influence with adaptations for a different environment with a clear separation of concerns, and native applications model that can leverage the newly formed system.
We argue that the presented model can be integrated into existing solutions or used as a base for the development of future systems.
Furthermore, we give a clear separation of concerns for the proposed model. With the separation of concerns setup, edge-native applications model, and a unified node organization, we are moving towards the idea of edge computing as a service, like any other utility in cloud computing.
ScaFi-Web, A Web-Based application for Field-based CoordinationGianluca Aguzzi
Field-based coordination is a model for expressing the coordination logic of large-scale adaptive systems, composing functional
blocks from a global perspective. As for any coordination model, a proper toolchain must be developed to support its adoption across all development phases. Under this point of view, the ScaFi toolkit provides a coordination language (field calculus) as a DSL internal in the Scala
language, a library of reusable building blocks, and an infrastructure
for simulation of distributed deployments. In this work, we enrich such
a toolchain by introducing ScaFi-Web, a web-based application allowing in-browser editing, execution, and visualisation of ScaFi programs.
ScaFi-Web facilitates access to the ScaFi coordination technology by
flattening the learning curve and simplifying configuration and requirements, thus promoting agile prototyping of field-based coordination specifications. In turn, this opens the door to easier demonstrations and experimentation, and also constitutes a stepping stone towards monitoring
and control of simulated/deployed systems.
Repository: https://github.com/scafi/scafi-web
Event-Based vs. Multi-Agent Systems: Towards a Unified Conceptual Framework. ...Andrea Omicini
Multi-Agent Systems (MAS) and Event-Based Systems (EBS) are two fundamental paradigms for the engineering of complex software systems. In this talk, we summarise the most important features of the MAS and EBS, and discuss how they could be integrated within a unified conceptual framework. The resulting framework could work as the foundation of a principled discipline for the engineering of complex software systems, by promoting a coherent integration of agent-based and event-based abstractions, languages, technologies, and methods.
TuCSoN on Cloud: An Event-driven Architecture for Embodied / Disembodied Coor...Andrea Omicini
The next generation of computational systems is going to mix up pervasive scenarios with cloud computing, with both intelligent and non-intelligent agents working as the reference component abstractions. A uniform set of MAS abstractions expressive enough to deal with both embodied and disembodied computation is required, in particular when dealing with the complexity of interaction. Along this line, in this paper we define an event-driven coordination architecture, along with a coherent event model, and test it upon the TuCSoN model and technology for MAS coordination.
Augmented Collective Digital Twins for Self-Organising Cyber-Physical SystemsRoberto Casadei
Context. Self-organising and collective computing
approaches are increasingly applied to large-scale cyber-physical
systems (CPS), enabling them to adapt and cooperate in dynamic
environments. Also, in CPS engineering, digital twins are often
leveraged to provide synchronised logical counterparts of physical
entities, whereas in sensor networks the different-but-related
concept of virtual device is used e.g. to abstract groups of sensors.
Vision. We envision the design concept of “augmented collective
digital twin” that captures digital twins at a collective level
extended with purely virtual devices. We argue that this concept
can foster the engineering of self-organising CPS by providing a
holistic, declarative, and integrated system view.
Method. From a review and proposed taxonomy of logical
devices comprehending both digital twins and virtual devices,
we reinterpret a meta-model for self-organising CPSs and discuss
how it can support augmented collective digital twins. We illus-
trate the approach in a crowd-aware navigation scenario, where
virtual devices are opportunistically integrated into the system
to enhance spatial coverage, improving navigation capabilities.
Conclusion. By integrating physical and virtual devices, the
novel notion of augmented collective digital twin paves the way
to self-improving system functionality and intelligent use of
resources in self-organising CPSs.
Event-Based vs. Multi-Agent Systems: Towards a Unified Conceptual FrameworkAndrea Omicini
Event-based systems (EBS) are nowadays the most viable sources of technologies and solutions for large-scale distributed applications. On the other hand, multi-agent systems (MAS) apparently provide the most viable abstractions and coherent methods to deal with complex distributed systems, in particular when advanced features – such as mobility, autonomy, symbolic reasoning, knowledge management, situation recognition – are required. In this talk we discuss how the core concepts of EBS and MAS can in principle be matched and integrated, providing a sound conceptual ground for a coherent discipline for the engineering of complex software systems.
[Keynote Speech @ IEEE CSCWD 2015, May 6, 2015, Calabria, Italy]
Towards Reinforcement Learning-based Aggregate ComputingGianluca Aguzzi
Towards Reinforcement Learning-based Aggregate Computing is a paper presented @ COORDINATION 2022.
These slides show the main concepts of Aggregate Computing and discuss how it could be integrated with Learning techniques.
Particularly, in this work, we explore the process of programming sketching: the program is fully defined but a part of it is unknown. Then the learning is applied there in order to "fill" the missing "hole".
Paper: https://link-springer-com.ezproxy.unibo.it/chapter/10.1007/978-3-031-08143-9_5
Code: https://github.com/cric96/experiment-2022-coordination
Digital Twins, Virtual Devices, and Augmentations for Self-Organising Cyber-P...Roberto Casadei
The engineering of large-scale cyber-physical systems (CPS) increasingly relies on principles from self-organisation and collective computing, enabling these systems to cooperate and adapt in dynamic environments. CPS engineering also often leverages digital twins that provide synchronised logical counterparts of physical entities. In contrast, sensor networks rely on the different but related concept of virtual device that provides an abstraction of a group of sensors. In this work, we study how such concepts can contribute to the engineering of self-organising CPSs. To that end, we analyse the concepts and devise modelling constructs, distinguishing between identity correspondence and execution relationships. Based on this analysis, we then contribute to the novel concept of “collective digital twin” (CDT) that captures the logical counterpart of a collection of physical devices. A CDT can also be “augmented” with purely virtual devices, which may be exploited to steer the self-organisation process of the CDT and its physical counterpart. We underpin the novel concept with experiments in the context of the pulverisation framework of aggregate computing, showing how augmented CDTs provide a holistic, modular, and cyber-physically integrated system view that can foster the engineering of self-organising CPSs.
Collective Adaptive Systems as Coordination Media: The Case of Tuples in Spac...Roberto Casadei
Coordination is a fundamental problem in the
engineering of collective adaptive systems (CAS). Prominent
approaches in this context promote adaptivity and collective
behaviour by founding coordination on local, decentralised in-
teraction. This is usually enabled through abstractions such as
collective interfaces, neighbour-based interaction, and attribute-
based communication. Application designers, then, use such
coordination mechanisms to enact collective adaptive behaviour
in order to solve specific problems or provide specific services
while coping with dynamic environments. In this paper, we
consider the other way round: we argue that a CAS model can
be used to provide support for high-level coordination models,
simplifying their implementation and transferring to them the
self-* properties it emergently fosters. As a motivating example,
we consider the idea of supporting tuple-based coordination by
Linda primitives such that tuples and operations have a position
and extension in space and time. Then, we adopt an aggregate
perspective, by which space-time is logically represented by a
mobile ad-hoc network of devices, and show that coordination
primitives can be implemented as true collective adaptive pro-
cesses. We describe this model and a prototype implementation
in the ScaFi aggregate programming framework, which is rooted
in the so-called computational field paradigm.
Towards XMAS: eXplainability through Multi-Agent SystemsGiovanni Ciatto
In the context of the Internet of Things (IoT), intelligent systems (IS) are increasingly relying on Machine Learning (ML) techniques. Given the opaqueness of most ML techniques, however, humans have to rely on their intuition to fully understand the IS outcomes: helping them is the target of eXplainable Artificial Intelligence (XAI). Current solutions – mostly too specific, and simply aimed at making ML easier to interpret – cannot satisfy the needs of IoT, characterised by heterogeneous stimuli, devices, and data-types concurring in the composition of complex information structures. Moreover, Multi-Agent Systems (MAS) achievements and advancements are most often ignored, even when they could bring about key features like explainability and trustworthiness. Accordingly, in this paper we (i) elicit and discuss the most significant issues affecting modern IS, and (ii) devise the main elements and related interconnections paving the way towards reconciling interpretable and explainable IS using MAS.
eCAS 2021: Towards Pulverised Architectures for Collective Adaptive Systems t...Gianluca Aguzzi
Engineering large-scale Cyber-Physical Systems–like robot swarms, augmented crowds, and smart cities – is challenging, for many issues have to be addressed, including specifying their collective adaptive behaviour and managing the connection of the digital and physical parts. In particular, some approaches propose self-organising mechanisms to actually program global behaviour while fostering decentralised, asynchronous execution. However, most of these approaches couple behavioural specifications to specific network architectures (e.g.,peer-to-peer), and therefore do not promote flexible exploitation of the underlying infrastructure. Conversely, pulverisation is a recent approach that enables self-organising behaviour to be defined independently of the available infrastructure while retaining functional correctness. Currently, however, no tools are available to formally specify and verify concrete architectures for pulverised applications. Therefore, in this work we propose to combine pulverisation with multi-tier programming, a paradigm that supports the specification of the architecture of distributed systems in a single code base, and enables static checks for the correctness of actual deployments. The approach can be seamlessly implemented by combining the ScaFi aggregate computing tool-chain with the ScalaLoci multi-tier programming language, paving the path fora coherent support to the development of self-organising cyber-physical systems, addressing both functional (behaviour) and non-functional concerns (deployment) in a single code base and modular fashion.
6th eCAS workshop on Engineering Collective Adaptive SystemsRoberto Casadei
This is the presentation introducing the 6th eCAS workshop on Engineering Collective Adaptive Systems. It recaps its scope, provides data regarding this edition, provides an overview of the program and related initiatives.
Ph.D. Thesis: A Methodology for the Development of Autonomic and Cognitive In...Universita della Calabria,
Doctoral Defence in ICT (Università della Calabria, Italy). Ph.D. candidate Claudio Savaglio. Thesis title: A Methodology for the Development of Autonomic and Cognitive Internet of Things Ecosystems.
On Execution Platforms for Large-Scale Aggregate ComputingRoberto Casadei
Aggregate computing is proposed as a computational model and associated toolchain to engineer adaptive large-scale situated systems, including IoT and wearable computing systems. Though originated in the context of WSN-like (peer-to-peer and fully distributed) systems, we argue it is a model that can transparently fit a variety of execution platforms (decentralised, server-mediated, cloud/fog-oriented), due to its ability of declaratively designing systems by global-level abstractions: it opens the possibility of intrinsically supporting forms of load balancing, elasticity and toleration of medium- and long-term changes of computational infrastructures. To ground the discussion, we present ongoing work in the context of scafi, a language and platform support for computational fields based on the Scala programming language and Akka actor framework.
Self-Organisation Programming: a Functional Reactive Macro Approach (FRASP) [...Roberto Casadei
Engineering self-organising systems – e.g., robot
swarms, collectives of wearables, or distributed infrastructures
– has been investigated and addressed through various kinds
of approaches: devising algorithms by taking inspiration from
nature, relying on design patterns, using learning to synthesise
behaviour from expectations of emergent behaviour, and exposing
key mechanisms and abstractions at the level of a programming
language. Focussing on the latter approach, most of the state-
of-the-art languages for self-organisation leverage a round-based
execution model, where devices repeatedly evaluate their context
and control program fully: this model is simple to reason about
but limited in terms of flexibility and fine-grained management
of sub-activities. By inspiration from the so-called functional
reactive paradigm, in this paper we propose a reactive self-
organisation programming approach that enables to fully decouple
the program logic from the scheduling of its sub-activities.
Specifically, we implement the idea through a functional reactive
implementation of aggregate programming in Scala, based on
the functional reactive library Sodium. The result is a functional
reactive self-organisation programming model, called FRASP,
that maintains the same expressiveness and benefits of aggregate
programming, while enabling significant improvements in terms
of scheduling controllability, flexibility in the sensing/actuation
model, and execution efficiency.
IUI 2010: An Informal Summary of the International Conference on Intelligent ...J S
Highlights from the main track, poster/demo-session & the VISSW/UDISW/EGIHMI workshops. This is an informal compilation of personal notes from the conference & proceedings, twitter (#iui2010), Ian Ozsvald's blog (http://ianozsvald.com/), and other sources. Citations were not coherently possible, so I chose to stick with links instead. Please let me know if you'd like to see your work more thoroughly referenced.
[ADBIS 2021] - Optimizing Execution Plans in a MultistoreChiara Forresi
Multistores are data management systems that enable query processing across different database management systems (DBMSs); besides the distribution of data, complexity factors like schema heterogeneity and data replication must be resolved through integration and data fusion activities. In a recent work [2], we have proposed a multistore solution that relies on a dataspace to provide the user with an integrated view of the available data and enables the formulation and execution of GPSJ (generalized projection, selection and join) queries. In this paper, we propose a technique to optimize the execution of GPSJ queries by finding the most efficient execution plan on the multistore. In particular, we devise three different strategies to carry out joins and data fusion, and we build a cost model to enable the evaluation of different execution plans. Through the experimental evaluation, we are able to profile the suitability of each strategy to different multistore configurations, thus validating our multi-strategy approach and motivating further research on this topic.
Doctoral Symposium ACSOS 2021: Research directions for Aggregate Computing wi...Gianluca Aguzzi
Collective adaptive systems (CASs) are challenging from the engineering perspective. Different techniques aim at taming these systems, either using declarative or black-box approaches (e.g. Machine Learning, Evolutionary Algorithms, etc.).Among the many declarative approaches, Aggregate Computing is a novel technique by which developers can express collective system behaviours from a global perspective, using a compositional and functional programming technique. Over the years, Aggregate Computing has been applied in different scenarios, ranging from smart cities to a crowd of augmented people. Despite its promising capabilities, it is sometimes challenging to describe aggregate behaviours, so we aim at merging Aggregate Computing with black-box techniques to simplify the aggregate program synthesis
Similar to Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with ScaFi for Swarms, Edge-Cloud Ecosystems, and More (20)
Programming Distributed Collective Processes for Dynamic Ensembles and Collec...Roberto Casadei
Recent trends like the Internet of Things (IoT) suggest a vi-
sion of dense and multi-scale deployments of computing devices in nearly
all kinds of environments. A prominent engineering challenge revolves
around programming the collective adaptive behaviour of such compu-
tational ecosystems. This requires abstractions able to capture concepts
like ensembles (dynamic groups of cooperating devices) and collective
tasks (joint activities carried out by ensembles). In this work, we con-
sider collections of devices interacting with neighbours and that execute
in nearly-synchronised sense–compute–interact rounds, where the com-
putation is given by a single control program. To support programming
whole computational collectives, we propose the abstraction of a dis-
tributed collective process (DCP), which can be used to define at once
the ensemble formation logic and its collective task. We implement the
abstraction in the eXchange Calculus (XC), a core language based on
neighbouring values (maps from neighbours to values) where state man-
agement and interaction is handled through a single primitive, exchange.
Then, we discuss the features of the abstraction, its suitability for differ-
ent kinds of distributed computing applications, and provide a proof-of-
concept implementation of a wave-like process propagation.
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingRoberto Casadei
A recently proposed approach to the rigorous engineering of collective adaptive systems is the aggregate computing paradigm, which operationalises the idea of expressing collective adaptive behaviour by a global perspective as a functional composition of dynamic computational fields (i.e., structures mapping a collection of individual devices of a collective to computational values over time). In this paper, we present FScaFi, a core language that captures the essence of exploiting field computations in mainstream functional languages, and which is based on a semantic model for field computations leveraging the novel notion of “computation against a neighbour”. Such a construct models expressions whose evaluation depends on the same evaluation that occurred on a neighbour, thus abstracting communication actions and, crucially, enabling deep and straightforward integration in the Scala programming language, by the ScaFi incarnation. We cover syntax and informal semantics of FScaFi, provide examples of collective adaptive behaviour development in ScaFi, and delineate future work.
Tuple-Based Coordination in Large-Scale Situated SystemsRoberto Casadei
Space and time are key elements for many computer-based systems and often elevated to first-class abstractions. In tuple-based coordination, Linda primitives have been independently extended with space (with tuples and queries spanning spatial regions) or time information (mostly for tuple scoping). However, recent works in collective adaptive systems and aggregate computing show that space and time can naturally be considered as two intertwined facets of a common coordination abstraction for situated distributed systems. Accordingly, we introduce the Spatiotemporal Tuples model, a natural adaptation of Linda model for physically deployed large-scale networks. Unlike prior research, spatiotemporal properties – expressing where and when a tuple should range and has to be deposited/retrieved – naturally turn into specifications of collective adaptive processes, to be carried on in cooperation by the devices filling the computational environment, and sustaining tuple operations in a resilient way, possibly even in mobile and faulty environments. Additionally, the model promotes decentralised implementations where tuples actually reside where they are issued, which is good for supporting peer-to-peer and mobile ad-hoc networks as well as privacy. In this paper, we (i) present and formalise the Spatiotemporal Tuples model, based on the unifying notion of computational space-time structure, (ii) provide an implementation in the ScaFi aggregate computing framework, turning tuple operations into aggregate processes, and finally (iii) provide evaluation through simulation and a rescue case study.
Testing: an Introduction and Panorama
- what testing is
- perspectives on testing
- xUnit, TDD, acceptance testing
- pointers to more stuff about testing
On Context-Orientation in Aggregate ProgrammingRoberto Casadei
Context-awareness plays a central role in self-
adaptive software. By a programming perspective, context is
often used implicitly, and context-aware code is fragmented
in the codebase. In Context-Oriented Programming, instead,
context is considered a first-class citizen and is explicitly used
to modularise context-sensitive functionality and behavioural
variability. In this paper, we reflect on the role of context in
collective adaptive systems, by a discussion from the special
perspective of a macro paradigm, Aggregate Programming,
which supports the specification of collective behaviour by a
global perspective through functional compositions of field com-
putations. In particular, we consider the abstractions exposed in
Context-Oriented and Aggregate Programming, suggest potential
synergies in both directions, and accordingly take the first steps
towards a combined design.
Engineering distributed applications and services in emerg-
ing and open computing scenarios like the Internet of Things, cyber-physical systems and pervasive computing, calls for identifying proper abstractions to smoothly capture collective behaviour, adaptivity, and dynamic injection and execution of concurrent distributed activities. Accordingly, we introduce a notion of “aggregate process” as a concurrent
field computation whose execution and interactions are sustained by a dynamic team of devices, and whose spatial region can opportunistically vary over time. We formalise this notion by extending the Field Calculus with a new primitive construct, spawn, used to instantiate a set of field
computations and regulate key aspects of their life-cycle. By virtue of an open-source implementation in the ScaFi framework, we show basic programming examples and benefits via two case studies of mobile ad-hoc networks and drone swarm scenarios, evaluated by simulation.
Coordinating Computation at the Edge: a Decentralized, Self-organizing, Spati...Roberto Casadei
Presentation of a paper accepted at the 4th Internetional Conference on Fog and Mobile Edge Computing (FMEC).
It discusses a decentralised, self-organising, spatial, collective approach to the development of edge-clouds/edge computing ecosystems.
Brief overview of the Rust system programming language. Provides a concise introduction of its basic features, with an emphasis on its memory safety features (ownership, moves, borrowing) and programming style with generic functions, structures, and traits.
A Programming Framework for Collective Adaptive EcosystemsRoberto Casadei
On the thrust of recent technological trends, we can
envision a future where dense ecosystems of digitally empowered devices
continuously adapt and operate in our environments to provide services
both to humans and other systems. To achieve that, we arguably need to
move beyond what an individual device can provide and rather focus on
what collectives of devices can offer as a system. Aggregate Computing
is a recent, promising framework generalising over spatial computing
approaches that supports the development of collective adaptive systems
by global specifications. It builds on the framework of the field
calculus to bridge the local and global perspectives, express
collective computations in a compositional way, and formally analyse
them to derive guarantees.
In this presentation, we describe the key concepts and results, take a
look at the practical support for Aggregate Computing on the JVM
provided by scafi, and consider the main research directions on the topic.
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptxRASHMI M G
Abnormal or anomalous secondary growth in plants. It defines secondary growth as an increase in plant girth due to vascular cambium or cork cambium. Anomalous secondary growth does not follow the normal pattern of a single vascular cambium producing xylem internally and phloem externally.
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...University of Maribor
Slides from:
11th International Conference on Electrical, Electronics and Computer Engineering (IcETRAN), Niš, 3-6 June 2024
Track: Artificial Intelligence
https://www.etran.rs/2024/en/home-english/
hematic appreciation test is a psychological assessment tool used to measure an individual's appreciation and understanding of specific themes or topics. This test helps to evaluate an individual's ability to connect different ideas and concepts within a given theme, as well as their overall comprehension and interpretation skills. The results of the test can provide valuable insights into an individual's cognitive abilities, creativity, and critical thinking skills
Toxic effects of heavy metals : Lead and Arsenicsanjana502982
Heavy metals are naturally occuring metallic chemical elements that have relatively high density, and are toxic at even low concentrations. All toxic metals are termed as heavy metals irrespective of their atomic mass and density, eg. arsenic, lead, mercury, cadmium, thallium, chromium, etc.
Phenomics assisted breeding in crop improvementIshaGoswami9
As the population is increasing and will reach about 9 billion upto 2050. Also due to climate change, it is difficult to meet the food requirement of such a large population. Facing the challenges presented by resource shortages, climate
change, and increasing global population, crop yield and quality need to be improved in a sustainable way over the coming decades. Genetic improvement by breeding is the best way to increase crop productivity. With the rapid progression of functional
genomics, an increasing number of crop genomes have been sequenced and dozens of genes influencing key agronomic traits have been identified. However, current genome sequence information has not been adequately exploited for understanding
the complex characteristics of multiple gene, owing to a lack of crop phenotypic data. Efficient, automatic, and accurate technologies and platforms that can capture phenotypic data that can
be linked to genomics information for crop improvement at all growth stages have become as important as genotyping. Thus,
high-throughput phenotyping has become the major bottleneck restricting crop breeding. Plant phenomics has been defined as the high-throughput, accurate acquisition and analysis of multi-dimensional phenotypes
during crop growing stages at the organism level, including the cell, tissue, organ, individual plant, plot, and field levels. With the rapid development of novel sensors, imaging technology,
and analysis methods, numerous infrastructure platforms have been developed for phenotyping.
Professional air quality monitoring systems provide immediate, on-site data for analysis, compliance, and decision-making.
Monitor common gases, weather parameters, particulates.
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxMAGOTI ERNEST
Although Artemia has been known to man for centuries, its use as a food for the culture of larval organisms apparently began only in the 1930s, when several investigators found that it made an excellent food for newly hatched fish larvae (Litvinenko et al., 2023). As aquaculture developed in the 1960s and ‘70s, the use of Artemia also became more widespread, due both to its convenience and to its nutritional value for larval organisms (Arenas-Pardo et al., 2024). The fact that Artemia dormant cysts can be stored for long periods in cans, and then used as an off-the-shelf food requiring only 24 h of incubation makes them the most convenient, least labor-intensive, live food available for aquaculture (Sorgeloos & Roubach, 2021). The nutritional value of Artemia, especially for marine organisms, is not constant, but varies both geographically and temporally. During the last decade, however, both the causes of Artemia nutritional variability and methods to improve poorquality Artemia have been identified (Loufi et al., 2024).
Brine shrimp (Artemia spp.) are used in marine aquaculture worldwide. Annually, more than 2,000 metric tons of dry cysts are used for cultivation of fish, crustacean, and shellfish larva. Brine shrimp are important to aquaculture because newly hatched brine shrimp nauplii (larvae) provide a food source for many fish fry (Mozanzadeh et al., 2021). Culture and harvesting of brine shrimp eggs represents another aspect of the aquaculture industry. Nauplii and metanauplii of Artemia, commonly known as brine shrimp, play a crucial role in aquaculture due to their nutritional value and suitability as live feed for many aquatic species, particularly in larval stages (Sorgeloos & Roubach, 2021).
BREEDING METHODS FOR DISEASE RESISTANCE.pptxRASHMI M G
Plant breeding for disease resistance is a strategy to reduce crop losses caused by disease. Plants have an innate immune system that allows them to recognize pathogens and provide resistance. However, breeding for long-lasting resistance often involves combining multiple resistance genes
What is greenhouse gasses and how many gasses are there to affect the Earth.moosaasad1975
What are greenhouse gasses how they affect the earth and its environment what is the future of the environment and earth how the weather and the climate effects.
Travis Hills' Endeavors in Minnesota: Fostering Environmental and Economic Pr...Travis Hills MN
Travis Hills of Minnesota developed a method to convert waste into high-value dry fertilizer, significantly enriching soil quality. By providing farmers with a valuable resource derived from waste, Travis Hills helps enhance farm profitability while promoting environmental stewardship. Travis Hills' sustainable practices lead to cost savings and increased revenue for farmers by improving resource efficiency and reducing waste.
Richard's aventures in two entangled wonderlandsRichard Gill
Since the loophole-free Bell experiments of 2020 and the Nobel prizes in physics of 2022, critics of Bell's work have retreated to the fortress of super-determinism. Now, super-determinism is a derogatory word - it just means "determinism". Palmer, Hance and Hossenfelder argue that quantum mechanics and determinism are not incompatible, using a sophisticated mathematical construction based on a subtle thinning of allowed states and measurements in quantum mechanics, such that what is left appears to make Bell's argument fail, without altering the empirical predictions of quantum mechanics. I think however that it is a smoke screen, and the slogan "lost in math" comes to my mind. I will discuss some other recent disproofs of Bell's theorem using the language of causality based on causal graphs. Causal thinking is also central to law and justice. I will mention surprising connections to my work on serial killer nurse cases, in particular the Dutch case of Lucia de Berk and the current UK case of Lucy Letby.
This presentation explores a brief idea about the structural and functional attributes of nucleotides, the structure and function of genetic materials along with the impact of UV rays and pH upon them.
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Sérgio Sacani
Since volcanic activity was first discovered on Io from Voyager images in 1979, changes
on Io’s surface have been monitored from both spacecraft and ground-based telescopes.
Here, we present the highest spatial resolution images of Io ever obtained from a groundbased telescope. These images, acquired by the SHARK-VIS instrument on the Large
Binocular Telescope, show evidence of a major resurfacing event on Io’s trailing hemisphere. When compared to the most recent spacecraft images, the SHARK-VIS images
show that a plume deposit from a powerful eruption at Pillan Patera has covered part
of the long-lived Pele plume deposit. Although this type of resurfacing event may be common on Io, few have been detected due to the rarity of spacecraft visits and the previously low spatial resolution available from Earth-based telescopes. The SHARK-VIS instrument ushers in a new era of high resolution imaging of Io’s surface using adaptive
optics at visible wavelengths.
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Programming (and Learning) Self-Adaptive & Self-Organising Behaviour with ScaFi for Swarms, Edge-Cloud Ecosystems, and More
1. Programming (and Learning) Self-Adaptive & Self-Organising Behaviour
with ScaFi
for Swarms, Edge-Cloud Ecosystems, and More
Roberto Casadei roby.casadei@unibo.it
Gianluca Aguzzi gianluca.aguzzi@unibo.it
Danilo Pianini danilo.pianini@unibo.it
Mirko Viroli mirko.viroli@unibo.it
Alma Mater Studiorum – Università di Bologna
Talk @ International Conference on Autonomic Computing and Self-Organizing Systems (ACSOS)
11/12/2023
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 1 / 48
2. Tutorial Quickstart
Contents
1 Tutorial Quickstart
2 Introduction
Context – Collective Adaptive Systems
Aggregate Computing
3 Playing with ScaFi!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 2 / 48
3. Tutorial Quickstart
Tutorial references
Where do I start?
https://github.com/AggregateComputing/acsos-2023-scafi-tutorial:
repository with the examples/exercises proposed in the tutorial
Follow the README.md to run examples and setup a development environment.
ScaFi-Web [1] (a online web simulator for ScaFi programs)
https://scafi.github.io/web
https://tomcat-glad-muskox.ngrok-free.app/
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 3 / 48
4. Tutorial Quickstart
Frequently Asked Questions (FAQs) I
What is it all about? ScaFi is an aggregate programming language: it supports the
development of self-organising behaviours. It is integrated into Alchemist: this
allows to build simulations of networked systems that execute ScaFi programs.
Where do I start? Slide 3
How can I quickly experiment with the programming model?
ScaFi-Web [1] (a online web simulator for ScaFi programs)
https://scafi.github.io/web
https://tomcat-glad-muskox.ngrok-free.app/
Where do I learn more about the tools (ScaFi, Alchemist)?
https://scafi.github.io/
http://alchemistsimulator.github.io/
Where do I learn more about the theory/research on aggregate computing (AC)?
Check out relevant presentations and papers.
https://www.slideshare.net/RobertoCasadei/
aggregate-computing-research-an-overview – a quick overview of AC research
M. Viroli, J. Beal, F. Damiani, et al., “From distributed coordination to field calculus
and aggregate computing,” J. Log. Algebraic Methods Program., vol. 109, 2019. doi:
10.1016/j.jlamp.2019.100486 – a survey about AC, its history, and main
developments
What is the research context? Check out Slide 8–Slide 16
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 4 / 48
5. Tutorial Quickstart
Frequently Asked Questions (FAQs) II
What kind of systems can be programmed/developed with AC? Check out Slide 21
and Slide 8–Slide 16
Where do I get an overview of relevant literature about aggregate computing?
https://www.slideshare.net/RobertoCasadei/
aggregate-computing-research-an-overview
M. Viroli, J. Beal, F. Damiani, et al., “From distributed coordination to field calculus
and aggregate computing,” J. Log. Algebraic Methods Program., vol. 109, 2019. doi:
10.1016/j.jlamp.2019.100486
What is the key literature about ScaFi?
software: R. Casadei, M. Viroli, G. Aguzzi, et al., “Scafi: A scala DSL and toolkit for
aggregate programming,” SoftwareX, vol. 20, p. 101 248, 2022. doi:
10.1016/j.softx.2022.101248. [Online]. Available:
https://doi.org/10.1016/j.softx.2022.101248 [3]
calculus: G. Audrito, R. Casadei, F. Damiani, et al., “Computation against a
neighbour: Addressing large-scale distribution and adaptivity with functional
programming and scala,” Log. Methods Comput. Sci., vol. 19, no. 1, 2023. doi:
10.46298/lmcs-19(1:6)2023. [Online]. Available:
https://doi.org/10.46298/lmcs-19(1:6)2023 [4]
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 5 / 48
6. Introduction
Contents
1 Tutorial Quickstart
2 Introduction
Context – Collective Adaptive Systems
Aggregate Computing
3 Playing with ScaFi!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 6 / 48
7. Introduction Context – Collective Adaptive Systems
Contents
1 Tutorial Quickstart
2 Introduction
Context – Collective Adaptive Systems
Aggregate Computing
3 Playing with ScaFi!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 7 / 48
8. Introduction Context – Collective Adaptive Systems
Context
Modern IT systems are more and more complex
increasing availability of wearable/mobile/embedded/flying devices
increasing availability of heterogeneous wireless networks
increasing availability of computational resources (edge/fog/cloud computing)
increasing production of data everywhere and anytime
The challenge
Consider the worst-case possible scenario
zillion of devices unpredictably located and moving in a space
heterogeneous displacement, pervasive sensing/actuation
computational services are contextual (proximity-based) and dynamic
How can we program such systems?
What are the right abstractions?
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 8 / 48
9. Collective Adaptive Systems (CASs)
Systems composed of possibly large set of component executing a collective task
strongly relying on component interactions and showing inherent adaptivity.
10. Introduction Context – Collective Adaptive Systems
Examples: controlling a fleet of drones
Issues
Design techniques to reactively propagate information across the fleet
Create algorithms for higher-level programming of the fleet
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 10 / 48
11. Introduction Context – Collective Adaptive Systems
Examples: pedestrian steering in (smart)cities
Issue
Design self-organisation algorithms for people navigation
More generally, design map-based large-scale applications
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 11 / 48
12. Introduction Context – Collective Adaptive Systems
Examples: fine control of crowds
Issues
Evaluating the influence of environment in crowd formation
Evaluating the influence of ambient sensors, cameras and wearable devices
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 12 / 48
13. Introduction Context – Collective Adaptive Systems
Collective Adaptive Systems
Adaptation
A system is adaptive if it can change its behaviour depending on circumstances, in order
to better reach its goal
ú Adaptivess in intrisic to open complex system (like CASs)
Kind of adaptiveness, self-* properties
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 13 / 48
14. Introduction Context – Collective Adaptive Systems
Kind of adaptiveness
Self-adaptiveness: general level
self-adaptiveness ú the ultimate property we perceive from outside
the terms “self-*” recalls a property achieved in autonomy
subcases: self-managing, -governing, -maintenance, -control
Major level
internal properties related to overall system management
subcases: self-configuring, self-healing, self-optimising, self-protecting
defined in the context of autonomic computing
Primitive level
internal properties related to primitive aspects
subcases: self-awareness, context-awareness
means being able to properly perceive the own state, context, . . .
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 14 / 48
15. Introduction Context – Collective Adaptive Systems
The case of self-organisation
Self-organisation
The ability of creating spatial/temporal patterns out of the local interaction of individuals
Self-adaptive vs. self-organising
self-adaptive: a top-down way of achieving adaptiveness
ú we have the adaptation goal, and accordingly guide components
self-organising: a bottom-up way of achieving adaptiveness
ú the adaptive behaviour emerges from local interactions
The typical approach in large-scale CASs
Born in the context of swarm intelligence
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 15 / 48
16. Introduction Context – Collective Adaptive Systems
Good Abstraction for CASs?
Ideas
specify overall behaviour, not individual device program
abstract from the actual shape of interactions
automatically adapt to environment details
focus on how the global output pattern can be obtained from global inputs
focus on both spatial and temporal computing patterns
ú the ideas around macro-programming paradigms [5]!
Aggregate computing
Buzz
. . .
Ruccurent abstractions:
Ensembles & collective tasks
Self-organising information flows
Self-healing collective structures (e.g., gradients)
[5] R. Casadei, “Macroprogramming: Concepts, state of the art, and opportunities of macroscopic
behaviour modelling,” ACM Comput. Surv., vol. 55, no. 13s, 2023, issn: 0360-0300. doi: 10.1145/3579353
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 16 / 48
17. Introduction Aggregate Computing
Contents
1 Tutorial Quickstart
2 Introduction
Context – Collective Adaptive Systems
Aggregate Computing
3 Playing with ScaFi!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 17 / 48
18. Introduction Aggregate Computing
Aggregate Computing (AC) in 1 Slide
Self-org-like computational model
interaction: repeated msg exchange with neighbours
behaviour: repeated execution of async rounds of sense
– compute – (inter)act
formal model of executions: event structures
abstraction: computational fields (dev/evt 7→ V)
formal core language: field calculus [2]
paradigm: functional, macro-programming
source destination
gradient distance
gradient
<=
+
dilate
width
37
10
def channel(source: Boolean, target: Boolean, width: Double) =
dilate(gradient(source) + gradient(target) <=
distance(source, target), width)
M. Viroli, J. Beal, F. Damiani, et al., “From distributed co-
ordination to field calculus and aggregate computing,” J. Log.
Algebraic Methods Program., vol. 109, 2019. doi: 10.1016/j.
jlamp.2019.100486
δ0
δ1
δ2
δ3
δ4
device
time
0
0 0
1 0
2 0
3 0
4
1
0 1
1 1
2 1
3 1
4 1
5
2
0 2
1 2
2 2
3
3
0 3
1 3
2 3
3 3
4 3
5
4
0 4
1 4
2
m
e
s
s
a
g
e
self-message
reboot
sensors
local functions
actuators
Application
Code
Developer
APIs
Field Calculus
Constructs
Resilient
Coordination
Operators
Device
Capabilities
functions rep
nbr
T
G
C
functions
communication state
Perception
Perception
summarize
average
regionMax
…
Action
Action State
State
Collective Behavior
Collective Behavior
distanceTo
broadcast
partition
…
timer
lowpass
recentTrue
…
collectivePerception
collectiveSummary
managementRegions
…
Crowd Management
Crowd Management
dangerousDensity crowdTracking
crowdWarning safeDispersal
restriction
selfstabilisation
J. Beal, D. Pianini, and M. Viroli, “Aggregate programming
for the internet of things,” IEEE Computer, vol. 48, no. 9,
pp. 22–30, 2015. doi: 10.1109/MC.2015.261
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 18 / 48
19. Aggregate Computing
Program the aggregate, not the individual device
○ Computing Machine ú an ensemble of devices as a single body, fading the actual
space
○ Elaboration process ú atomic manipulation of a collective data structure
(computational field)
○ Networked computation ú a proximity-based self-organising system hidden
“under-the-hood”
20. Introduction Aggregate Computing
Computational model – self-organisation-like execution
Continuous communication with neighbours only (údecentralisation)
Continous execution of async rounds of sense - compute - communicate
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 20 / 48
21. Introduction Aggregate Computing
Applicability: in a nutshell
Essentially, this approach can be used to program any system that can be recast to the
following
Structure: network of locally interacting agents
neighbouring relationship: e.g. based on network connectivity, physical distance, social
relationship, or whatever
dynamicity/openness: devices may move/fail, enter/exit the system at runtime, and
neighbourhoods may change
Interaction:
with neighbours: asynchronous message passing
with environment: via sensors and actuators
Behaviour: sense–compute–interact
sense: acquire context (messages from neighbours, values from sensors)
compute: mapping context to (inter-)action
interact: sending messages to neighbours and running actuation
So, best for applications that are:
progressive/long-running: require multiple coordinated steps/rounds of local
processing and action
Assuming this system model, AC is about how to specify the “compute” part so that
global emergent outcomes can be eventually attained
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 21 / 48
22. Introduction Aggregate Computing
Computational Fields: a static view
Traditionally a map: Space 7→ Values
possibly: evolving over time, dynamically injected, stabilising
smoothly adapting to very heterogeneous domains
more easily “understood” on continuous and flat spatial domains
ranging to booleans, reals, vectors, functions
boolean channel in 2D numeric partition in 2D real-valued gradient in 3D
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 22 / 48
23. Introduction Aggregate Computing
Computational Fields revisited: a dynamic view
A field as a space-time structure: φ : D 7→ V
event E: a triple hδ, t, pi – device δ, “firing” at time t in position p
events domain D: a coherent set of events (devices cannot move too fast)
field values V : any data value
ú computation abstracts from/adapts to the underlying event
ú scheduling of events is essentially exogenous
Time
Space
Domain
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 23 / 48
24. Introduction Aggregate Computing
Computational Fields revisited: a dynamic view
A field as a space-time structure: φ : D 7→ V
event E: a triple hδ, t, pi – device δ, “firing” at time t in position p
events domain D: a coherent set of events (devices cannot move too fast)
field values V : any data value
ú computation abstracts from/adapts to the underlying event
ú scheduling of events is essentially exogenous
Time
Space
Domain
Time
Space
Field
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 23 / 48
25. Introduction Aggregate Computing
Computational Fields revisited: a dynamic view
A field as a space-time structure: φ : D 7→ V
event E: a triple hδ, t, pi – device δ, “firing” at time t in position p
events domain D: a coherent set of events (devices cannot move too fast)
field values V : any data value
ú computation abstracts from/adapts to the underlying event
ú scheduling of events is essentially exogenous
Time
Space
Domain
Time
Space
Field
will later show only snapshots of fields in 2D space..
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 23 / 48
26. Introduction Aggregate Computing
Aggregate programming as a functional approach
Functionally composing fields
Inputs: sensor fields, Output: actuator field
Computation is a pure function over fields (time embeds state!)
ú for this to be practical/expressive we need a good programming language
source destination
gradient distance
gradient
=
+
dilate
width
37
10
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 24 / 48
27. Introduction Aggregate Computing
Preview
How do we want that computation to be expressed?
source, dest and width as inputs
gradient, distance and dilate as reusable functions
ú note we are reusing and composing global-level, aggregate specs
source destination
gradient distance
gradient
=
+
dilate
width
37
10
def channel(source: Boolean, dest: Boolean, width: Double): Boolean = {
dilate(gradient(source) + gradient(dest) = distance(source,dest), width)
}
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 25 / 48
28. Introduction Aggregate Computing
Field calculus model
Key idea
a sort of λ-calculus with “everything is a field” philosophy!
Syntax – Reduced
e ::= x v e(e1, . . . , en) rep(e0){e} nbr{e} (expr)
v ::= standard-values λ (value)
λ ::= f o (x)=e (functional value)
F ::= def f(x) {e} (function definition)
Few explanations
v includes numbers, booleans, strings,..
..tuples/vectors/maps/any-ADT (of expressions)
f is a user-defined function (the key aggregate computing abstraction)
o is a built-in local operator (pure math, local sensors,..)
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 26 / 48
29. Introduction Aggregate Computing
Intuition of global-level (denotational) semantics
The four main constructs at work
⇒ values, application, evolution, and interaction – in aggregate guise
e ::= . . . v e(e1, . . . , en) rep(e0){e} nbr{e}
0
(x)=x+1
true t0,1
()
0
1
+
-
1
-1
ef(0,1)
ef
rep
0
(x)=x+1
t
v0
t
v1
..
rep(0){(x)=x+1}
nbr d
e
nbr{e}
φd=[d1→v1,..,dn→vn]
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 27 / 48
30. Introduction Aggregate Computing
Intuition of global-level semantics – More
Value v
A field constant in space and time, mapping any event to v
Function application e(e1, . . . , en)
e evaluates to a field of functions, assume it ranges to λ1, . . . , λn
this naturally induces a partition of the domain D1, . . . , Dn
now, join the fields: ∀i, λi (e1, . . . , en) restricted in Di
Repetition rep(e0){eλ}
the value of e0 where the restricted domain “begins”
elsewhere, unary function eλ is applied to previous value at each device
Neighbouring field construction nbr{e}
at each event gathers most recent value of e in neighbours (in restriction)
..what is neighbour is orthogonal (i.e., physical proximity)
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 28 / 48
31. Introduction Aggregate Computing
Key aspects of the semantics: network model
Platform abstract model
A node state θ (value-tree) updated at asynchronous rounds
At the end of the round, θ is made accessible to the neighbourhood
A node state is updated “against” recently received neighbours’ trees
Neighbour trees
aka, message queue
Evaluation tree
Nodes send their
evaluation tree to
neighbours at the end
of each computation round
Node A
Node B
Node C
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 29 / 48
32. Introduction Aggregate Computing
Tree evaluation: pictorial semantics
Neighbour trees Evaluation tree
rep
if
nbr fun
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 30 / 48
33. Introduction Aggregate Computing
Tree evaluation: pictorial semantics
Neighbour trees Evaluation tree
rep
if
nbr fun
time
persistence
domain
restriction
neighbour
alignment
tree
expansion
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 30 / 48
34. Introduction Aggregate Computing
Core mechanisms in the operational semantics
Orthogonally..
evaluation proceeds recursively on expression and neighbour trees
neighbour trees may be discarded on-the-fly if not “aligned” (restriction)
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 31 / 48
35. Introduction Aggregate Computing
Core mechanisms in the operational semantics
Orthogonally..
evaluation proceeds recursively on expression and neighbour trees
neighbour trees may be discarded on-the-fly if not “aligned” (restriction)
Function application e(e1, . . . , en)
evaluates the body against a filtered set of neighbours . . .
..i.e., only those which evaluated e to the same result
Repetition rep(e0){eλ}
if a previous value-tree of mine is available, evaluates eλ on its root
otherwise, evaluates e0
Neighbouring field construction nbr{e}
gather values from neighbour trees currently aligned
add my current evaluation of e
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 31 / 48
36. Introduction Aggregate Computing
Operational semantics as a blueprint for platform support
Requirements
a notion of the neighbourhood must be defined — wireless connectivity, physical
proximity . . .
nodes execute in asynchronous rounds, and emit a “round result”
a node needs to have recent round results of neighbours
by construction we tolerate losses of messages
by construction we tolerate various round frequencies
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 32 / 48
37. Introduction Aggregate Computing
Operational semantics as a blueprint for platform support
Requirements
a notion of the neighbourhood must be defined — wireless connectivity, physical
proximity . . .
nodes execute in asynchronous rounds, and emit a “round result”
a node needs to have recent round results of neighbours
by construction we tolerate losses of messages
by construction we tolerate various round frequencies
Platform details are very orthogonal to our programming model!
the above requirements can be met by various platforms
programming remains mostly unaltered!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 32 / 48
38. ScaFi (Scala Fields)
A Scala toolkit providing an internal domain-specific language, libraries, a
simulation environment, and runtime support for practical aggregate computing
systems development
40. Introduction Aggregate Computing
ScaFi: Design
it.unibo.scafi
Incarnation
AggregateProgram
StandardSensors
def nbrRange(): D
def currentTime(): Time
...
SpatialAbstraction
P Space[E]
D
TimeAbstraction
Time
Core
CNAME ID
Context
def selfId: ID
def exports(): Iterable[(ID,Export)]
def sense[T](ls: CNAME): Option[T]
def nbrSense[T](ns: CNAME)(nbr:ID): Option[T]
Export
def root[A](): A
Core
Engine
ContextImpl ExportImpl
factory : EngineFactory
Semantics
ExecutionTemplate
def round(ctx: Context): Export
RoundVM
Language
Constructs
def nbr[A](exp: = A): A
def rep[A](init: =A)(f: (A)=A): A
...
StandardLibrary
BlockG BlockC
BlockS ...
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 35 / 48
41. Introduction Aggregate Computing
ScaFi: syntax as a core language/API
trait Constructs {
// the unique identifier of the local device
def mid(): ID
// applies fun to the previous result, or to init at the first call
def rep[A](init: A)(fun: (A) = A): A
// evaluation of expr at the currently-considered neighbour
def nbr[A](expr: = A): A
// accumulates available evaluations of expr, with acc/init monoid
def foldhood[A](init: = A)(acc: (A,A)=A)(expr: = A): A
// splits computation: th where cond is true, el everywhere/time else
def branch[A](cond: = Boolean)(th: = A)(el: = A): A
// perception of local sensor
def sense[A](name: CNAME): A
// perception of neighbourhood sensor
def nbrvar[A](name: CNAME): A
...
}
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 36 / 48
42. Introduction Aggregate Computing
ScaFi: setup an aggregate application
package experiments
// STEP 1 Choose an incarnation (simulated or real)
import it.unibo.scafi.incarnations.BasicSimulationIncarnation._
// STEP 2 Define the aggregate program including the right libraries
class MyProgram extends AggregateProgram with Libs {
// STEP 2.1 Define main logic of the program
override def main(): Any = ...
}
// STEP 3 Platform/Node setup (both in simulation/real)
// STEP 3.1 in case of ScaFi simulation:
object SimulationRunner extends Launcher {
Settings.Sim_ProgramClass = experiments.MyAggregateProgram
Settings.ShowConfigPanel = true
launch()
}
So let us start playing with ScaFi!!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 37 / 48
43. Playing with ScaFi!
Contents
1 Tutorial Quickstart
2 Introduction
Context – Collective Adaptive Systems
Aggregate Computing
3 Playing with ScaFi!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 38 / 48
44. Playing with ScaFi!
An aggregate computing playground – ScaFi Web!
https://scafi.github.io/web/
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 39 / 48
45. Playing with ScaFi!
Guided Examples!
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 40 / 48
46. Playing with ScaFi!
Example 1: static constant field
// 1. Select the incarnation
import it.unibo.alchemist.model.scafi.ScafiIncarnationForAlchemist._
// 2. define your aggregate program by extending 'AggregateProgram'
class Example1 extends AggregateProgram {
// 3. define the main method of the aggregate computing script
override def main(): Int = 22
}
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 41 / 48
47. Playing with ScaFi!
Example 3: sensor query
mid() provides the device ID
// Code in the AggregateProgram's main method:
mid()
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 42 / 48
48. Playing with ScaFi!
Example 4: sensor query
sense(name) reads the current value of a sensor
sense[Boolean](source)
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 43 / 48
49. Playing with ScaFi!
Example 5: neighbour interaction
foldhood(i)(f)(e) aggregates with f the neighbours’ values for e
// *Plus version does not consider the device itself in the neighbourhood
foldhoodPlus(0)((a,b) = a + b)(nbr(1))
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 44 / 48
50. Playing with ScaFi!
Example 6: stateful computations
rep(i)(f) updates a value (initially i) through function f
rep(0){ _ + 1 }
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 45 / 48
51. Playing with ScaFi!
Example 8: self-healing gradient
Field of minimum distances from source nodes
rep(Double.PositiveInfinity)(distance =
mux(sense[Boolean](source)) {
0.0
} {
minHoodPlus(nbr(distance) + nbrRange)
}
)
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 46 / 48
52. Programming (and Learning) Self-Adaptive Self-Organising Behaviour
with ScaFi
for Swarms, Edge-Cloud Ecosystems, and More
Roberto Casadei roby.casadei@unibo.it
Gianluca Aguzzi gianluca.aguzzi@unibo.it
Danilo Pianini danilo.pianini@unibo.it
Mirko Viroli mirko.viroli@unibo.it
Alma Mater Studiorum – Università di Bologna
Talk @ International Conference on Autonomic Computing and Self-Organizing Systems (ACSOS)
11/12/2023
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023 47 / 48
53. References
References I
[1] G. Aguzzi, R. Casadei, N. Maltoni, D. Pianini, and M. Viroli, “Scafi-web: A web-based application
for field-based coordination programming,” in Coordination Models and Languages - 23rd IFIP WG
6.1 International Conference, COORDINATION 2021, Held as Part of the 16th International
Federated Conference on Distributed Computing Techniques, DisCoTec 2021, Valletta, Malta, June
14-18, 2021, Proceedings, F. Damiani and O. Dardha, Eds., ser. Lecture Notes in Computer Science,
vol. 12717, Springer, 2021, pp. 285–299. doi: 10.1007/978-3-030-78142-2_18. [Online]. Available:
https://doi.org/10.1007/978-3-030-78142-2_18.
[2] M. Viroli, J. Beal, F. Damiani, G. Audrito, R. Casadei, and D. Pianini, “From distributed
coordination to field calculus and aggregate computing,” J. Log. Algebraic Methods Program.,
vol. 109, 2019. doi: 10.1016/j.jlamp.2019.100486.
[3] R. Casadei, M. Viroli, G. Aguzzi, and D. Pianini, “Scafi: A scala DSL and toolkit for aggregate
programming,” SoftwareX, vol. 20, p. 101 248, 2022. doi: 10.1016/j.softx.2022.101248. [Online].
Available: https://doi.org/10.1016/j.softx.2022.101248.
[4] G. Audrito, R. Casadei, F. Damiani, and M. Viroli, “Computation against a neighbour: Addressing
large-scale distribution and adaptivity with functional programming and scala,” Log. Methods
Comput. Sci., vol. 19, no. 1, 2023. doi: 10.46298/lmcs-19(1:6)2023. [Online]. Available:
https://doi.org/10.46298/lmcs-19(1:6)2023.
[5] R. Casadei, “Macroprogramming: Concepts, state of the art, and opportunities of macroscopic
behaviour modelling,” ACM Comput. Surv., vol. 55, no. 13s, 2023, issn: 0360-0300. doi:
10.1145/3579353.
[6] J. Beal, D. Pianini, and M. Viroli, “Aggregate programming for the internet of things,” IEEE
Computer, vol. 48, no. 9, pp. 22–30, 2015. doi: 10.1109/MC.2015.261.
Casedei (DISI, Univ. Bologna) Programming with ScaFi! 11/12/2023