Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Cellular Automata: Modeling Complex Systems with Simple Rules, Slides of Electronic Circuits Design

An overview of cellular automata, a method for modeling complex systems using simple rules. The project described in the document models a predator/prey relationship using a 1000x2000 cell grid, with fish, sharks, and empty cells. The rules for breeding, death, and interaction between fish and sharks, as well as the programming logic and parallelism used to run the simulation.

Typology: Slides

2012/2013

Uploaded on 03/17/2013

kale
kale 🇮🇳

3.7

(3)

50 documents

1 / 47

Toggle sidebar

Related documents


Partial preview of the text

Download Cellular Automata: Modeling Complex Systems with Simple Rules and more Slides Electronic Circuits Design in PDF only on Docsity! Cellular Automata: Life with Simple Rules Docsity.com 2 Overview  Cellular automata can be used to model complex systems using simple rules.  Key features*  divide problem space into cells  each cell can be in one of several finite states  cells are affected by neighbors according to rules  all cells are affected simultaneously in a generation  rules are reapplied over many generations *Adapted from: Wilkinson,B and M. Allen (1999): Parallel Programming 2nd Edition, NJ, Pearson Prentice Hall, p189 Docsity.com 5 Rules A dozen or so rules describe life in each cell:  birth, longevity and death of a fish or shark  breeding of fish and sharks  over- and under-population  fish/shark interaction  Important: what happens in each cell is determined only by rules that apply locally, yet which often yield long-term large-scale patterns. Docsity.com 6 Do a LOT of computation! Apply a dozen rules to each cell Do this for 2 million cells in the grid Do this for 20,000 generations Well over a trillion calculations per run! Do this as quickly as you can Docsity.com 7 Do a LOT of computation!  We used a 20-CPU cluster in the Computer Science Department (Galaxy)  ‘Gal’ is the smaller of two clusters run by the Department (larger one has 64 CPUs)  15x faster than a single PC  Longest runs still took about 45 minutes  GO PARALLEL !!! Docsity.com 10 Breeding Rule: Before EMPTY Docsity.com 11 Breeding Rule: After Docsity.com 12 Rules in Detail: Fish Rules If the current cell contains a fish:  Fish live for 10 generations  If >=5 neighbors are sharks, fish dies (shark food)  If all 8 neighbors are fish, fish dies (overpopulation)  If a fish does not die, increment age Docsity.com 15 Shark Random Death: After YES IT IS!!! I LIVE  Docsity.com 16 Programming logic Use 2-dimensional array to represent grid At any one (x, y) position, value is: Positive integer (fish present) Negative integer (shark present) Zero (empty cell) Absolute value of cell is age Docsity.com Sample Code (C++): Breeding ff Tf the current cell is empty, check to ff gee if a shark or a fish is born if (*current == QO) { if (({fish >= 4) && (fish > sharks) ¢& [(fishbreed > 24} (®uuj fi,4) = 1; else { if ({sharks >= 4) && (sharks > fish) && [(sharkbreed > 2) } (*uu) (i,j) = -1: else (*uuj (1,9) = (*eurrenti: } continue; Docsity.com 20 Send Right Boundary Values Docsity.com 21 Receive Left Boundary Values Docsity.com 22 Send Left Boundary Values Docsity.com 25 Receive Left Boundary Values Docsity.com 26 Send Left Boundary Values Docsity.com 27 Receive Right Boundary Values Docsity.com 30 Results  Next several screens show behavior over a span of 10,000+ generations (about 25 minutes on Gal) Docsity.com 0 Generation Group 1: Predator/Prey Model Docsity.com 32 Generation: 100 Docsity.com 35 Generation: 2,000 Docsity.com 36 Generation: 4,000 Docsity.com Generation: 8,000 Plea WU sauea tls pee puta ven ary tegt a a 3 Docsity.com 40 Variations of Initial Conditions  Still using randomly distributed populations:  Medium-sized population. Fish/sharks occupy: 1/16th of total grid Fish: 62,703; Sharks: 31,301  Very small population. Fish/sharks occupy: 1/800th of total grid Initial population: Fish: 1,298; Sharks: 609 Docsity.com 41 Generation 100 2000 1000 4000 8000 Medium-sized population (1/16 of grid) Docsity.com 42 Very Small Populations  Random placement of very small populations can favor one species over another  Fish favored: sharks die out  Sharks favored: sharks predominate, but fish survive in stable small numbers Docsity.com 45 Parallel Performance  Parallel processing suggests speedup of close to 18 is possible  Our results: 15x speedup  Reason: communication overhead among slaves and between slaves and master  Communication overhead becomes much worse if results are communicated more often Docsity.com 46 Speed-up Speedup DT = 1000; Tstepuv = 100 0 2 4 6 8 10 12 14 16 18 20 0 5 10 15 20 Number of Slave Processors Sp ee du p Speedup Ideal Docsity.com 47 Communication Overhead Communication Overhead DT = 1000; NP = 19 1 1000500100 2 3 4 25 105 0 50 100 150 200 250 300 1 10 100 1000 Tstepuv Ti m e in S ec on ds Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved