Cellular Automata Modeling Environment Library Lev Naumov levnaumovmail

Cellular Automata Modeling Environment & Library Lev Naumov levnaumov@mail. ru

What Is CAME L? & Ø Environment, which allows to research, visualize and solve problems, basing cellular automata concept Ø Tool for distributed parallel computations and study of parallel algorithms Ø Library, which represents rich toolkit for building solutions 2

What Are Cellular Automata? Ø Cellular automata – simple models, which are used for studying complex systems behavior in different fields of science Ø These automata are discrete dynamic systems, which work can be completely described in the terms of local interactions Ø Cellular systems form common paradigm of parallel computations as Turing machines do for the consecutive computations 3

What for Cellular Automata Are Applicable? Ø For modeling of processes or distributed systems in physics, mathematics, computer sciences, chemistry, biology, psychology, meteorology, social sciences and other fields of science • “Cellular automaton” is discrete analogue of “field” concept Ø For using as spaces of computations for tasks solving parallel 4

Why Cellular Automata? Ø Common and most simple models of parallel computations Ø Parallel tasks are urgent and important Throughput of single processor is limited by technological causes • There a lot of “heavy” tasks which can and need to be solved using parallel computations • There a lot of tasks which are based on spacedistributed computer systems • 5

Definition of Cellular Automaton Cellular automaton A is a set of four objects A = <G, Z, N, f>, where Ø G – grid, set of cells Ø Z – set of possible cells states Ø N – set, which describes cells neighborhood Ø f – transition function, rules of the automaton: Z|N|+1 Z (for automaton, which has cells “with memory”) • Z|N| Z (for automaton, which has “memoryless” cells) • 6

Two-Dimensional Grids Cells that have a common edge with the involved are named as “main neighbors” of the cell (are showed with hatching) The set of actual neighbors of the cell a, which can be found according to N, is denoted as N(a) 7

Basic Cellular Automata Properties Ø Transition function is to be local Ø System is to be similar for all the cells • To avoid side effects grid can use boundary conditions Torus § Mobius band § Constant § Ø All cells get their new values simultaneously, at the end of the timestep, after all new values were calculated for all cells 8

Definition of the Rings Ring is the set of cells. It can be introduced for each cell on the grid Let us assume the cell itself to be its cell of the zero ring and its nearest neighbors to be the cells of first ring of the involved cell For the current cell, its cells of the i-th ring are nearest neighbors of members of (i– 1)th ring, excluding cells of (i– 1)-th and (i– 2)th rings 9

Definition of the Rings Formally, if R(a, i) is a set of cells of i-th ring of cell a, then if N describes cells neighborhood as the set of its nearest neighbors, following formula will take place 10

Rings for Grid of Triangles Different rings are showed withhatching or color 11

Rings for Grid of Squares Different rings are showed withhatching or color 12

Rings for Grid of Hexagons Different rings are showed withhatching or color 13

Definition of the Metrics Distance function D(a, b) for retrieving remoteness between cells a and b can be denoted as follows It is proved that this function satisfies to all metrics properties The notion of ring may be generalized for multidimensional grids and the distance function, given by last formula, will remain the same 14

The Problem “Cellular automaton” is specific parallel architecture so it needs specific hardware or at least software platform Multifunctional environment for solving problems with the help of cellular automata will allow to use computers as Ø assembly for physical, chemical, biological and other experiments (may be very expensive) Ø tool for execution, visualization and analysis of parallel computations 15

CAME L & Cellular Automata Modeling Environment & Library Windows-based software, that is desired to be simple, extensible workspace for complicated cellular calculations 16

Why CAME L? & Ø Existing products put limitations over automata that can be used Ø Majority of existing products do not satisfy modern requirements to user interface and do not support contemporary technologies Ø Many existing products have complicated languages for cellular automata description 17

Advantages of CAME L & Ø Existing products put limitations Ø Nolimitations over automata that can be used at all Ø Majority of existing products do Ø Handy user not satisfy modern interface with requirements to user interface the support and do not support of useful contemporary technologies features Ø Many existing products have Ø C++ or any complicated languages for other cellular automata description languagethat was developed 18

CAME L Components & Ø Each experiment is controlled and implemented by “components” Ø Components may be used in different combinations and add arbitrary functionality Ø Each component declares list of its parameters which are used for the tuning Ø Each component is a dynamic link library Ø Components are to be realized using Cellular Automata Developing Library (CADLib) 19

CADLib Ø For CADLib User = Developer = Researcher Ø CADLib presents rich set of instruments for components development Ø This is a С++ class library for further enlarging and reusing Ø It also contains some useful functions, constants and macrodefinitions 20

CADLib Rich and well structured class hierarchy provides easy-to-use and powerful toolkit It makes possible to customize all necessarybehavior of system 21

CAME L Components & Each automaton consists of four components Ø Grid – implements visualization of grid and cells navigation Ø Datum – maintains data storage Ø Metrics – provides the relationship of neighborhood, distance function and assigns coordinates to cells Ø Rules – describes computations (initialization, iteration and finalization) Other type of components: Ø Analyzer – allows to keep an eye on definite properties of automaton 22

Why Is Separate Metrics Component Needed? ØIt was possible to place necessary functionality to the datum component ØMetrics is separate component because this fact gives opportunity to use nonstandard coordinate systems. For example, generalized coordinates 23

What is Generalized Coordinates? The idea is to enumerate all cells of the grid. It must be done without any blanks. Each number is to have one and only one corresponding cell There must be the way to find cells nearest neighbors. It will be enough to work with any neighborhood The method of associating cells with generalized coordinates can be different. The main aim is to introduce them in the way, which allows to retrieve cells neighbors as fast as possible 24

Spiral Generalized Coordinates for Hexagonal Grid Choose any cell as zero cell and then enumerate cells in each its ring clockwise There are formulae for retrieving coordinates of nearest cells in this metrics 25

Generalized Coordinates for Grid of Triangles After applying spiral generalized coordinates for hexagons, each triangles coordinate can be got as coordinate of hexagon, multiplied by six and added index of triangle inside the hexagon 26

Generalized Coordinates for Grid of Triangles Ø In this metrics there is no need to consider two variants of cells orientation separately Ø Tests shows, that this way of introducing of generalized coordinates for the grid of triangles allows to calculate the nearest neighbor cells several times faster than a spiral way for this grid. The cause is in complexity of a ring for the grid of triangles • recursion which is used for spiral coordinates of nonmain cells neighbors, but in the grid of hexagons all cells neighbors are main • 27

Generalized Coordinates Based on Composite Cubicles Ø Useful for performance optimization • as for triangular grid based on hexagonal cubicles Ø Allows to introduce complicated grids • coordinates for as the “soccer ball” grid 28

Spiral Generalized Coordinates Ø There are formalisms of spiral generalized coordinates for all three possible twodimensional grids of regular polygons Ø This concept may be used for multidimensional and more complicated grids 29

Generalized Coordinates – Disadvantage and Advantages Ø Main disadvantage of the offered approach is that calculations of neighbors are slower than, for example, for the Cartesian case Ø Generalized coordinates provide a universal way of data storage for different grids Ø Grid may be easily enlarged if it is necessary Ø Serial data is easier to serialize and store Ø Independency from the zerocells position gives the opportunity to move it to the place where it would be more useful Ø Generalized coordinates is just a concept, so it could be adopted for the definite task 30

Generalized Coordinates for Parallel Computations Cellular automata are the models of parallel computations with infinite extent of parallelism. Using the generalized coordinates the system with infinite extent of parallelism can be emulated with the help of several interacting Turing machines. A single machine used to work with data storage (the tape) and other machines are used for neighbors calculations and synchronization 31

Rules Component Functions Other existing projects Ø Rules = Transition function Ø Use many languages for transition functions description CAME&L Ø Rules component fully describes computations Method of parallelization • Computations optimization • … • Transition function • Ø Single rules component may represent a parser of language for transition functions description and work with arbitrary transition functions (not with only one) 32

Analysis of Experiment Ø Rules component declares list of values which are interesting for the researcher Ø These values are calculated during the iteration Ø Analyzer component allows to study these values changing Draw graphs • Build reports to file • … • 33

Cellular Automata Properties In CAME L & Ø Transition function is to be local Ø System is to be similar for all the cells • To avoid side effects grid can use boundary conditions Ø All cells get their new values simultaneously, at the end of the timestep, after all new values were calculated for all cells Ø Transition function can be not local Ø System can be not similar for all the cells • Standard datum components allows to select boundary conditions Ø Each cells can get new value just after it was calculated 34

CAME L Features & Ø Allows to use arbitrary automata without any limitations Has handy rich user interface. Supports Ø • • Ø Ø Undo-redo functionality Clipboard operations Printing, saving pictures for illustrating articles Many many other features Stores data in XML files, that can become standard for cellular information interchange Can compress data on the fly using BZip 2 algorithm 35

CAME L Features & Ø Has multidocument interface • • Ø Ø Ø allows to work with several automata simultaneously allows to implement automata interactions Has rich toolkit to control, study and analyze the experiment Allows to build graphs of computations performance Is provided with examples of different components, which can be used for users tasks solving or as a basis of users components 36

CAME L Features & Ø Allows to perform parallel computations • • On multiprocessor computer On cluster Ø Allows to arrange clusters • • In local area network In the Internet Ø Uses novel network Commands Transfer Protocol (CTP) for cluster computations • Fast, reliable and featureful 37

CAME L Project & Ø Project was announced on International Conference on Computational Sciences 2003 (Melbourne – Saint-Petersburg, June 2003) and attracts interest of scientists Ø The work is in progress 38
- Slides: 38