• Keine Ergebnisse gefunden

The Swarm The Swarm Simulation System Simulation System

N/A
N/A
Protected

Academic year: 2022

Aktie "The Swarm The Swarm Simulation System Simulation System"

Copied!
32
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

The Swarm The Swarm

Simulation System Simulation System

Je planmäßiger die Menschen vorgehen,

desto wirksamer vermag sie der Zufall treffen .

Katja Luther, Holger Meyer

(2)

From Elements to Systems - The Swarm Simulation System 2

Outline

 Why is the influence of interventions on complex systems (ecosystems, economic systems,

metabolism) usually not predictable?

 Criteria for simulation systems

- Representation of complex interactions

- Agentbased model

- Building of hierarchical structures (recursion)

(3)

Why Simulation?

 John Briggs, F. David Peat: "Komplexe Systeme sind letzen Endes nicht

analysierbar, nicht auf Teile reduzierbar, weil die Teile durch Annäherung und

Rückkopplung ständig aufeinander

einwirken".

(4)

From Elements to Systems - The Swarm Simulation System 4

Scenarios

 Simulation of ecosystems

 „Superorganisms“ (e.g. ants, bees, etc.)

 Processes in business companies (micro) and national economy (macro)

 Load balancing in telecommunication

networks

(5)

The Swarm Simulations System

 Basic principle: groups of simple interacting agents creating a complex system behavior

 Swarm provides a general for writing computer simulations

 The Swarm system supports implementation of

multi-level systems by composing hierarchical

swarms of agents

(6)

From Elements to Systems - The Swarm Simulation System 6

What is Swarm?

A virtual machine / a discrete event simulator

 Virtual machine: an abstract instruction processor.

Example: the Java virtual machine

 But instead of Java instructions, Swarm interprets instructions describing temporal events and

constraints via Schedules, Swarms, and their

associated parameterizations

(7)

Swarm as a virtual computer

Operating System Swarm kernel

GUI Model

CPU

 A computer’s CPU executes program instructions

 Swarm kernel is virtual CPU running model

and GUI events

 Nested Swarms merge

activity schedules into

one

(8)

From Elements to Systems - The Swarm Simulation System 8

Swarm System Design

(9)

Real World Multi-level Systems

 Global Economy

 National Economy

 Business Company

 Employee

 Ecosystem

 Ant Colony or Beehive

 An Ant or Bee

 Organ

 Cell

(10)

From Elements to Systems - The Swarm Simulation System 10

Hierarchical Modeling by

Swarm

(11)

Interactions of Nested Swarms

 Swarm allows swarms to be agents creating a new

swarm in the next level of the hierarchical model

(nested swarms)

 Time hierarchy:

Top-down synchronized

time-management across the

simulation

(12)

From Elements to Systems - The Swarm Simulation System 12

Example: Heatbugs

(13)

Implementation Heatbugs

public class Heatbug {

/** my current unhappiness */

public double unhappiness;

/** my spatial coordinates */

public int x, y;

/** my ideal temperature and how much heat I put out */

public int idealTemperature, outputHeat;

/** chance of moving randomly */

public double randomMoveProbability;

/** my colour (display) */

public byte bugColor;

(14)

From Elements to Systems - The Swarm Simulation System 14

Bottom up modeling

Organizations of agents Animate agents

Data Observer Inanimate agents

If

<cond>

then

<action1>

else

<action2>

If

<cond>

then

<action1>

else

<action2>

(15)

Implementation ObserverSwarm

public class HeatbugObserverSwarm extends GUISwarmImpl { /** one parameter: update freq */

public int displayFrequency;

/** ActionGroup for sequence of GUI events */

public ActionGroup displayActions;

/** the single Schedule instance */

public Schedule displaySchedule;

/** the Swarm we're observing */

public HeatbugModelSwarm heatbugModelSwarm;

(16)

From Elements to Systems - The Swarm Simulation System 16

HeatbugsModelSwarm

RepeatIntervall=1 stepRule step upateLattice

ActionGroup

heatspace type=heatspace

world type=Grid2d

environment

count=100 class

heatbug

populate

agents

Heatbug

idealTemperature(1700<=uniformRandom<=3500) outputHeat(3000<=uniformRandom<=10000)

imgColor(byteConstant=64)

classes

(17)

Implementation Modelswarm

public class HeatbugModelSwarm extends SwarmImpl{

// simulation parameters public int numBugs;

public int maxOutputHeat, minOutputHeat;

public double evaporationRate;

public double diffuseConstant;

public int worldXSize,worldYSize;

public int minIdealTemp, maxIdealTemp;

public double randomMoveProbability;

(18)

From Elements to Systems - The Swarm Simulation System 18

Implementation Modelswarm-2

public class HeatbugModelSwarm extends SwarmImpl{

...

/** ActionGroup for holding an ordered sequence of action

*/

public ActionGroup modelActions;

/** the single Schedule */

public Schedule modelSchedule;

/** list of all the heatbugs and the world the bugs live in

*/

public List heatbugList;

public Grid2d world;

public HeatSpace heat;

(19)

Probes and GUI

Executes method

Input value for variable Open probe for class Close probe

Probe

 A probe can be used to communicate with the objects in real

time

 Default probe map

shows all variables

(20)

From Elements to Systems - The Swarm Simulation System 20

Implementation ProbeMap

//in contructor of HeatbugModelSwarm

class HeatbugModelProbeMap extends EmptyProbeMapImpl {

… //definition of addVar() and addMessage()

public HeatbugModelProbeMap (Zone _aZone, Class aClass) { super (_aZone, aClass);

addVar ("numBugs");

addMessage ("toggleRandomizedOrder");

addMessage ("addHeatbug:");

} }

/*Now, install our custom probeMap class directly into the probeLibrary */

...

(21)

Method buildObjects()

public Object buildObjects (){

super.buildObjects();

heat = new HeatSpace(getZone(),worldXSize, worldYSize,diffuseConst, evapoRate);

world = new Grid2dImpl (getZone(), worldXSize, worldYSize);

heatbugList = new LinkedList();

for (i = 0; i < numBugs; i++) {

idealTemp = getRandBetween(minIdealTemp, maxIdealTemp);

outputHeat = getRandBetween(minOutputHeat, maxOutputHeat);

Heatbug hbug = new Heatbug (world, heat);

heatbugList.add (hbug);

(22)

From Elements to Systems - The Swarm Simulation System 22

Implementation buildActions()

public Object buildActions () { super.buildActions();

modelActions = new ActionGroupImpl (getZone());

//erzeugen der Actionsund zufügen zu ActionGroup modelActions.createActionTo$message

(heat, new Selector (heat.getClass (),

“updateLattice", false));

//erzeugen von modelSchedule und zufügen der ActionGroup modelSchedule = new ScheduleImpl (getZone (), 1);

modelSchedule.at$createAction (0, modelActions);

(23)

Arborgames

Model of forest dynamics

 Examine the role of fire on species diversity

 Discrete cells with one (two) individual per cell

 Local interaction of trees in a neighborhood

generates landscape

dynamics

(24)

From Elements to Systems - The Swarm Simulation System 24

Arborgames

Response to disturbance

 Landscape dynamics allow recursive

response to disturbance

 Expansion of fire is

governed by the

contagion of local

forest structure

(25)

Simulation of population dynamics

 Development of

population diversity in a forest with medium

strength of disturbance

 Development of

population diversity with

strong disturbance

(26)

From Elements to Systems - The Swarm Simulation System 26

And now something

completely different ...

(27)

Computational-Fields

 Movement of the agents is driven by these Co-Fields

 Co-Fields are established by the infrastructure and by the agents

 Agent movements induces changes of Co-Field –

composing a feedback cycle

(28)

From Elements to Systems - The Swarm Simulation System 28

The Swarm API

objectbase Base classes for simulated objects – the

"agents“

activity Schedule execution mechanism – the

"process"

space Spatial environment library

simtools Collected tools (non-GUI) useful for developing Swarm simulations

gui Graphical Interface library

analysis Objects that help with data processing

(29)

Using Swarm API: Museum

import swarm.Globals;

import swarm.space.Discrete2dImpl;

public class Museum extends Discrete2dImpl { public ListImpl rooms;

...

// In Constructor:

rooms = new ListImpl(Globals.env.globalZone);

...

public void draw(){

((Room)rooms.atOffset(0)).draw(startX,startY);

(30)

From Elements to Systems - The Swarm Simulation System 30

Using Swarm API: Agents

import swarm.objectbase.Swarm;

import swarm.objectbase.SwarmImpl;

import swarm.activity.ActionGroupImpl;

import swarm.activity.ScheduleImpl;

import swarm.activity.Activity;

public class PeopleSwarm extends SwarmImpl{

...

public Activity activateIn(Swarm swarmContext) { super.activateIn(swarmContext);

peopleSchedule.activateIn(this);

return getActivity();

}

(31)

Using Swarm API: GUI

public void createFieldRasters() { ZoomRasterImpl fieldRaster;

int numFields = modelSwarm.museumSwarm.museum.rooms.getCount();

fieldRasters = new ListImpl(getZone());

for(int i=0; i<numFields;i++) {

fieldRaster = new ZoomRasterImpl(getZone(),"room

"+i+“fieldRaster");

fieldRaster.setWidth$Height(museum.getSizeX(), museum.getSizeY());

fieldRaster.setWindowTitle("room ;"+i+" field");

fieldRasters.addLast(fieldRaster);

...

(32)

From Elements to Systems - The Swarm Simulation System 32

Resources

www.swarm.org

Chris Langton et. al.: The Swarm Simulation System A tool for studying complex systems, Santa Fe Institute 1999

www.ctsgroup.ch

The Co-Fields Project – Agent Group (Franco Zamonelli) Università di Modena e Reggio Emilia

polaris.ing.unimo.it/didattica/curriculum/marco/Web-Co- Fields/cofields.html

Swarm User Guide, Swarm Development Group, University of Kansas Department of Political Science, Paul Johnson, 2000

Benedikt Stefansson: Swarmfest ’99 Tutorial Session One:

Introduction (www.swarm.org)

Referenzen

ÄHNLICHE DOKUMENTE

Combined with our assumed rate of appe technologies and the resulting propensity for new combinations to simulations suggest both many alternative development pathways and

• An Oberon track message in the upper part of the menu frame. • The Oberon mark message. • Messages of type Viewers. All other messages are simply passed on to the menu frame

The labour-power plan is elaborated by a plant on a basis of the directive staff limit specification that is specified for the internal units in accordance with the superior

a distributed architecture, each robot has a local copy of the swarm- level mission planning module (red) which exchanges information with other robots for overall swarm

– Docker ist einfach zu installieren und zu verwalten – bietet dabei aber nicht die Flexibilität von Kubernetes oder Apache Mesos. Cloud Computing

• Artifacts in L2 phase measurements can efficiently be corrected in frequency space using the inverse transfer function. • 10 Hz sampling would be required for

According to current plans, in ten years 50 percent of the Bavarian electric power consumption should be covered by renewable energy sources like water, wind,

The National Agenda Committee of 2005 (so the reader does not get lost among committees) was composed of representatives from political parties (including the Muslim Brotherhood),