Blecic Iccsa 2008

Post on 11-May-2015

524 views 2 download

Tags:

description

Third International Workshop on "Geographical Analysis, Urban Modeling, Spatial Statistics"

Transcript of Blecic Iccsa 2008

A Software Infrastructure for Multi-Agent Geosimulation Applications

Ivan Blecic, Arnaldo Cecchini, Giuseppe A. Trunfio

Laboratory of Analysis and Models for PlanningDepartment of Architecture and Planning

University of SassariItaly

Third International Workshop on

"Geographical Analysis,Urban Modeling, Spatial Statistics“ GEOG-AN-MOD 08

Multi-Agent Geosimulation (MAG)

• modelling phenomena taking place in geographical environments through the use of agent-based approach within high-resolution spatial models

GIS geo-spatial datasets(buildings,infrastructures, terrain elements)

mobile artificial agents (pedestrians, consumers,household, vehicles)

+ =

MAG models…• …are developed to realistically represent phenomena

taking place in space (e.g. urban systems)– Land-use dynamics– Urban patterns (e.g. householder residential behaviour)– Urban sprawl– Pedestrian crowding– …

• … are used to execute simulations with the purpose of:– Understanding systems (e.g. the consequences of individual-

level choices at a global level)– What-if analysis, policy evaluation and decision support– ….

Developing and executing MAG applications

• Development phase:– Typically needs some programming skills

• issues: efficiency of spatial queries even for moving objects, accessing spatial data, computing spatial relationships among geometries, scheduling, etc.

– Often needs to involve experts from different fields– Availability of data for inferring empirical rules,

calibration, validation etc.

• Application phase:– The application must allow to effectively execute

simulations for different scenarios• Including calibration and validation

– Interoperability with GIS for further analysis of spatial outcomes of the simulation

• According to Mandl (2000), four alternatives for coupling simulation applications and GIS:– loose coupling: GIS and simulation software are two

separate software applications, and the data of one is integrated into another.

– direct co-operative coupling: GIS and simulation software in a server-client interaction.

– indirect co-operative coupling: a third programming environment couples GIS and simulation software.

– tight coupling: GIS functionality is directly implemented in simulation software or vice versa.

• In any case a programmer can exploit the wide availability of libraries and environments– Swarm, RePast, etc…– GIS libraries

Developing and executing Geosimulation applications

Vector vs. Raster in MAG models

• Mixed Vector/Raster representation:– more realistic simulations;– Direct use of vector spatial data (e.g. demographic data, land-uses,

buildings shapes, etc.), without the need of rasterisation. – better interoperability with GIS applications (the geo-spatial features can

directly be mapped to objects and agents of the model, and vice versa);– the accuracy of spatial perception engine can take significant advantages

from the existing algorithms of computational geometry. – Computationally expensive agents’ spatial perception

• Raster representation:– the dimension of cells determines both the accuracy of the representation

of complex shapes (e.g. buildings in a city) and the spatial resolution of agents' movements;

– need of rasterising vector data;– spatial output only of raster type;– fairly efficient spatial perception algorithms.

Development Tools for Agent Simulations

Missing dimensions?: model complexity, …

MAGIMultiAgent Geosimulation Infrastructure

• Software environment for the design, development and execution of MAG applications

Main features of MAGI

• Enables the development of a wide range of MAG models

• The resulting models can be integrated with different computational approaches

• Offers an effective graphical user interface

Simulation monitoring Simulation steeringModel development support

Main features of MAGI

• Development phase:

• Simulation phase:

Different models

(on-line and/or off-line coupling with MAGI)

Outcomes for post-processing

The main ingredients of MAGI

• Portable C++ libraries:– GEOS (Geometry Engine Open Source)– Leaf-prior Update R-Tree (spatial indexing for moving

objects)– OpenTreads (Threads management)

• Windows Development and Simulation Environment:– MinGW (Minimalist GNU for Windows – C++ open source

development tool)– GDAL/OGR (open source library for accessing raster

and vector geospatial data formats)

GEOS

• GEOS is an API of 2D spatial predicates and functions

• It has the following design goals: – It conforms to the Simple Features Specification for SQL

published by the Open GIS Consortium – It provides a complete, consistent, robust implementation

of fundamental 2D spatial algorithms – It is fast enough for production use – It is written in C++ – It is open source

GEOS & MAGI• Each agent is associated to a geometry

Point LineString LinearRing Polygon

• In addition, each agent has:– Properties (i.e. C++ objects, representing integer, real numbers,

vectors, list, graphs, etc., which define the agent’s state)

– Behavioral rules (e.g. for updating the agent’s properties or geometry)

– Spatial contexts, which can be dynamically updated

MAGI Agents

• Agents can represent static geographic objects…

• …or cells – this enables the development

of Cellular Automata models

MAGI Agents

• Agents can move in and interact with the environment

Layers• Agents are organized in layers

Layer parameters are variables accounting for relevant properties which can influence the agents’ behaviour

Layer functions can be defined and scheduled for execution during simulations (e.g. layer functions can update layer parameters)

Global parameter and functions are also allowed (e.g. a parameter may affect more than one layers)

Agent’s spatial context

• Each agent holds a spatial context: (i.e. the lists of entities of interest for the agent itself)

• MAGI allows:

Standard CA neighbourhoods

(static)

Spatial contexts

resulting from a

(spatial) perception activity

(dynamic)

Custom neighbourhoods

(static)

On regular tessellations

Spatial perception

• Dynamic spatial contexts can be defined by custom spatial queries which are iterated with a specified frequency during the simulation :

Spatial perception• The C++ library offers specific spatial queries implementing

visual perception algorithms which operate on vector data

Spatial perception

• spatial queries are inherently computationally expensive

• In MAGI spatial queries are robust and efficient thanks to: – a spatial indexing technique specific for moving

objects;– the use of binary predicates offered by GEOS;

Spatial perception: indexing agents

• MAGI class library: includes a spatial indexing specific for moving objects (i.e. the Leaf-prior Update R-Tree) which makes efficient both the execution of spatial queries and the index updating operations (required when an agent change its position in space)

Spatial perception: binary Predicates• MAGI supports, through GEOS, a complete set

of geometric binary predicates.

• Binary predicate methods take two geometries as arguments and return a boolean indicating whether the geometries are in the named spatial relationship.

• The relationships supported are: equals, disjoint, intersects, touches, crosses, within, contains, overlaps

• Binary predicates can be used by agent’s behavioral rules and spatial queries for updating of its spatial context, in order to simulate spatial perception and reasoning

B

A

Spatial perception: computational efficiency

A) agents avoid collisions but ignore other agents; B) agents avoid collisions and perceive other agents in their field of vision

• Moving agents perceiving other moving agents in a vector space can be computationally expensive as the number of agents increases

Agent behaviour

• The agent behaviour is defined by actions• Actions can update the state of the agent itself, the

state of the environment or the state of other agents

Scheduling

• The simulation proceeds in time-steps• Two main types of scheduling:

– Simultaneous updating: agents are assumed to change simultaneously (like cells’ states in Cellular Automata)

• conflicts can arise when agents compete over limited resources

– Sequential updating: agents’ states change in sequence (each agent observes the reality left by the previous one)

• conflicts between agents are resolved but the order of updating may influence results.

• Sequential random updating is also available;

MAGI GUI

Model structure editing

Editing of behavioral rules and queries

Model building Model execution

MAGI GUI

XML model structure editing

MAGI GUI• MAGI provides interfaces for exchanging raster and vector spatial data with GIS through GDAL/OGR

– GDAL/OGR is provided by the Open Source Geospatial Foundation. It presents a single abstract data model to the calling application for all supported formats.

Samples are mapped into agent states

MAGI GUIParameter monitoring and editing

A model step-by-step

– Number and type of global parameters

– Global functions

– Layers

Step 1: definition of model structure

– For each layer:• Name• Type of agent activation • Type of boundary (e.g.

toroidal space ?)• Type of entities (e.g. cells

?)• Number and type of layer

parameters• Layer functions

A model step-by-stepStep 2: definition of agents

– Type of geometry– Structure of agent’s state (number and

type of properties)– Actions defining agent’s behaviour

(C++ source code)– Number and type of Neighbor lists

• spatial queries in case of query-based lists

Under development:

• Application examples

• Multi-threading based concurrent computation– for exploiting the multi-core processor architectures (the current trends

in processor technology indicate that the number of processor cores in one chip will continue to increase)

• OpenGL visualization capabilities