Vector, the Journal of the British APL Association 1 of 8 http://archive.vector.org.uk/art10002630 Volume 19, No.3 BooleanHexagonalAutomata byAngelaCoxeandCliffReiter [Ed:Clickonthe iguresforlarger,moredetailedversions] Cellularautomataarelocalrulesthatareusedtoevolvediscretearrangementsofcells.Perhapsthe mostfamouscellularautomatonisConway’sGameofLife[2].Itisbasedupontheiterationofsimple rulesonarectangularlatticeofBooleanvaluedcells.Incrediblyrichstructureshavebeendiscovered andthereisagrowingliteratureofamazingfactsaboutthatautomaton[4]. One‐dimensionalcellularautomataarealsoknowntohaverichstructure,evenwhenconsidering Booleanautomataonsizethreeneighbourhoods[7].Wolfram’sbook,ANewKindofScience[7], suggests that simple automata are the principle behind many forces, whether they be artistic, physical,orsocial,intheworld.Evenwithoutagrandviewofautomata,theyareclearlyrelatedto importanttechniques,suchaslocal iltersforimageprocessing. OneintriguingautomatonthatWolframdescribesisde inedonahexagonallattice;itsbehaviorhas somefeaturessuggestiveofasnow lake.Acelliseitherfrozen(1)ornot(0);itstaysthesameatthe nextgenerationunlessitiscurrentlyunfrozenandexactlyoneofitsneighboursisfrozen,inwhich caseitfreezes.Inthisnotewewillinvestigatecellularautomataonhexagonallatticesandtheir implementationinJ.FirstweconsiderWolfram’ssnow lakeautomaton. Wolfram’sSnow lakeAutomaton AhexagonallatticemaybeviewedasacollectionofpointsarrangedlikethecirclesinFigure1.A hexagonal array of cells may be implemented via a rectangular array where alternate rows are imaginedtobeoffsetbyhalfaposition.Inarectangulararrangementofcells,thenearestneighbour neighbourhoodsconsistof3by3blocksofcells.InFigure1,thecelllabelled4couldbethoughtofas thecentreofa3by3blockofcells,whicharelabelled0‐9.However,inthehexagonalview,thecell labelled4hassixneighbours,015763,listedclockwiseandshowninbold.Weconsiderthis hexagontobealeftcon igurationinthe3by3neighbourhood.Onalternaterows,thehexagonal neighbourhoodswillalternatebetweenleftandrightcon igurations. Figure1.Ahexagonalarrangementofcellswithonerectangularneighbourhood,withcells numbered0‐8,andthecorrespondinghexagonalneighbourhood,withcellsinbold. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 2 of 8 http://archive.vector.org.uk/art10002630 Thefollowing12utilitiesimplementthehexagonalautomatonandallowustoviewit.Weexplain howtheutilitiesworkbelow. First,padallowsustocreateinitialcon igurations.Thus,thefollowinggivesasimplecon iguration withasingleinitialfrozenspeck. Ifweiteratetheautomatontwice,weseethefollowing.However,thesymmetryishardtosee. Bydoublingthenumberofpixels(imagine2by2blockstobeacell)androtatingalternatepairsof rowsbyone,thehexagonalsymmetrybecomesreasonablyapparent.However,itisstilleasiertosee thesymmetryinthe igures. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 3 of 8 http://archive.vector.org.uk/art10002630 Thecentreandleftneighbourhoodisproducedfroma3by3cellvia ;theright‐handversionis producedby .Weconsidertheresultinglistof7numberstobethehexagonalneighbourhood. Thecentreandnumberofneighbours(withvalue1)ofahexagonalneighbourhoodaregivenby and .Theheartoftheautomatonissimpletodescribe.Recallthatfrozencorrespondsto1. Thus,thevalueofacellonlychangesvaluewhenitiscurrently0buthasexactlyoneneighbourwith value1.Onahexagonalneighbourhood, gives1ifthecentreis1; otherwise the result is the result of the test of whether there is exactly one neighbour, which completely describes the desired automaton. Now these need to be put together on all neighbourhoods (3 by 3 blocks of cells in the rectangular view). The key idea is all 3 by 3 (halfhexagonal neighbourhoodsareselected,andthelocalautomatonisapplied.Theadverb automaton)accomplishesthatoneithertheleftorrightneighbourhoods;theadverbargumentis accordinglyeither or .Noticethatcut 3withaleftargumentof isperfectfor gettingthe3by3tesselationsoffsetby1alongoneaxisand2alongtheother.The inalautomaton, ,appliestheperiodicextensionappropriatetoeachaxis,appliesthelocalautomatonand thentheresultsareintertwined. Figures2and3showiterations107and127onaninitialcon igurationwithasingleinitialpoint. Whilethereissomestructuredgrowthatiteration107,thegrowth illsinoniteration127.Thisis truenearotherpowersoftwo,hencethestructuresweseearetypicalforthisautomaton. Figure2.Iteration107ofWolfram’ssnow lakeautomaton. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 4 of 8 http://archive.vector.org.uk/art10002630 Figure3.Iteration127ofWolfram'ssnow lakeautomaton. MakeaMovie Wecancreateananimationoftheevolutionofthisautomatonusingtheimage3addon[6]. The followingfunctionmaybeusedtocreate128framesoftheevolution;thesubsequentlinesillustrate howthatmaybedoneandthenbeassembledintoamovie.Theresultmaybeviewedat[3]. Themovieshowsthatwhiletheautomataexhibitsbeautifulgrowth;italsocon irmsourremarkthat onlylimitedtypesofbehaviourappear. Snow lakes BentleyandHumphreys[1]tookthousandsofphotographsofsnow lakesandicecrystals.Figure4 showsfourexampleswhichgiveaglimpseofthediversityofsnow lakes. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 5 of 8 http://archive.vector.org.uk/art10002630 Figure4.FourofBentleyandHumphreys’snow lakes. See[5]forawonderfuldiscussionofsnow lakegrowth.Weseethatrealsnow lakeshaveafarmore diversestructurethanseeninWolfram’sautomaton.Inthenextsectionwebrie lyinvestigateother automataonahexagonallatticethatmaintainthesymmetryofahexagon. OtherHexagonalAutomata Thesymmetriesofthehexagon(whichisthedihedralgroupdenotedD6)arethesix‐foldrotations alongwithre lectionsthroughoppositevertices.Ourconventionistousealistofthecentreand then 6 neighbours to represent a hexagonal neighbourhood. Thus, the rotations of the hexagon correspondtorotationofthelast6elementsandthemirrorsymmetrycorrespondstoreversalof thoseelements.Thus,wecanapplyallthesymmetriestoalistoflengthsixvia ,whichisde ined below. ThenalltheBooleanvaluespossibleonthe6neighboursmaybeclassi iedinto13classesbyusing “key”wherethe irstelementfromtheorderedapplicationofd6markstheclass.Fouroftheclasses areshownbelow. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 6 of 8 Thefollowinggivestheclassnumber(from http://archive.vector.org.uk/art10002630 )ofeachofthe64classes. Sinceeachclassappearswithacentrevalueof0and1,thereare26Booleanvaluestobespeci iedin ordertospecifyanautomatonwiththesymmetryofahexagon. ,de inedbelow,allowsustoassociateanumberwiththose26Booleanvalues.The Thefunction adverb createsafunctionthatlooksupthevaluefromtheruleoftheappropriateclass ,andwecan fortheinputneighbourhood.Thenweneedonlychangethelocalautomaton, applyconstructionsasintheearliersection. Figures5‐7showtheresultofrules25629998,27541687and32824527atiteration127. Figure5.Automatonwithhexagonalsymmetry(rule25629998). 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 7 of 8 http://archive.vector.org.uk/art10002630 Figure6.Automatonwithhexagonalsymmetry(rule27541687). Figure7.Automatonwithhexagonalsymmetry(rule27541687). Animationsoftheevolutionoftheseautomataappearon[3].Theseexhibitintricate,fairlysolidand fernybehaviours. Withfurtherexperimentation,weseethatnontrivialBooleanautomataofthistypeseemtohavea hexagonalframeafter127iterations.Thisisnotsurprisinggiventhefactthatinordertobephysical, weshouldprobablyrequirethat0neighbourhoodsremain0.Moreover,theinitialcon iguration involvesonlyoneothercon igurationthatcouldallowgrowth,namely,a0cellwithexactlyone neighbour.Ifgrowthistooccur,thatcon igurationmustbecome1.ThatisexactlytheWolframrule thatallowschange.Hence,thatruletendstocreateanenvelopeofthebehavioursthatoccur. 4/24/2015 4:49 PM Vector, the Journal of the British APL Association 8 of 8 http://archive.vector.org.uk/art10002630 Theautomatawehavestudieddonotexhibitthesamebehavioursseeninordinarysnow lakes. However, these automata have very rich behaviours. We have also seen that they are readily implementedinJandeasilypresentedwithananimation. References [1]W.A.BentleyandW.J.Humphreys,SnowCrystals,DoverPublications,NewYork,1962. [2]E.Berlekamp,J.Conway,andR.Guy,WinningWaysForYourMathematicalPlays,Academic Press,NewYork,1982. [3] A. Coxe and C. Reiter, Auxiliary Materials for Boolean Hexagonal Automata, http://www.lafayette.edu/~reiterc/mvp/hx_auto/index.html [4]A.Hensel,Conway'sGameofLife,http://hensel.lifepatterns.net/ [5] K. Libbrecht, http://www.its.caltech.edu/~atomic/snowcrystals/physics/physics.htm Snow Crystals, [6]C.ReiterandZ.Reiter,Image3Addon,www.jsoftware.com,toappear. [7]S.Wolfram,ANewKindofScience,WolframMedia,Champaign,2002. AngelaM.Coxe LafayetteCollegeBox8916 Easton,PA18042USA [email protected] CliffReiter DepartmentofMathematics LafayetteCollege Easton,PA18042USA [email protected] 4/24/2015 4:49 PM
© Copyright 2024