CAViewer - A Cellular Automaton Simulator written in Java

For scripts to aid with computation or simulation in cellular automata.
Post Reply
lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

CAViewer - A Cellular Automaton Simulator written in Java

Post by lemon41625 » April 5th, 2020, 1:36 am

I wrote this CA simulator to simulate multi - state extended neighbourhood rules that Golly and Lifeviewer cannot.
There is support for alternating rules, mutliple states and customisable neighbourhoods. Unfortunately, the algorithm used to compute the cellular automaton is rather slow and the program has several bugs.

Rules are defined as python code. There are some sample rules in the rules folder.

There are 3 dependencies - PyQt5, pyperclip and PIL. Requires Python 3.6 or higher.
There is no .exe file as compiling the program to .exe stops the changing of rules from working.

Future work:
  • Support for b and o in rles and rles with above 26 states.
    Faster Algorithm (Maybe Dynamic Programming Optimisation)
    Function to identify various patterns
    Support for Hexagonal and Triangular Tilings
See https://github.com/jedlimlx/Cellular-Automaton-Viewer for the latest version.
Last edited by lemon41625 on September 10th, 2020, 3:53 am, edited 3 times in total.
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 5th, 2020, 8:58 am

Update:

New rules added to rules folder.
Bug where opening pattern popup would appear multiple times fixed if new pattern is created.
Tooltips on buttons added.

Also some screenshots:
Pic.png
Pic.png (32.64 KiB) Viewed 8322 times
Pic.png
Pic.png (48.09 KiB) Viewed 8322 times
Attachments
CAViewer.zip
(773.05 KiB) Downloaded 159 times
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 6th, 2020, 5:16 am

Most people(because they have golly)use python 2.x.x,which is different from this, may be a big problem.
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 6th, 2020, 8:12 am

Update v1.0:

Files now come with a WinPython Portable Distribution. (No need to install Python 3, but only works for Windows) - To run, run RunMain.bat
On Mac or Linux, you need to run the code with your own python installation.

New rules added to rules folder and rules folder has been reorganised.
New option to set zoom of the program.

Update v1.1:

New rules added to rules folder
Options for Symmetries in Random Soups - C1, C2_1, C2_2, C2_4, D2_+1, D2_+2, D4_+1, D4_+2, D4_+4 (More Symmetries Coming Soon)
Options for Adjusting Simulation Speed
New DP Algorithm Added (Its actually very very very slow, still trying to speed it up)

Please give me feedback if you have any. Thanks.
Files: https://mega.nz/file/ZBs3jCxR#Uk38sumvX ... FYF5LUokZ0
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 8th, 2020, 10:02 pm

Also here are the instructions for running the program.

Instructions
=================================
To Start the Program, Run RunMain.bat or Main.py

Patterns are stored as rles.

After you select the Pattern / Area with the Selection Tool
To Copy, Press Ctrl+C
To Cut, Press Ctrl+X
To Delete, Press Del
To Paste, in the area, Press Ctrl+V
To Generate Random Soup, Press the Button with a Soup
To Generate Multi-State Random Soup, Press the Button with a Soup and a 2 on it

In the file menu, you can save, open, and create a new pattern.
In the edit menu, you can copy, cut, delete and paste a pattern.
In the control menu, you can adjust random soup and simulation settings and step forward 1 generation.
In the zoom menu, you can zoom in and out and set the zoom.

Troubleshooting
================================
When you run the simulation, it the cells do not change, it could be because there is an error in your transition function or because there is an error in the program.
If you suspect a bug, please report it.
Attachments
Instructions.txt
(993 Bytes) Downloaded 156 times
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 8th, 2020, 11:00 pm

Can’t open link here. https://mega.nz/file/ZBs3jCxR#Uk38sumv ... FYF5LUokZ0could be blocked.Can you post the zip file here?
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 9th, 2020, 12:06 am

Here is the file on Google Drive. I will keep it here until I have time to upload everything to github.
https://drive.google.com/open?id=1ML_nm ... hxyKZiGuq_
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 9th, 2020, 12:12 am

Oh no!(Ha, I live in China. No google.)
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 9th, 2020, 12:49 am

Uploaded to Github: https://github.com/jedlimlx/CAViewer
Link to the WinPython: https://app.nihaocloud.com/f/50bbe4ea7e364b19a873/?dl=1 -> Unzip and Place Folder in the zip inside CAViewer Folder
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 9th, 2020, 1:06 am

Sorry, but I can’t open this also(what? Is it a Chinese website blocked by Chinese?你好云。咋么了,我一点也不云。) https://app.nihaocloud.com/f/50bbe4ea7 ... a873/?dl=1wait, there is only html,python and c++ . What?(I know nothing about python)
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 9th, 2020, 1:54 am

New Github Link: https://github.com/jedlimlx/Cellular-Automaton-Viewer (Everything Inside)

Unzip the WPy64-3770.zip and place the folder inside inside CAViewer.
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 10th, 2020, 3:36 am

Update v1.2:

No longer need to unzip WinPython zip. It is already unzipped in the github.

Fixed Numpy Library not Found Bug and Recorder Icon Missing Bug

Added Function to Identify Pattern - Oblique (9, 4)c/13 Spaceship, P 1880 Oscillator... (For now, only supports still life, oscillators and spaceships)
If it outputs failed, it means that the pattern is not still life, oscillator or spaceship. If you suspect a bug, please report it.

Added Function to Record Pattern and save as gif.

Added New Rules:
BSFKLWeighted_Rule_5 is quite GOL Like (2 Known Spaceships - One 2c/2 and One 2c/6, 1 Known Oscillator)
BSFKLAlternating_Rule_1 has Oblique (9, 4)c/13 Spaceship

Code: Select all

x = 17, y = 20, rule = BSFKLAlternating_Rule_1
17.$17.$17.$17.$17.$6.A10.$5.BAB9.$6.AB2A7.$5.B4A7.$6.2BA8.$17.$17.$17.$17.$17.$17.$17.$17.$17.$17.1$!
And some others...

If you do not know how to code Python, you can edit the rulestrings inside the sample transFunc.py files. Currently there are Outer Totalistic, BSFKL and Extended Generations Rulestrings.

https://github.com/jedlimlx/Cellular-Automaton-Viewer
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 12th, 2020, 2:16 am

Update v1.3:

Sped up simulation slightly (Not much difference)
Added new rule format (.ca_rule) for those who do not know who to code python.
Added ability to identify guns.
Not yet supported natively, modify Rules/sample.ca_rule to change rule.

Added New Rules to Others (Using Square Cell's Rule Table Format):
WeightedGenerations_Rule_8 supports some interesting spaceships - (24c/26, 3c/2, 10c/10...).
And some others...

Screenshot of Rule_1 with Identity Function
Thing.png
Thing.png (43.02 KiB) Viewed 8081 times
https://github.com/jedlimlx/Cellular-Automaton-Viewer
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 13th, 2020, 10:14 pm

How big is the file?(to be sure there isn’t any error while downloading, github didn’t tell the size)
Is there grids?
Edit:
Can’t download
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 14th, 2020, 1:47 am

The file downloaded from github should be about 170 MB before unzipping. Its mostly because of the WinPython Installation.
The source code only takes up about 1 MB.

I can download the file from github. Can you let me know what is the error?
I will attach the source code here.
However, you will need to download Python 3.6 or higher, and install the dependecies PyQt5, Pyperclip, Numpy and PIL and run Main.py.

If there are any other problems, let me know.
Attachments
CAViewer.zip
(1.43 MiB) Downloaded 158 times
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

User avatar
yujh
Posts: 3066
Joined: February 27th, 2020, 11:23 pm
Location: I'm not sure where I am, so please tell me if you know
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by yujh » April 14th, 2020, 5:27 am

Thanks.
Can’t download error is really common in China.
Rule modifier

B34kz5e7c8/S23-a4ityz5k
b2n3-q5y6cn7s23-k4c8
B3-kq6cn8/S2-i3-a4ciyz8
B3-kq4z5e7c8/S2-ci3-a4ciq5ek6eik7

Bored of Conway's Game of Life? Try Pedestrian Life -- not pedestrian at all!

User avatar
bubblegum
Posts: 959
Joined: August 25th, 2019, 11:59 pm
Location: click here to do nothing

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bubblegum » April 14th, 2020, 9:51 pm

I'm working on a similar project known as eCA, with just one dependency: pygame

(and i've been working on this for two months and i just discovered this)
and it's not very complete, I mean it's just a black screen right now, but I'm trying to tie this closely to LifeViewer so kind of like the LV app that never will be
Each day is a hidden opportunity, a frozen waterfall that's waiting to be realised, and one that I'll probably be ignoring
sonata wrote:
July 2nd, 2020, 8:33 pm
conwaylife signatures are amazing[citation needed]
anything

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 15th, 2020, 12:23 am

Update v1.4
Added native support for .ca_rule - Option in Rule Opening Menu (Supports BSFKL, Outer Totalistic and Extended Generations).
Also hoping someone can help with writing transition func for isotropic non totalistic range 2 von neumann rules.
I am also looking for suggestions on how to identify rakes and replicators programatically.

Added New Rules:
AlternatingGenerations_Rule_2 has an oblique (1,4)c/6 Spaceship
Details of Rule_4 here: https://conwaylife.com/forums/viewtopic.php?f=11&t=4347

https://github.com/jedlimlx/Cellular-Automaton-Viewer
Attachments
CAViewer.zip
(2.24 MiB) Downloaded 130 times
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bprentice » April 15th, 2020, 7:43 am

Please provide a version of your CA Simulator that runs on Windows 7.

Brian Prentice

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 15th, 2020, 8:45 am

It should be compatible for Windows 7, I think. Can you let me know what the error is?

It also may be the WinPython Installation only working for Windows 10. If so, you will have to install Python 3.6 or higher with dependencies PyQt5, Pyperclip, Numpy and PIL.
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bprentice » April 15th, 2020, 10:25 am

Since your software runs on Python 3.6 as stated here:

posting.php?f=9&mode=reply&t=4391&sid=e ... 91#pr93310

and Python 3.6 runs on Windows 7, please provide a Python 3.6 version of Wpy64-3770. Then both Windows 7 and Windows 10 will be conveniently supported.

Brian Prentice

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 15th, 2020, 10:56 am

I will work on it.
However, it the software can run on Python 3.6 or higher.
The installation provided is Python 3.7.7 which can also run on Windows 7.

So for now, you can use the existing installation of Python 3.7.7.
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bprentice » April 15th, 2020, 2:06 pm

I tried your simulator again as you suggested and had some success. Yesterday I made the incorrect assumption that loading a pattern would first select the correct rule. This lead to many error messages. Today I first cleared the display, then loaded a rule and then loaded a pattern. I tried most of your patterns and they all seemed to work. You might want to update your user notes so that others don't make the same mistake that I did.

I look forward to following your progress as you continue to develop your software. Please write a note describing in detail what must be done to install a new version without having to reload WinPython and the required packages.

Brian Prentice

lemon41625
Posts: 344
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by lemon41625 » April 16th, 2020, 9:54 am

Update v1.5:

Updated README.md to mention that loading a pattern does not load corresponding rule.
Added New Rule Interface to Generate Rules in .ca_rule format visually. (Will add generating random rules in this soon)
Fixed Bug in Random Soup Symmetries.
Added Error Message in when opening and loading rle if the number of states is incorrect.
Added Rules to Rule Folder

Note:
When there is a new update, unless I specify that the dependecies change, you can just replace source code.
There is no need to replace the WinPython Installation.

Source code is attached. Source with WinPython Installation can be found at https://github.com/jedlimlx/Cellular-Automaton-Viewer
Attachments
CAViewer.zip
(2.26 MiB) Downloaded 117 times
Download CAViewer: https://github.com/jedlimlx/Cellular-Automaton-Viewer

Supports:
BSFKL, Extended Generations, Regenerating Generations, Naive Rules, R1 Moore, R2 Cross and R2 Von Neumann INT
And some others...

bprentice
Posts: 920
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bprentice » April 16th, 2020, 1:14 pm

Your 'number of states is incorrect' error message is displayed by simply loading rule '../Others/Rule_4' and then loading a pattern from that rule. To determine what is happening do the following:

After a request is made to load a rule, write the name of the requested rule together with its number of states to the cmd window.

After a request is made to load a pattern, write the name of the requested pattern together with the required number of states and the name of the current rule and the current number of states to the cmd window.

Brian Prentice

Post Reply