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.
Towards Automated Engineering for Collective Adaptive Systems: Vision and Research Directions
1. Towards Automated Engineering for Collective Adaptive
Systems: Vision and Research Directions
Roberto Casadei1
, Danilo Pianini1
, Gianluca Aguzzi1
, Giorgio Audrito2
, Gianluca
Torta2
, Marco Ottina2
, Ferruccio Damiani2
, Mirko Viroli1
1
Alma Mater Studiorum – Università of Bologna
2
Università degli Studi di Torino
September 13th, 2022
R. Casadei References 1/12
2. Problem: collective adaptive systems (CASs) engineering
Collective Adaptive System (CAS): a multitude of homogeneous agents inter/acting and
adapting as a whole with no central coordinator
Research Question (RQ): how to effectively engineer collective adaptive behaviour?
R. Casadei References 2/12
3. SotA: Aggregate Computing (AC) (in 1 Slide)
Self-org-like computational model
interaction: continuous msg exchange with neighbours
behaviour: continuous execution of async rounds of
sense – compute – (inter)act
formal model of executions: event structures
R. Casadei References 3/12
4. SotA: Aggregate Computing (AC) (in 1 Slide)
Self-org-like computational model
interaction: continuous msg exchange with neighbours
behaviour: continuous execution of async rounds of
sense – compute – (inter)act
formal model of executions: event structures
δ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
R. Casadei References 3/12
5. SotA: Aggregate Computing (AC) (in 1 Slide)
Self-org-like computational model
interaction: continuous msg exchange with neighbours
behaviour: continuous 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 [1]
paradigm: functional, macro-programming
source destination
gradient distance
gradient
=
+
dilate
width
37
10
1 def channel(source: Boolean, destination:
2 Boolean, width: Double) =
3 dilate(gradient(source) + gradient(destination) =
4 distance(source, destination), width)
M. Viroli, J. Beal, F. Damiani, G. Audrito, R. Casadei, and D. Pianini, “From dis-
tributed coordination to field calculus and aggregate computing,” J. Log. Algebraic
Methods Program., 2019
δ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
R. Casadei References 3/12
6. SotA: Aggregate Computing (AC) (in 1 Slide)
Self-org-like computational model
interaction: continuous msg exchange with neighbours
behaviour: continuous 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 [1]
paradigm: functional, macro-programming
source destination
gradient distance
gradient
=
+
dilate
width
37
10
1 def channel(source: Boolean, destination:
2 Boolean, width: Double) =
3 dilate(gradient(source) + gradient(destination) =
4 distance(source, destination), width)
M. Viroli, J. Beal, F. Damiani, G. Audrito, R. Casadei, and D. Pianini, “From dis-
tributed coordination to field calculus and aggregate computing,” J. Log. Algebraic
Methods Program., 2019
δ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
R. Casadei References 3/12
7. SotA: AC toolchain
properties
formal
foundation
field calculus (and variants)
NC XC
HFC ...
field calculus restrictions
GPI ...
self-stab ...
programming
languages
Proto
(Scheme)
Protelis
(xtext)
ScaFi
(Scala)
FCPP
(C++)
simulation
Alchemist
simulator
FCPP
simulator
ScaFi
simulator
Proto
simulator
ScaFi
web
eventual
consistency
deployment
independ.
ScaFi-
Akka
execution
Android/
REST/
Cloud
pulverisation
R. Casadei References 4/12
8. Gap: Current CAS development workflow in AC
1. Analysis. Think about the desired collective outcome and how to drive it by local activity
2. Design/implementation. Write the aggregate software
3. Testing via simulation. Define a system (network), a set of environments, the program
the be executed, and run a batch of simulations.
∠ Verify self-stabilisation (does the system
eventually reach a stable correct state?)
∠ Verify correctness of dynamic behaviour in a set
of target environments
∠ Verify resilience in a set of stressful
environments
4. Deploy and/or iterate to 1/2.
R. Casadei References 5/12
9. Gap: Current CAS development workflow in AC
1. Analysis. Think about the desired collective outcome and how to drive it by local activity
2. Design/implementation. Write the aggregate software
3. Testing via simulation. Define a system (network), a set of environments, the program
the be executed, and run a batch of simulations.
∠ Verify self-stabilisation (does the system
eventually reach a stable correct state?)
∠ Verify correctness of dynamic behaviour in a set
of target environments
∠ Verify resilience in a set of stressful
environments
4. Deploy and/or iterate to 1/2.
Gap / limitations
Process is mostly manual and creative
∠ Devising a correct implementation with desired properties (e.g., self-stab)
∠ Devising the set of environments for testing
Lack of automation and process-wide tool support
R. Casadei References 5/12
10. Vision/Proposal: automated CAS engineering
1. Analysis. Think about the desired collective outcome and how to drive it by local activity
2. Specify. Define the set of key environmental traits and metrics/KPIs
∠ Tool automatically generates a set of simulation scenarios.
3. Design/implementation. Write the aggregate software and/or generate portions of code
∠ If not easy: provide collective I/O examples and let a program synthesizer provide a program
∠ Alternatively: use machine learning to synthesise program fragments or good execution policies
4. Enforce program properties (e.g., self-stab). Tool automatically rewrites the program to
get guarantees
5. Static analysis. Providing warnings, checks for guarantees, etc.
6. Testing via simulation. Define a system (network), a set of environments, the program
the be executed, and run a batch of simulations. Run the simulation generated by the tool,
extracting the desired metrics as well as common performance metrics, and what-if
analysis results.
7. Deploy and/or iterate to 1/2.
R. Casadei References 6/12
11. Vision/Proposal: elements
1. Methodology for systematic CAS/AC system development
2. Formalisation of architecture and environment constraints
3. Assisted coding
4. Assisted testing, debugging, and deployment
R. Casadei References 7/12
12. Vision/Proposal: extended AC toolchain
properties
formal
foundation
field calculus (and variants)
NC XC
HFC ...
field calculus restrictions
GPI ...
self-stab ...
programming
and specification
languages
Proto
(Scheme)
Protelis
(xtext)
ScaFi
(Scala)
FCPP
(C++)
simulation
Alchemist
simulator
FCPP
simulator
ScaFi
simulator
Proto
simulator
ScaFi
web
eventual
consistency
deployment
independ.
ScaFi-
Akka
execution
Android/
REST/
Cloud
pulverisation
static
analysis
automation
tools
static
analyzers
program
synthetizers
ML
modules
test case /
simulation
generator
Environment
Architectural
Description
Languages
CAS
development
methodology
R. Casadei References 8/12
13. Conclusion Roadmap
Our vision is about automated engineering of CASs, end-to-end supported by tools
∠ this goes beyond AC, though AC makes for an ideal starting point
R. Casadei References 9/12
14. Conclusion Roadmap
Our vision is about automated engineering of CASs, end-to-end supported by tools
∠ this goes beyond AC, though AC makes for an ideal starting point
Realizing the vision requires a synergic scientific and engineering endeavour
∠ going from deep understanding of emergence, self-organisation, macro-programming
∠ to the implementation of CI/CD, IDEs, synthesis, ML, static/runtime tools
R. Casadei References 9/12
15. Conclusion Roadmap
Our vision is about automated engineering of CASs, end-to-end supported by tools
∠ this goes beyond AC, though AC makes for an ideal starting point
Realizing the vision requires a synergic scientific and engineering endeavour
∠ going from deep understanding of emergence, self-organisation, macro-programming
∠ to the implementation of CI/CD, IDEs, synthesis, ML, static/runtime tools
Building on several recent research results [3] [4] [5] [6] [7] [8] [9] [10]
R. Casadei References 9/12
17. References (1/2)
[1] 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.
[2] J. Beal, D. Pianini, and M. Viroli, “Aggregate programming for the internet of things,” Computer,
vol. 48, no. 9, pp. 22–30, 2015.
[3] R. Casadei, G. Fortino, D. Pianini, A. Placuzzi, C. Savaglio, and M. Viroli, “A methodology and
simulation-based toolchain for estimating deployment performance of smart collective services at
the edge,” IEEE Internet of Things Journal, pp. 1–1, 2022, to appear. DOI:
10.1109/JIOT.2022.3172470.
[4] G. Aguzzi, R. Casadei, and M. Viroli, “Towards reinforcement learning-based aggregate computing,”
in International Conference on Coordination Languages and Models, Springer, 2022, pp. 72–91.
[5] D. Pianini, R. Casadei, M. Viroli, S. Mariani, and F. Zambonelli, “Time-Fluid Field-Based
Coordination through Programmable Distributed Schedulers,” Logical Methods in Computer
Science, vol. Volume 17, Issue 4, Nov. 2021. DOI: 10.46298/lmcs-17(4:13)2021. [Online].
Available: https://lmcs.episciences.org/8755.
[6] D. Pianini, R. Casadei, M. Viroli, and A. Natali, “Partitioned integration and coordination via the
self-organising coordination regions pattern,” Future Gener. Comput. Syst., vol. 114, pp. 44–68,
2021.
R. Casadei References 11/12
18. References (2/2)
[7] 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.
[8] G. Audrito, “FCPP: an efficient and extensible field calculus framework,” in IEEE International
Conference on Autonomic Computing and Self-Organizing Systems, ACSOS 2020, Washington,
DC, USA, August 17-21, 2020, IEEE, 2020, pp. 153–159. DOI:
10.1109/ACSOS49614.2020.00037. [Online]. Available:
https://doi.org/10.1109/ACSOS49614.2020.00037.
[9] G. Audrito, R. Casadei, F. Damiani, and M. Viroli, Computation against a neighbour: Addressing
large-scale distribution and adaptivity with functional programming and scala, 2022. arXiv:
2012.08626 [cs.DC]. [Online]. Available: https://arxiv.org/abs/2012.08626.
[10] R. Casadei, A. Placuzzi, M. Viroli, and D. Weyns, “Augmented collective digital twins for
self-organising cyber-physical systems,” in IEEE International Conference on Autonomic Computing
and Self-Organizing Systems, ACSOS 2021, Companion Volume, Washington, DC, USA,
September 27 - Oct. 1, 2021, IEEE, 2021, pp. 160–165. DOI:
10.1109/ACSOS-C52956.2021.00051. [Online]. Available:
https://doi.org/10.1109/ACSOS-C52956.2021.00051.
R. Casadei References 12/12