A Hands-on IODA Tutorial Interaction-Oriented Simulation within - - PowerPoint PPT Presentation

a hands on ioda tutorial
SMART_READER_LITE
LIVE PREVIEW

A Hands-on IODA Tutorial Interaction-Oriented Simulation within - - PowerPoint PPT Presentation

A Hands-on IODA Tutorial Interaction-Oriented Simulation within NetLogo Sbastien Picault sebastien.picault@univ-lille1.fr SMAC team LIFL Lille 1 University http://www.lifl.fr/SMAC/ Social Simulation Conference September 1st, 2014


slide-1
SLIDE 1

A Hands-on IODA Tutorial

Interaction-Oriented Simulation within NetLogo Sébastien Picault

sebastien.picault@univ-lille1.fr

SMAC team – LIFL – Lille 1 University http://www.lifl.fr/SMAC/

Social Simulation Conference September 1st, 2014

slide-2
SLIDE 2

Outline of the tutorial

1 The Interaction-Oriented Approach (IODA) 2 The IODA extension for NetLogo 3 Let’s code !

slide-3
SLIDE 3

IODA The IODA extension for NetLogo IODA

— I —

The Interaction-Oriented approach (IODA)

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 3/23

slide-4
SLIDE 4

IODA The IODA extension for NetLogo IODA

Limitation of classical MABS approaches

◮ excessive focus on individuals

◮ strong dependencies agents/behaviors ◮ make model revisions difficult

◮ alternative: separation declarative/procedural :

◮ simplifies expertise acquisition ◮ enhanced model intelligibility ◮ increased reutilisability ◮ homogeneity of the concepts

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 4/23

slide-5
SLIDE 5

IODA The IODA extension for NetLogo IODA

The notion of interaction

behavior = abstract description + modalities abstract description : conditions/actions rules = interactions

rely upon generic perception/action capabilities (primitives)

+ execution modalities : variability in the primitives, depending on agent families

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 5/23

slide-6
SLIDE 6

IODA The IODA extension for NetLogo IODA

Structure of an interaction

Trigger Conditions Actions Interaction(Src,Tgt) Src.hungry() Tgt.fresh() Src.assimilate(Tgt) Tgt.destroy() Eat(Src,Tgt)

Trigger: motivations/goals for doing the actions Conditions: prerequisite that allow the realization of the actions Actions: list of the actions to perform

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 6/23

slide-7
SLIDE 7

IODA The IODA extension for NetLogo IODA

The interaction-oriented approach

3 key ideas

◮ each relevant entity is an agent

= entity with perception and action capabilities

◮ each behavior is an interaction

= conditions/actions rule involving several agents

◮ a generic engine determines what interactions may occur

agents characterized by their capability to perform (source)

  • r undergo (target)

an interaction

[Mathieu & al. 2001]

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 7/23

slide-8
SLIDE 8

IODA The IODA extension for NetLogo IODA

The IODA approach

separation between declarative/procedural parts:

◮ automatization of model implementation

and of simulations analysis

◮ elicitation of simulation biases [Kubera & al. 2008] IODA Interaction-Oriented Design of Agent simulations methodology and modelling frame JEDI Java Environment for the Design of agent Interactions highly tunable platform [Kubera & al. 2011] JEDI-Builder Code generator IODA model → JEDI simulation LEIA LEIA lets you Explore Interactions for your Agents Explorer for the simulation space [Gaillard & al. 2010]

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 8/23

slide-9
SLIDE 9

IODA The IODA extension for NetLogo IODA

Interaction and update matrices

❳❳❳❳❳❳❳❳❳❳❳ ❳

Sources Targets ∅ Trees Grass Sheep Goats Wolves Trees Grass

Grow (0) Spread (1)

Sheep

Die (3) Eat (2; 0) Mate (1; 0) Wander (0)

Goats

Die (4) Climb (3; 1) Eat (2; 0) Mate (1; 0) Wander (0)

Wolves

Die (4) Eat (3; 1) Eat (2; 1) Mate (1; 0) Wander (0)

UPDATE Trees Grass Sheep

Age (2) BecomeSick (1)

Goats

Age (2) BecomeSick (1)

Wolves

Age (1)

◮ synthetic view of all behaviors ◮ actions resulting from decisions

  • vs. spontaneous state changes
  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 9/23

slide-10
SLIDE 10

IODA The IODA extension for NetLogo IODA

An homogeneous handling of entities

◮ each relevant entity is an agent ◮ the actitivy of agents is characterized dynamically:

active agent: acts upon the others = no-empty line in the interaction matrix passive agent: undergoes actions from other entities = non-empty column in the interaction matrix labile agent: spontaneous state change = non-empty line in the update matrix

◮ optimization of the simulation engine [Kubera & al. 2010]

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 10/23

slide-11
SLIDE 11

IODA The IODA extension for NetLogo IODA

“Reactive” IODA engine

during a time step:

1

Update: each labile agent performs the realizable interactions from the update matrix

2

Interaction selection: each active agent

1

perceives neighbors (among the passive agents)

2

filters targets of interactions that it can perform i.e. agents which can undergo those interactions

3

evaluates the triggers and conditions of those interactions

4

selects one realizable interaction with the highest priority level

5

performs the corresponding actions

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 11/23

slide-12
SLIDE 12

IODA The IODA extension for NetLogo IODA

— II —

The IODA extension for NetLogo

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 12/23

slide-13
SLIDE 13

IODA The IODA extension for NetLogo IODA

Overview

The principles and algorithms of IODA can be implemented

  • n any platform

within NetLogo:

◮ Java extension −

→ required data structures + file reading functions + consistency checking / primitives to write

◮ NetLogo include file −

→ reactive simulation engine

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 13/23

slide-14
SLIDE 14

IODA The IODA extension for NetLogo IODA

Features

◮ agent families = turtles, breeds or patches ◮ target selection policies ◮ consistency checking ◮ easy tuning of perception ◮ physical/social environnements (links)

http://www.lifl.fr/SMAC/projects/ioda/ioda_for_netlogo/

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 14/23

slide-15
SLIDE 15

IODA The IODA extension for NetLogo IODA

Principles

a IODA NetLogo simulation =

◮ classical NetLogo program using the extension

+ definition of the concrete primitives for each agents family

◮ definition of the interactions in a text file ◮ definition of the interaction and update matrices in a text

file

◮ delegation of the scheduling to a dedicated procedure

ioda:go

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 15/23

slide-16
SLIDE 16

IODA The IODA extension for NetLogo IODA

Example (1) – behaviors

◮ inspired by the classical Termites model

in the NetLogo library

◮ everything is an agent: termites + wood chips

PPPPPPPP P

Source Target

∅ chips termites chips termites (MoveRandomly, 10, 1) (MoveRandomly, 0) (PutDown, 20, 0.3) (PickUp, 30, 1)

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 16/23

slide-17
SLIDE 17

IODA The IODA extension for NetLogo IODA

Example (2) – NetLogo template

__includes ["../../IODA_2_2.nls"] extensions [ioda] breed [ termites termite ] breed [ chips chip ] termites-own [ carrying? ] to setup clear-all create-termites nb-termites [ init-termite ] create-chips nb-chips [ init-chip ] ioda:load-interactions "interactions.txt" ioda:load-matrices "matrix.txt" " \t" ioda:setup reset-ticks end to go ioda:go tick end

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 17/23

slide-18
SLIDE 18

IODA The IODA extension for NetLogo IODA

Example (3) - matrices

◮ defined in a CSV file (arbitrary separators) ◮ here: a file "matrix.txt"

;source interaction priority target distance termites MoveRandomly termites MoveRandomly 10 chips 1 termites PutDown 20 chips 0.3 termites PickUp 30 chips 1

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 18/23

slide-19
SLIDE 19

IODA The IODA extension for NetLogo IODA

Example (4) – interactions

defined in a text file (here: "interactions.txt")

interaction MoveRandomly actions wiggle end interaction PickUp condition not-carrying? actions take-load get-away end interaction PutDown condition carrying? actions drop-load random-turn get-away end

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 19/23

slide-20
SLIDE 20

IODA The IODA extension for NetLogo IODA

Example (5) – primitives

to-report termites::not-carrying? report not carrying? end to-report termites::carrying? report carrying? end to termites::filter-neighbors ioda:filter-neighbors-in-radius 1 end to termites::take-load set carrying? true ask ioda:my-target [ioda:die] end to termites::wiggle left random 50 right random 50 fd 1 end to termites::drop-load set carrying? false hatch-chips 1 [init-chip] end to termites::get-away fd 20 end to termites::random-turn right random 360 end

◮ each abstract

primitive must be concretely defined for the agents family that are likely to use it

◮ filter-neighbors

primitive for handling the perception of neighbors

◮ predefined primitives

e.g. ioda:die

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 20/23

slide-21
SLIDE 21

IODA The IODA extension for NetLogo IODA

Example (6) – outcome

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 21/23

slide-22
SLIDE 22

IODA The IODA extension for NetLogo IODA

— III —

Let’s code!

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 22/23

slide-23
SLIDE 23

IODA The IODA extension for NetLogo IODA

Using the extension

http://www.lifl.fr/SMAC/projects/ioda/SSC2014

  • S. Picault — SMAC, LIFL — Univ. of Lille

A Hands-on IODA Tutorial 23/23