Participatory Agent-Based Modelling and Serious Games with Cormas on Pharo

esug 65 views 36 slides Sep 11, 2024
Slide 1
Slide 1 of 36
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36

About This Presentation

Talk from ESUG 2024

"Participatory Agent-Based Modelling and Serious Games with Cormas on Pharo"

PDF: http://archive.esug.org/ESUG2024/day2/04-2024-esug-cormas.pdf


Slide Content

Pierre BOMMEL, Oleksandr ZAITSEV
European Smalltalk User Group (ESUG) — Lille, 9 July 2024
{pierre.bommel, oleksandr.zaitsev} @cirad.fr
CIRAD, UMR SENS, Montpellier, France
Participatory Agent-Based Modelling
and Serious Games with Cormas on Pharo

2
SENS (Savoirs, ENvironnement, Sociétés = Knowledge, Environment,
Societies): a mixed research unit in 3 institutes: CIRAD, IRD and University.
https://umr-sens.fr/
Multidisciplinary team between the social sciences (anthropology, economics,
geography, sociology, law, political science), life and environmental sciences
(agronomy and ecology) and sciences and technologies (modeling and
computer science).
For 25 years, we have been developing an ABM platform
to help manage natural resources.

Agent-based modellingPart 1:

4
ABM to simulate socio-eco-system
Crossing various dynamics
Understanding socio-ecological systems (SES)
- Consequences between individual practices
in interaction with natural resources' dynamics.
- Explore various modes of collective organization

5
ABM to articulate Micro/Macro levels
5
Emergence,
Auto-organisation

6
ABM examples (Cormas VW)
Groundwater pollution in Costa Rica

7
Alternative farming practices to deforestation in the Amazon
Example of ABM (Cormas VW)

8
CBB spread in Central America
Savannah landscape mosaic under
shifting cultivation, North CameroonCoffee rust spread in Nicaragua
Emergence of resource-sharing conventionsNetwork evolutionExample of ABM (Cormas VW)

9
Unique Features of Cormas
… that make it well-suited for companion modelling
!Different «Points of View»
"Live dynamic environment where everything is an object
⏰Stepping back in time
Observe a simulation from different perspectives
at the same time (multi-windowing)
Interact with anything at any time without stopping the simulation
Move back the time, change conditions,
continue on alternative path

Immersive coding
Thanks to Smalltalk, Cormas benefits from
A reflexive language
A powerful debugger
Introspection, to inspect and analyse any object of the simulation
Intercession, to amend its semantic and behaviour
Takes the modeler to the heart of his simulation
Offers a more substantive vision of the way it operates.
Put yourself in the place of the agent
Debugging is a learning process in itself
Live coding
Helps modellers check their model
Develop models directly from the debugger.
A great language to prototype
a model and check it works

11
Cormas Platform
✓Based on years of field experience
✓Now, implemented in Pharo
✓MIT Licence
✓Dynamic community
✓Well-suited for companion modelling

Part 3:
The Companion ModellingApproach

13
Companion Modelling
1
2
3

Designing with UML
Object diagram: Editor to help modeling beginners understand
object-based concepts

Designing with UML
Class diagram: Editor for collaborative modelling and generating
the structure of the code

Collective designing with UML
Activity Diagram: Editor to modify the decision rules of an agent
and execute its behaviour
Bommel P., Dieguez F., Bartaburu D., Duarte E., Montes E., Pereira M., Corral J., Lucena C. and Morales H., (2014).
A Further Step Towards Participatory Modelling. Fostering Stakeholder Involvement in Designing Models by Using
Executable UML. Journal of Artificial Societies and Social Simulation 17 (1) 6.
Farmer explaining a simulation

Part 4:
Serious Games

18
What are Serious Games?
Games that are used for purposes other than entertainment
Example: MilitaryExample: Railroad Planning

19
What are Serious Games?
3 types of Serious Games use

20
How do we use them at CIRAD?
Role-Playing Games (RPG) - players
assume roles of characters in fictional
setting: farmers, fishermen, policemen,
government, animals, etc.
Games are highly accessible
Even people who cannot read or
write and have never used a
computer can participate in a
simulation represented on a game
board

21
Example of game: Planet C
"Because there is no Planet B"
An interactive,
collaborative game that
uses collective intelligence
to manage resources
https://planetc.org/
designed to make you
rethink your beliefs and
empower you as an
Architect of Change

22Oleksandr Zaitsev © CiradOleksandr Zaitsev © Cirad
Example of game: Planet C
"Because there is no Planet B"

23
Example of game: Dukunú Molê
Loose translation from Fôrro Creole: «Save forest or die»
A serious game developed in São Tomé and Príncipe to better manage the forest
and, consequently, the unique biodiversity existing in this archipelago.
Pure board game or Computerized board gameThe Cormas grid

24
Software Support for RPGs
Facilitators use a software tool
to perform calculations
Players don’t see the tool
The tools calculates the new
environment and outputs it
on a surface
Update the EnvironmentHelp FacilitatorsFull Automation
The more complex is the game, the harder it is to manage. Facilitators have to remember
all the rules and quickly update the environment in response to players’ actions
The tool can take input from
players, produce output and
manage the game on its own

25
Models as catalysts to favor the commoning
Debriefing: the most
important phase
100% human RPG... Intermediate ...100% computerized ABM
Empower citizens to be
the actors of their own
social transformation

Computer ScienceChallenges
Part 5:

27
Migrating from VW to Pharo
Pharo CormasVisual Works Cormas (discontinued)

28
Migrating Cormas to Pharo12
Currently we use Pharo 9 (deprecated distribution)
(a) Migrate Spec 1 to Spec 2
(c) Improve the UI
‣Hernan’s ideas
‣Re:Mobidyc
(b) Decouple Spec from
Roassal and from Core

29
Reducing External Dependencies
Simple things should be simple
•ProjectFramework !
•Tabular
•SpecUIAddOns
•CodeGenerator
•pharo-urucu-navigator
•class-editor
•SState
•Grease
•Pharo-l18N
•PetitParser
•Roassal2
•Mustache
•StringExtensions
•FuzzySearcher
•NeoCSV
•NeoJSON
•InstanceEncoder
•PolyMath

30
Decoupling and Testing
CoreVisualisationUI
Define a model,
run a simulation,
generate data
Should be small,
have minimum
dependencies,
have good tests
Visualise the space,
different POV, square
/ hexagonal cells,
sprites
Depend on Roassal
(or Bloc)
Accessible and
interactive UI to build
models & run
simulations
Depend on Spec
(or Toplo)

32
Support Games
Games are also ABMs where players are agents
Every model is
potentially a game
Every game is
necessarily a model

33
Smart Game Board for Planet C
Players interact with computer simulation by moving pieces on a board
Hybrid game board that combines
interactivity of board games with the
power of computer simulations
Developed by our colleagues from
Cheikh Anti Drop University in Senegal
(UCAD, ESP)

34
Challenge: Debugging ABM
Modellers may ask different debugging questions than other developers
Have to deal with many live objects
that have autonomous behaviour
and can cause strange phenomena
Models are usually small and
their code is easy to
understand
Software DevelopmentModelling
Developers have to explore
large code bases with many
dependencies

35
Challenge: Testing ABM
Companion modelling requires quick coding and prototyping
Published model must remain valid,
reusable, and reproducible
Modelling phase
Post-modelling phase
without tests
with tests
time
effort (cost)
In ComMod sessions, speed and
simplicity are the key factors
Q: What is the testing workflow for ABM that
would not interfere with ComMod practices?

36
Summary
Development Innovation
•Migrate Spec 1 —> Spec 2
•Migrate to Pharo 12
•Reduce unwanted dependencies
•Reduce coupling
•Good test coverage (and good tests!)
•Bring all the missing features from VW
•Propose a metamodel to support:
-Companion modelling
-Games
-Resource management
•Debugging ABM
•Testing practices for companion
modelling (e.g. generated tests)

•Google Summer of Code
•Pharo Summer School & ESUG conference
•Internships at Montpellier and Lille
•Apprenticeship (master education + paid work)
•PhD and Postdoc
Work with us
Learn Pharo
https://mooc.pharo.org/
https://advanced-design-mooc.pharo.org/
https://books.pharo.org/
https://mastodon.social/@cormas
Get in touch
Pierre BOMMEL
[email protected]
Oleksandr ZAITSEV
[email protected]
CIRAD, UMR SENS
https://github.com/cormas/cormas
https://cormas.cirad.fr/ (old)
Follow Cormas