Pyrotex Posted December 6, 2006 Report Posted December 6, 2006 Hello, math fans!!! :teeth: As you know, I love the Excel application by MS. Herein, I have attached an Excel spreadsheet that contains a 1D Cellular Automaton (CA). There are many possible rules for these critters, and I supply half a dozen sets of rules that can be copied and pasted for your viewing pleasure. When you open the spreadsheet, you MUST enable macros. You SHOULD maximize the window to fully fit your screen. If you have a huge screen, you may want to decrease the magnification so the width of the CA is barely smaller than the width of your screen. Some rules don't generate actors (or Monsters or Gliders) on every run, so click the RUN button 4 or 5 times before giving up. Quote
Pyrotex Posted December 6, 2006 Author Report Posted December 6, 2006 Dang! The 1.9 Mbyte limit got me. I need 2.9 Mbytes. TORMOD!!!!!!!!!!!!! :teeth: THANK YOU!!!!!!!!! :eek2: Quote
Turtle Posted December 6, 2006 Report Posted December 6, 2006 Oooooooo!!!! I love one-dimensional cellular automatons!!! If I haven't dematerialized the papers, I may have rule sets for 3-by (there are exactly 256 if I recall) and 5-by one-dimensional cellular automata. Ooooooo!!! Can't wait to see what ya got Pyro! (I don't have Excel :( , but I have Quatro Pro and it opens most Excel files.:confused: ) :wave: :circle: :wave: Quote
Turtle Posted December 6, 2006 Report Posted December 6, 2006 OK A cursory search has turned up some files; I have yet to look for papers. The code below is a Basic program I wrote for experimenting with 1-dimensional cellular automata. It is short, and fairly well annotated. I never coded a menuing system, rather I would simply change the variables in the code and recompile and run it. ' 3 cell 1 dimensional CA DEFINT A-Z CLS SCREEN 12 'COLOR 0,0 DIM A(0:639) 'tested array/ 1 row '.............. Set a:sets initial cells ................. A(6)=1:A(8)=1:A(10)=1 A(26)=1:A(29)=1:A(32)=1:A(35)=1 A(86)=1:A(90)=1:A(94)=1:A(98)=1 'A(120)=1:A(125)=1:A(130)=1:A(135)=1:A(140)=1 A(210)=1:A(216)=1:A(222)=1:A(228)=1:A(234)=1 A(386)=1:A(390)=1:A(394)=1:A(398)=1 A(523)=1:A(525)=1:A(530)=1:A(535)=1:A(541)=1 A(320)=1 '........................... initialize 1st row CLS FOR I = 0 TO 639 IF A(I) = 1 THEN PSET (I,0),1 else pset (I,0),0 NEXT I '.......................... main loop 10 locate 1,5 print "F10 = End" FOR J = 0 TO 479 'increments rows DIM B(0:639,1:2) FOR K = 0 TO 637 'increments columns Q=K R=K+1 S=K+2 TEST$=BIN$(A(Q))+BIN$(A(R))+BIN$(A(S)) SELECT CASE TEST$ CASE "000" '1 B(R,1) = 0 'this entry turns on a cell;change the value after 'equal sign between 1 & 0 to change rules set; net 2^8 rule sets B(R,2) = 1 'this entry colors it CASE "100" '2 B(R,1) = 1 B(R,2) = 2 CASE "010" '3 B(R,1) = 0 B(R,2) = 3 CASE "001" '4 B(R,1) = 1 B(R,2) = 4 CASE "110" '5 B(R,1) = 0 B(R,2) = 5 CASE "101" '6 B(R,1) = 0 B(R,2) = 6 CASE "011" '7 B(R,1) = 0 B(R,2) = 7 CASE "111" '8 B(R,1) = 1 B(R,2) = 8 END SELECT NEXT K '****************** draw ******** FOR L = 0 TO 639 select case b(L,1) case 0 preset (L,J) case 1 select case b(l,2) 'b(R,2) case 0 pset (l,j),0 case 1 pset (l,j),1 case 2 pset (l,j),2 case 3 pset (l,j),3 case 4 pset (l,j),4 case 5 pset (l,j),5 case 6 pset (l,j),6 case 7 pset (l,j),7 case 8 pset (l,j),8 end select end select NEXT L if j < 477 then p=j+1:q=p+5 line (0,p)-(639,q),0,bf end if ERASE A DIM A(0:639) FOR M = 0 TO 639 A(M) = B(M,1) NEXT M ERASE B '.......................... trap F10 to interrupt program $EVENT ON ON KEY(10) GOSUB QUIT KEY(10)ON NEXT J $event off incr COUNT& cycles&=count&*480 LOCATE 3,1 PRINT cycles&" cycles" GOTO 10 END QUIT: KEY(10) OFF END RETURN Find in the attached Zip folder a compiled executable version. I can not guarantee its behavior on your machine. Press F10 to stop it. Good stuff Maynard! :confused: Quote
Turtle Posted December 6, 2006 Report Posted December 6, 2006 Dang! The 1.9 Mbyte limit got me. I need 2.9 Mbytes. TORMOD!!!!!!!!!!!!! :wave: THANK YOU!!!!!!!!! :wave: OK I have the xls file loaded in Quattro. I can't for the life of me find a Run button! :circle: Little help here? Turtle down...turtle down!!! :confused: Quote
Pyrotex Posted December 6, 2006 Author Report Posted December 6, 2006 OK I have the xls file loaded in Quattro. I can't for the life of me find a Run button! :circle: Little help here? Turtle down...turtle down!!! :confused: Okay, don't panic! Buttons may not be supported in Quattro. When you got the Automaton sheet up, just click Ctrl-= (that's Control Equal Sign), to get a new run of the CA. Quote
Pyrotex Posted December 11, 2006 Author Report Posted December 11, 2006 I am totally sconed that no one has given any feedback on my cellular automaton, available in the #2 post of this thread. Has anyone successfully downloaded it? Does it work? Or is it just boring or what? Quote
Turtle Posted December 11, 2006 Report Posted December 11, 2006 I am totally sconed that no one has given any feedback on my cellular automaton, available in the #2 post of this thread. Has anyone successfully downloaded it? Does it work? Or is it just boring or what? :( If you are totally sconed, I am totally sconed squared! :eek: My Quattro Pro loader takes the file and I can read it all, but no Run button or Ctrl= works. I have re-read it all thouroughly, and by all means wish to discuss it. Mayhaps the deeper implications of such apparently gamish pursuits escapes the midling minds. No worries, there is simplicity abundant in one dimensional cellular automata. When we say 'cellular', we mean a box, a pidgeonhole, a place to put stuff.When we say 'one dimensional', we mean a single row of boxes. When we say we'll be back later with more, we mean it. Edit Post Script: Wicky on topic. Quote
Pyrotex Posted December 12, 2006 Author Report Posted December 12, 2006 Exactly, Turtle! Each cell of the spreadsheet is a "Cell" that can be either ON (alive, 1) or OFF (dead, 0). At any given time T-sub-(n), there exists only a single dimension (row) of Cells. In the spreadsheet, this would be a horizontal row of cells. The vertical axis is Time. Row #1 would be T-sub-(0), let's say.Row #2 would be T-sub-(1). Etc. The State of any Cell, C, at any Time, T-sub-(n) is a function of three things:--- The States of (2M-1) Cells, centered on C, at Time T-sub-(n-1);--- A Set of Rules, R, containing (2M-1) discrete rules;--- A pair of integers called the State Range;where M is a positive integer > 0. In my application, M=5, so the State of any particular Cell is a function of the 9 Cells "above" it; and 9 rules. The rules classically are defined as either 0 or 1. The easiest way to apply the rules is by multiplying them times the corresponding Cell values of the previous Time and adding up the results, and comparing to the State Range: C-state = 1 if rule1*cell1 + rule2*cell2 + ... + rule(2M-1)*cell(2M-1) falls within the State Range;C-state = 0 otherwise. I have "advanced" this scenario a bit by allowing the Set of Rules, R, to contain any integers, negative or positive. Typically, I have found that just those values from -1 to 2 produce "nice" results. The State Range integers are typically 3 and 4, or: (3, 4). So the [sum of rulex*cellx] must be => 3 and <= 4, else C-state is zero. State Ranges (2, 3) and (2, 4) can occassionally give "nice" results. What is a "nice" result? :confused: As Time progresses from spreadsheet row to row, there will be patterns within a row that get repeated in a subsequent row. There may be a displacement either to the left or right. This gives the visually pleasing appearance of diagonal "Gliders" of ON cells. These Gliders may slope off at 45 degrees, 30 degrees or other angles. They may collide with other Gliders or with "Lazers" -- repeating patterns with a displacement of zero, giving a vertical stream. Colliding Gliders and Lazers may produce new Gliders or Lazers, or may terminate entirely. Unstable Gliders may spit off Lazers and other kinds of Gliders as Time progresses. You can categorize the different kinds of Gliders and Lazers (collectively called Actors) to produce a Menagerie. Some Actors are rare, others are common. Quote
Turtle Posted December 12, 2006 Report Posted December 12, 2006 In my application, M=5, so the State of any particular Cell is a function of the 9 Cells "above" it; and 9 rules. And so the standard nomenclature 1x9 cellular automaton. :cup: One row of cells of some arbitrary length (ringed or not), and the consideration of the state of 9 of those cells at a time. Given my proclivity to peruse complete lists, and that a 1x9 automaton has 2^9 possible states, you can see why I never ventured much beyond the 1x3. I have "advanced" this scenario a bit by allowing the Set of Rules, R, to contain any integers, negative or positive. Can we say 'understatement' ‽‽‽ :cup: I need a bit of time yet to juxtapose your 1x9 rule set calcs with my 1x3. :evil: Quote
anglepose Posted December 12, 2006 Report Posted December 12, 2006 intresting beyond my extent of knoledge but as far as im aware it is basicly a almost pure math program highly limited by the lack of strings and the like. perhaps i could try an automaton in java and c: hmmmmmm i think i will leave it to you :evil: Quote
Turtle Posted December 13, 2006 Report Posted December 13, 2006 --- A Set of Rules, R, containing (2M-1) discrete rules;--- A pair of integers called the State Range;where M is a positive integer > 0. In my application, M=5, so the State of any particular Cell is a function of the 9 Cells "above" it; and 9 rules. The rules classically are defined as either 0 or 1. The easiest way to apply the rules is by multiplying them times the corresponding Cell values of the previous Time and adding up the results, and comparing to the State Range: I want to get to how you treat M, because I believe I used a different method. You seem to be using an algebraic calculation, whereas I used comparisons of the possible arrangements. This is relatively easy for the 1x3 for example, where I simply coded a table of the 8 possible arrangements of 1's & 0's in 3 cells. (see my code above)When I coded rules, I made a rule for each arrangement in the table. I also used the same initial conditions rather than randomizing them so I could see the effect of making a single rule change to an initial condition. Processing... Quote
Pyrotex Posted December 13, 2006 Author Report Posted December 13, 2006 I want to get to how you treat M, because I believe I used a different method. You seem to be using an algebraic calculation...Actually, I don't use the M in any of my calculations. I use it in my *explanation* to show that rule sets are always odd numbers. You got yer 1x3, 1x5, 1x7, 1x9, 1x11 and so on. I only used M to *classify* the rule set size. Quote
Turtle Posted December 13, 2006 Report Posted December 13, 2006 Actually, I don't use the M in any of my calculations. I use it in my *explanation* to show that rule sets are always odd numbers. You got yer 1x3, 1x5, 1x7, 1x9, 1x11 and so on. I only used M to *classify* the rule set size. Ok, not M then. But your V perhaps? You write V = F1*P1 + F2+P2 + F3*P3 + F4+P4 + F5+P5 + F6*P6 + F7*P7 + F8*P8 + F9*P9. I used no such calculation. Am I making sense yet? Quote
Pyrotex Posted December 13, 2006 Author Report Posted December 13, 2006 Ok, not M then. But your V perhaps? You write V = F1*P1 + F2+P2 + F3*P3 + F4+P4 + F5+P5 + F6*P6 + F7*P7 + F8*P8 + F9*P9. I used no such calculation. Am I making sense yet?Turtle, me lad! When have you ever not made sense? Except when you were trying to senseless, of course. And even then, your senselessness was of a very high quality. Back to the CA. There are many ways that a "rule" can be implemented in a CA. In Excel, it has to be implemented such that it can be incorporated into EVERY cell in the CA portion of the spreadsheet. Each cell must have a formula that can be calculated automatically by Excel's core engine. This makes using a lookup table as you did, rather time-consuming and inefficient (if it can be done at all). But in a way, the two techniques are the same. Have & be AND, and ^ be OR. F1&P1 is the same as F1*P1 iff P1 has values of only 0 or 1. Checking if the Big F-P summation falls within a narrow range can also be evaluated in terms of a logic table. Say, for example:F1*P1 + F2*P2 + F3*P3 must be equal to either 1 or 2, else cell is set to 0. ...can be interpreted as:F1 F2 F3 Cell-Value0 0 0 01 0 0 11 1 0 11 1 1 0...and so forth. Quote
Turtle Posted December 13, 2006 Report Posted December 13, 2006 Turtle, me lad! When have you ever not made sense? Except when you were trying to senseless, of course. And even then, your senselessness was of a very high quality. :D Back to the CA. There are many ways that a "rule" can be implemented in a CA. In Excel, it has to be implemented such that it can be incorporated into EVERY cell in the CA portion of the spreadsheet. Each cell must have a formula that can be calculated automatically by Excel's core engine. This makes using a lookup table as you did, rather time-consuming and inefficient (if it can be done at all). Now we are at the crux. I am extremely unfamiliar with Excel (as well as Quattro) so I appreciate the clarification. As to the time-consumption of look-up tables you are quite correct about inefficiency, but I am not so sure about it not working. I think the time to make it and the time to run it simply grows by the powers of 2. I have a 1x5 written the same way, but of course I never tried every possibility, and I never went higher because of the time constraints. I find it fascinating that you have incorporated terminology similar to 2-dimensional cellular automata enthusiasts use to describe notable artifacts. With the lower level CA's, I never wrote any descriptions other than 'interesting' or 'boring'. Is this all your own work? Fascinating. Quote
Pyrotex Posted December 13, 2006 Author Report Posted December 13, 2006 ...I find it fascinating that you have incorporated terminology similar to 2-dimensional cellular automata enthusiasts use to describe notable artifacts. With the lower level CA's, I never wrote any descriptions other than 'interesting' or 'boring'. Is this all your own work? Fascinating. :DWell, it is work that I did on my own without referencing other sources. However, that is not to say that some other bloke didn't do it first and better! :D Very few 1D cellular automatons generate "Actors" that either sit still and oscillate, or move one way or the other and maintain their form. Most rule sets either die out in a few generations, or fill the screen with vaguely repeating fractal-like patterns (or with noise). It is the ones that generate something "organic" that I find 'interesting'. It is a crying shame you don't have Excel. :rant: :bwa: With your talent and passion for math, and its graphical expression, Excel should be your favorite "toy". It is for me. I have spreadsheets that generate symmetrical Navaho Rug patterns! Another generates lovely topological maps from a "drunkard's walk" simulation. Another simulates Sharks, Fish and Seaweed in a boundless ocean, and tracks the population of each over time. (X-Kool :hihi: ) Another simulates "learning" among a family of 12 brain cells. I have so many different Excel apps. I wish I could share them with you. :( Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.