Chapter 9 Cellular Spaces

Slides:



Advertisements
Similar presentations
Extended DEVSML as a Model Transformation Intermediary to Make UML Diagrams Executable Jianpeng Hu Dept. of Computer Science and Engineering Shanghai Jiao.
Advertisements

Searching. 2 Searching an array of integers If an array is not sorted, there is no better algorithm than linear search for finding an element in it static.
Chapter 5: Path Planning Hadi Moradi. Motivation Need to choose a path for the end effector that avoids collisions and singularities Collisions are easy.
Introduction At the heart of the growth of a multi-cellular organism is the process of cellular division… … aka (in computing) self-replication.
Nawaf M Albadia Introduction. Components. Behavior & Characteristics. Classes & Rules. Grid Dimensions. Evolving Cellular Automata using Genetic.
CITS4403 Computational Modelling Fractals. A fractal is a mathematical set that typically displays self-similar patterns. Fractals may be exactly the.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Capacity analysis of complex materials handling systems.
Polymorphism, Inheritance Pt. 1 COMP 401, Fall 2014 Lecture 7 9/9/2014.
tiled Map Case Study: Rendering with JPanel © Allan C. Milne v
Course material – G. Tempesti Course material will generally be available the day before the lecture Includes.
Data and Computer Communications Chapter 6 – Digital Data Communications Techniques.
COS 126 – Atomic Theory of Matter. Goal of the Assignment Calculate Avogadro’s number Using Einstein’s equations Using fluorescent imaging Input data.
Fibonacci Numbers, Vector Programs and a new kind of science.
CS654: Digital Image Analysis Lecture 5: Pixels Relationships.
Cellular Automata FRES 1010 Eileen Kraemer Fall 2005.
DEVS and SES as a Framework for Modeling and Simulation Tool Development Bernard P. Zeigler Arizona Center for Integrative Modeling and Simulation University.
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
Approach and Techniques for Building Component-based Simulation Models Bernard P. Zeigler, Ph.D. Hessam S. Sarjoughian, Ph.D. Arizona Center for Integrative.
ECE 449/549 Class Notes #2 Introduction to Discrete-Event Systems Specification (DEVS) Sept
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Chapter 1: Variables and Patterns Chapter 1: Patterns and Variables Definition of a Pattern A list of numbers that follow a certain sequence or patterns.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
Arrays Chapter 7.
Arrays.
Before we start Literature review abstract DEVSJAVA license form
User-Written Functions
Graphs Chapter 15 introduces graphs which are probably the most general and commonly-used data structure. This lecture introduces heaps, which are used.
Lesson #6 Modular Programming and Functions.
Auburn University COMP8330/7330/7336 Advanced Parallel and Distributed Computing Interconnection Networks (Part 2) Dr.
Lesson #6 Modular Programming and Functions.
Prime and Composite.
Continue the car washer example Experimental frame
University of Central Florida COP 3330 Object Oriented Programming
Illustrations of Simple Cellular Automata
Link Aggregation Simulator Version 1
COS 126 – Atomic Theory of Matter
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Chapter 12: Implementing Actor Behavior (“AI”)
Lesson #6 Modular Programming and Functions.
Exception Handling Chapter 9.
DEVS Background DEVS = Discrete Event System Specification
UML Class Diagram.
COS 126 – Atomic Theory of Matter
COS 126 – Atomic Theory of Matter
Approach and Techniques for Building Component-based Simulation Models
Hiroki Sayama NECSI Summer School 2008 Week 2: Complex Systems Modeling and Networks Cellular Automata Hiroki Sayama
CIS 375 Bruce R. Maxim UM-Dearborn
Pipeline Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, 2012 slides5.ppt Oct 24, 2013.
Pipelined Pattern This pattern is implemented in Seeds, see
Chapter 14 Spatial Threshold Systems
High Performance Computing & Bioinformatics Part 2 Dr. Imad Mahgoub
int [] scores = new int [10];
Dynamic Structure Modeling
Pipeline Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, 2012 slides5.ppt March 20, 2014.
Pipeline Pattern ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson slides5.ppt August 17, 2014.
COS 126 – Atomic Theory of Matter
APPCs revisited 2/25/2019 APPCs revisited.
Lesson #6 Modular Programming and Functions.
DEVS Background DEVS = Discrete Event System Specification
Searching.
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
The Information Content of Receptive Fields
In this class, we will cover:
CIS 375 Bruce R. Maxim UM-Dearborn
Visual Algebra for Teachers
Digital Electronics and Logic Design
Presentation transcript:

Chapter 9 Cellular Spaces One Dimensional Cell Spaces Example: Pulse Pipeline Example: Sieve of Eratosthenes Example: Pascal Triangle Cellular Automata Two Dimensional Cell Spaces Connecting Agents to Cell Spaces Example: Sensing Light Spread To Avoid Obstacles

Some Types of Models Represented in DEVS Coupled Models Atomic Models can be components in a coupled model Partial Differential Equations Ordinary Differential Equation Models Processing/ Queuing/ Coordinating Networks, Collaborations Physical Space Spiking Neuron Networks Spiking Neuron Models Processing Networks Petri Net Models n-Dim Cell Space Discrete Time/ StateChart Models Stochastic Models Cellular Automata Quantized Integrator Models Fuzzy Logic Models Self Organized Criticality Models Reactive Agent Models Multi Agent Systems

One Dimensional DEVS Cellular Space Classes 5 6 7 8 1 2 3 4 A one dimensional cellular space is a sequence of cells each which is an instance of the same devs class. The coupling involves nearest neighbors and is uniform, i.e., the “same” at every cell. OneDimCell inherits from Viewable Atomic to provide cells that are atomic in nature ViewableDigraph ViewableAtomic oneDimCellSpace extends ViewableDigraph{ public void doNeighborCoupling(){...} public void addCell(){...} public void addPlots(){...} } oneDimCell protected int id = 0; protected rand r; protected int d rawPos ,numTransitions; <oneDCell> public int getId(); public void addNeighbor(int i,oneDCell n); public void addNeighborCoupling(int i,String outpt,String inpt); public void setDrawPos(int i); public static int numCells = 10; 1:n OneDimCellSpace. oneDimCellSpace OneDimCellSpace. oneDimCell Interface oneDCell specifies the minimal requirements needed for both cell space and graphics behaviors OneDimCellSpace provides methods for adding cells and displaying graphics of all cells.

Example: Pulse Pipeline One Dimensional Cell Space 5 6 7 8 1 2 3 4 pulseCell extends oneDimCell and implements similar behavior to fireOnceNeuron experimental frame feeds pulses to the first cell and counts the number that make it to the last cell class pulseCell extends oneDimCell { protected double fireDelay; public pulseCell( int id, double fireDelay ) {super( id, null ); ...} public void deltext( double e, message x ) {...as in fireOnceNeuron} public message out(){... outRealValueOnPort(2.0, "out"); return m;} } OneDimCellSpace. pipeLineRand class pulsePipe extends oneDimCellSpace{ public pulsePipe( int numCells, double fireDelay ) { super( "pulsePipe" ); this.numCells = numCells; for ( int i = 0; i<numCells; i++ ) { pulseCell tmp = new pulseCell(i, fireDelay); addCell( i, tmp ); if ( i == 0 ) addCoupling( this, "in", tmp, "in" ); if ( i == numCells -1 ) addCoupling( tmp, "out", this, "out" ); } hideAll(); } doNeighborCoupling( +1, "out", "in" );} pulsePipe extends oneDimCellSpace and sets up coupling from a cell to its right neighbor

Pileline Delays and Throughput Modify the fireOnceNeuron so that its fireDelay is the mean of an exponential distribution for the actual firing delay. In other words, following the example of genrRand (in Simparc and also on a slide) sample the firingDelay from an exponential distribution with fireDelay as mean. Make the initial seed a parameter so that you can set it. Following the example of workerCellSpace or earthquakeCellSpace, place neurons in a one dimensional cell space with a left-to-right pipeline coupling (output to input). Let the number of neurons N be a parameter of the model. Develop an experimental frame that measures the time it takes for a pulse to traverse the space from left to right, after which it feeds another pulse to the pipeline and measures the traversal time again now with a different seed, and so on. For the case N = 4, do 10 traversals. Use the same fireDelay parameter value for each neuron. Estimate the mean as the average time of the 10 traversals. Based on the case N=4, Investigate the relationship between the average traversal time and the number of neurons in the pipeline. For any N, generate pulses with rate, r(N) = N/fireDelay and feed them to a pipeline with N neurons so that the average traversal time equals fireDelay. Find the N which maximizes the throughput = r(N)* the ratio of pulses that reached final output to those generated). Try distributions for fireDelay, other than the exponential, to see how they change the optimum number of neurons.

Sieve of Eratosthenes – unbounded signal speeds in DEVS Cell Space 2 3 4 5 6 8 9 10 Model building asks these kinds of questions    Identity Composite-ness Primeness Activation What do I need to know? My integer Any division by less than my integer  Not divisible by numbers below me When to start my integer signal to the right When can I know it? Who can tell me? initialization First division Survived all inputs and neighbor sends activation When neighbor sends its integer Develop a oneDim Cell Space model that implements the prime number sieve. Each cell has only its left cell as influencer neighbor Start with an initial state of cells with numbers from 2 to N. A cell with integer n other than 2 is initially passive in phase “Temp” Cell 2 is initially active in phase “Prime” An active cell starts a signal with its value moving to the right at a speed inverse to its value. When a signal reaches a cell, the cell passes it on with a delay matching the speed of the input signal. If the cell contents is a multiple of the input, it passivates in phase “composite” after passing on the signal. If the input is the contents of its left neighbor it becomes active, propagating its value to the right. At this point it marks itself as Prime. global constraints – move signals to the right in order of size efficiency– restricting messages to those from primes will reduce traffic at cost of cell complexity special cases – 2,3 (2 is the only prime neighbor of another prime) http://www.math.utah.edu/ ~alfeld/Eratosthenes.html

to distinguish primes from others send on dedicated port Prime Sieve (cont’d) cell n outPrime inPrime deltext: continue(e) if (input on inPrime from left neighbor evenly divides you) then holdIn(Composite,input) else holdIn(temp, input) n-1 n out in to distinguish primes from others send on dedicated port outPrime = n prime deltint: if (phaseIs(temp and input = n-1)) holdIn(outPrime, n) if (phaseIs(Composite) and input = n-1) holdIn(lastComposite, n) outPrime in = n-1 temp lastComposite inPrime = x and x divides n in = n-1 out =n if (phaseIs(outPrime)) output: n on outPrime else if (phaseIs(lastComposite)) output n on out else output input on out Composite outPrime = x OneDimCellSpace. pascalCellSpace

Cellular Space Realization of Pascal’s Triangle Implementation: A one-dimensional cell space with left to right neighborhood such that each cell adds its neighbor’s state to its own at each time step. The exceptions are the initial passive cells o the right of the “2”. They are activated as the non-unity activity reaches them. Row counts are incremented at each step for active cells Their states are plotted at points (cell index, cell row) using parity coding (modulo 2). The resulting pattern turns the triangle on its side. parity mapping 1 2 1 1 1 1 1 1 odd even 1 3 3 1 1 1 1 1 1 4 6 4 1 1 1 1 OneDimCellSpace. pascalCellSpace log plot of cell states Game, set, and math : enigmas and conundrums / Ian Stewart. Oxford [England] ; Cambridge, Mass, USA : B. Blackwell, 1989. http://www.cs.washington.edu/homes/jbaer/classes/blaise/blaise.html

Cellular Automata Cellular Automata are oneDimentional cellular spaces in which the time base is discrete and all cells execute their state transition functions simultaneously at each time step. Cells get information from neighboring cells as defined by neighborhood. For example, for Wolfram’s rule 30 for 1D CAs, the neighborhood consists of the cells to the left and right of a center. With each cell having two states, the transition function must therefore specify the next state of the center cell for each of the eight state configurations, as in: { 111->0, 110->0, 101->0, 100->1, 011->1, 010->1, 001->1, 000->0 } When applied to an initial state of a single 1 surrounded by 0's, rule 30 generates the following pattern (developing downward from the top row). The array can be displayed as a pattern of black and white pixels, as below, producing a visualization of the evolving state of the horizontal rows. ..00000000100000000.. ..00000001110000000.. ..00000011001000000.. ..00000110111100000.. ..00001100100010000.. ..00011011110111000.. ..00110010000100100.. ..01101111001111110.. 1. www.amazon.com – review of “A New Kind of Science” by S. Wolfram.

Forest Fire Two Dimensional Space Cell Space Neighborhood Ignite N NE NW Wind W E Water SE SW S out from South -> in to North Coupling based on Neighborhood outS inS inN outN

Two Dimensional DEVS Cellular Space Classes A two dimensional cellular space is an array of cells each which is an instance of the same devs class. The coupling involves nearest neighbors and is uniform, i.e., the “same” at every cell. TwoDimCell inherits from Viewable Atomic implements Cell Interface Cell specifies the minimal requirements needed for both cell space and graphics behaviors – can be implemented by a modeler’s digraph class ViewableDigraph ViewableAtomic TwoDimCellSpace { public void addCell(){...} public void doNeighborToNeighborCoupling(){...} public Cell withId(int xcoord, int ycoord){…} public Cell neighborOf(Cell c,int i, int j){…} <Cell> 1:n TwoDimCell protected int numCells; // Total number of cells in the cell space protected int xcoord; // The x-coordinate of this cell in the cell space protected int ycoord; // The y-coordinate of this cell in the cell space protected double x_pos; // The x-coordinate of this cell on the cell space display protected double y_pos; // The y-coordinate of this cell on the cell space display protected Pair id; // Unique cell id: equals cell pos in cell space protected int Xsize; // The x-coordinate of this cell in the cell space protected int Ysize; // The y-coordinate of this cell in the cell space public int xDimCellspace; // Cell space x dimension size public int yDimCellspace; // Cell space x dimension size … TwoDimCellSpace TwoDimCellSpace provides methods for adding cells and displaying graphics of all cells. TwoDimCell

lightSpreadCellSpace extends TwoDimCellSpace implements fireOnce Neuron with same parameters outputs to nearest neighbors has finite refractory period source cell periodically generates pulse wave front all cells are on shortest time propagation path with same travel time since all have same firing delay, the front is also a shortest distance contour barriers don’t transmit pulses

Connecting Agents to Cellspace Environments mover agent is not “in” the cell space but is a component of the coupled model has coordinates and draws itself on same window gets inputs from all wavefront cells selects the adjacent input that is also closest as crow flies to source goes in the direction of the selected neighbor lightSpreadCells have been made invisible on window source cell periodically generates pulse

Connecting Agents to Cellspace Environments (cont’d) movers receive inputs on port outCoord from active lightSpread cells lightSpreadCells in 4 by 4 cellspace doNeighborToNeighborCoupling(); //sets up neighborhood coupling coupleAllTo("outCoord",m2,"in"); //couples all lightCells to mover