Symmetrical Cellular Automata Control Panel 1.2 Help

1. Introduction       top

This control panel provides an environment for comparing the different state symmetrical rules. It constructs a number of different initial patterns in a torus universe with tools probing different properties. The control panel is not limited to state symmetrical rules but by using the abbreviated notation either just the B part of the usual B/S notation or using the H form a state symmetrical rule is guaranteed.

The most studied state symmetrical CA is Day & Night which is defined as: B3678/S34678. The state symmetry is seen in that the list for survive is the opposite of the list for not survive (not Survive count = 8 - survive count) thus a state symmetrical CA can be defined just by the rules for being born. Following the practice of Wolfram the counts on which cells are born can be treated as bits in a binary number bit 0 set 1 for born on count zero thus B3678 is the binary number 1 1100 1000, however hexadecimal notation combines brevity with ease recovery of the bit positions giving H1C8 for this rule. The two's complement of 1 1100 1000 is 0 0011 0111 or in hexadecimal H037 which is referred to as the complementary rule to H1C8 both of these show the same pattern from the same initial conditions except that one changes state when the other does not. The control panel has the ability to swap between a rule and it's complement allowing reverse strobing to be investigated. With an empty universe the odd numbered rule strobes, changing state every generation some rules fill the universe with patterns that strobe in the odd rule a property referred to as reverse strobing. Golly does not support this rule simply running the even rule instead. The control panel has defined a set of three state rules which implement the odd numbered rules. This has two consequences firstly Golly has to be told where the rules are and secondly golly's population count is no longer meaningful.

A universe can be initialised with a random pattern, diagonal band, orthogonal band, checkerboard or an random filled island. A seed defined as a list of numbers 0-3 or as run length encoding of 'o', 'a', 'b' and 'c' ("00123" == "o2abc") is used to provide repeatable variations. The seed initialises the random sequence used for random patterns and imposes a pattern along one boundary of the bands and checkerboard patterns.

Features:

2. File Menu       top

Load Script from File For loading a script from a file
Paste Script For loading a script from the paste buffer
Run Script For running a loaded script
Paste & Run Script For pasting & Running a script
Set Rule Folder Change the folder containing the definition of the odd rules
Exit To exit the control panel

3. Edit Menu       top

Undo Undo previous command
Redo Redo previously undone command
Clear Clear the universe
Copy Pattern Copy the universe pattern in rle format to the paste buffer
Paste Pattern Paste a pattern in rle format from the paste buffer
Rotate Right Rotate the universe right pattern by the Rotate Step
Rotate Left Rotate the universe left pattern by the Rotate Step
Rotate Up Rotate the universe up pattern by the Rotate Step
Rotate Down Rotate the universe down pattern by the Rotate Step
Rotate Step Number of cells to rotate by

4. Universe Menu       top

Commands that change the universe.

Step Run one Generation
Run Run until Stopped
Run to Generation Run to this Generation
Run n Generations Run a number of Generations
Swap:Comp Swap this Rule for the Complementary Rule
Rebuild Rebuild generation 0
Change Rule New Rule
Change Width New Width
Change Hight New Hight
Change Seed New Seed
Change Geometry New Geometry (
Change Island Size Specify Island size for Island Geometries
Random Precentage Specify percentage of live cells for random filling shapes
Checkerboard Squares Specify the number of squars per side in the checkerboard geometry
Castellate Orthogonal Boundries modifiy the boundries in the orthogonal Geometries to supress blowoff
Change Fill Type Specify random or solid fill for shapes
Invert Islands Swap the areas which are filled

5. Lists Menu       top

There are two list that can be entered. One for Rules and one for Seeds. This enables a number of rules to be compared with each other with a range of seeds.

Rule List Build item Build the universe with the next Rule on the Rule List
Change Rule List Enter a new list of Rules
Change next Rule item Change the position in the list of rule the next rule will come from
Seed List Build item Build the universe with the next Seed on the Seed List
Change Seed List Enter a new list of Seeds
Change next Seed item Change the position in the list of Seed the next Seed will come from

6. View Menu       top

Fit Fit the Universe to the screen
Change Rule Format Rules can be displayed in either B/S format or the abbreviated Hexadecimal format
Rule Description Show the description of the rule in a separate dialogue
List Script List the loaded script
Island Analysis Results List the results of a previous island analysis (tools menu)

7. Layer Menu       top

Stack Layers Golly Stack Layers, useful with Tools menu Island Analysis
Tile Layers Golly Tile Layers
"Change Layer Golly select layer
Delete Extra Layers Delete layers added by tools or Scripts

8. Tools Menu       top

Find End Runs until the Type of Find End determines that a conclusion has been reached
Change Find End Type How the end of the run is determined:
OSC Oscillation found
Break A Band has broken when boundaries meet
Change Find End Initial Step The size of the initial step starting the search for the End result
Change Find End Max Generation The generation to abandon the search.
The algorithm does no stick on this limit exactly but it does represent a limit
Change Find End Min Period The Find End procedure may be speeded up by increasing this a little bit when large numbers are expected
Change Find End Max Period The maximum period that can be detected by the Find End procedure. Smaller numbers are faster.
Island Analysis Identifies orthogonal connected islands. The larges Islands of each state are shown in separate layers and colours
Island Analysis Results Repeats the results of the last Island Analysis
Check for Checkerboard Check if a checkerboard pattern has been established after blowoff. Must have no horizontal bands and the smallest of the two largest islands must have more cells then all the smaller islands put together.

9. Help Menu       top

Lists the actions of the menu items and gives some background information.

10. KeyBoard ShortCuts       top

KeyboardShortcuts
rrun
sstep
bback
fforward

11. Scripting       top

There are two different functions provided by script files. They can contain commands to control the universe in the control panel acting as a macro. They may also invoke external lua modules that might perform searches in a background universes saving results to files.

11.1 Script commands

Commands are either an expression or an assignment. There are no loops or conditional statements and brackets are not recognized. The operators in an expression are '+', '-', '*', '/' and '..'. The '..' is used to join text. All arithmetic is integer arithmetic. The left hand side of an assignment are:

CommandDescription
$wwwA variable can be used to hold text or numbers. 'www' is any string of alphanumeric characters. This variable can be used in expressions
copyThe result of evaluating the expression on the right of the '=' is put into the paste buffer
widthSet the universe width
hightSet the universe hight
geoSet the universe geometry
island_sizeSet the size for the island in the island geometries
reandom_percentSet the percentage live cells in random fill geometries
CB_squaresSet the number of squares in each direction of a checkerboard geometry
castrellateOBSet to 'TRUE' or 'FALSE'. The boundaries of the orthogonal band will be castellated accordingly
fill_typeSet to 'Solid' or 'Random' to modify the geometry
invert_islandSet to 'TRUE' or 'FALSE'. When 'TRUE' the area filled (either solid or random) will be swapped to the area not normally filled
rotateThe right of the'=' should be letter 'u','d','l' or 'r' for direction followed immediately by the number of cells e.g. rotate = 'u20' or rotate = 'u'..g.getheight()/2
rule_listThe results of evaluating the expression on the right of the'=' should be a list of rules
seed_listThe results of evaluating the expression on the right of the'=' should be a list of seeds
rule_formatSet to 'Hex' or 'B/S'.
fate_typeSet to 'OSC' or 'Break'
fate_initial_stepSet to the initial number of generation to run before starting the search for the final fate
fate_max_genset to the maximum number of generation to halt the search for the final fate
fate_min_periodSet to the minimum period of oscillation to check for
fate_max_periodSet to the maximum period of oscillation to check for
echoSet to 'all', 'result' or 'none'. Normally 'on' causes commands and results of this script to be echoed to the output. Value 'none' suppress both if all commands work.
tile_layerSet to 'TRUE' or 'FALSE' changes to golly setting
stack_layerSet to 'TRUE' or 'FALSE' changes to golly setting. Island analysis sets this true so this is useful to hide the coloured layer
ruleSet the rule e.g. rule = 'H1E8' or rule = 'B35678'
macro_k_modifiersWhere k is the key to be used to run the macro and modifiers is a list of modifiers. The right hand side is a string consisting of a list of commands separated by a semi colon. e.g. macro_a_none = 'width = g.getwidth()+5;run(5)' or macro_d_altctrlshift = "note='off';rotate = 'd5' "
noteSet to 'on' or 'off' suppress the note reporting the results of the commands.

The following commands are not assignments and can be used in expressions.

CommandDescription
banded_statesCounts the number of states which have horizontal bands with orthogonal connected cells. Useful for determining if a checkerboard pattern has been established
island_analysisPerforms the island analysis listing the size of the two biggest islands and other details. It adds a layer with colours showing the largest islands of each state
find_fatePerforms a search for the fate of the pattern
next_ruleThe universe rule is set from the rule list of any are left
next_seedThe universe seed is set from the seed list of any are left
run(nnn)Runs the universe for the number 'nnn' of generations. 'nnn' can be an expression it returns the generation number
g.getgen()Returns the universe generation
g.getpop()Returns the universe population
g.getwidth()Returns the universe width
g.getheigth()Returns the universe hight
g.getrule()Returns the universe rule string
getRule()Returns the universe rule in the current format
stepRuns the universe for one generation
next_ruleSets the universe rule to the next rule from the rule list
next_seedSets the universe seed to the next seed from the seed list
Check_CBCheck if the pattern is a checkerboard pattern.

The following operators can be used in expressions. Mathematical operators have the normal precedence. Brackets are not supported. Variables are alphanumeric strings beginning with '$'. They can hold integers or strings.

OperatorDescription
'..'Concatenate two strings e.g. $text = 'Gen='..g.getgen()
'+'sum two integer numbers e.g. g.getgen()+50
'-'subtract integer numbers e.g. g.getwidth()- 5
'*'multiply two integers e.g. g.getwidth()+50
'-'division of two integers e.g. g.getheight()/2. Fractions are ignored in the result

11.2 Script Modules

Scripts are extensions intended for long searches through rules to collect information for statistical analysis. The script file has a standard format to pass information to external lua modules. These modules can use functions in the control panel modules to utilize Golly's features. A very simple example is Stain-Script.txt:


    SymCA scripting
    SCRIPT script2-Stain
    GENS = 84
    ONECHANGE = TRUE
    SCRIPTEND

SymCA scripting identifies the beginning, SCRIPT script2-Stain identifies the external module as script2-Stain.lua, GENS = gives the number of generation to pass to the module, ONECHANGE is a logical value to pass to the module and SCRIPTEND indicate the last instruction. This module adds a layer and colours cells which have changed state over the number of generations given. When ONECHANGE is true any cells in the initial layer that have changed state are deleted so that stacked layers give one colour for any cell that has changed state.

The module must define interface tables:

    m.colonList = {}
    m.equalList = {['GENS'] = {'d',""}, ['ONECHANGE'] = {'l',"R"}}

Where m is the table returned by the module. colonList defines the lists , not required in this example but normally a list of rules or a list of seeds is required looking like:RULE: B3678, H1C9 in the script file. The 'l' and 'd' indicate logical and decimal the other option is 't' for text. The "R" indicates that the command is required.

The module script2.lua contains the code for scripting and requires that extension modules define the following interface functions:

    m.init(logfile, commonprocs)
    m.buildParmLst(cmd, parms, segNo)
    m.buildParmVal(cmd, value, segNo)
    m.validateScript()
    m.run(segmentNo)

init passes the module a logfile and a table with some common procedures, buildParmLst passes the module lists of values for colonList commands from the script file, buildParmVal passes the module values of equalList commands from the script, validateScript gives the module a chance to return a false value if the data in the script file is invalid and the run function is called to do the work.

A useful command that can be added to the script before a "SCRIPT" command is the "PATH" command. This has one parameter which is the path to the folder containing the lua module given in subsequent "SCRIPT" commands.








Site by Paul Rendell.

Last Update 11/March/24

Comments to Paul Rendell