CAViewer - A Cellular Automaton Simulator written in Java

For scripts to aid with computation or simulation in cellular automata.
lemon41625
Posts: 268
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 » June 7th, 2020, 8:08 am

Update v1.21:

Added support for hexagonal tilings
Added a snaking reading order for naive rules (like nn0osn0)
Added support for bounded grids (for now the only way to change the grid is to open a pattern with the appropriate rle header, Klein Bottle and Cross Surface kind of broken)
Added support for comments in RLEs

For hexagonal rules (looking for suggestions on intuitive way to define neighbourhood)
If you don't define tiling it defaults to square, if you don't define B/S Conditions it defaults to Outer Totalistic.

Code: Select all

Name: Hexagonal

Neighbourhood Range: 2

Neighbourhood:
0,0,0,0,0
0,1,1,0,0
0,1,0,1,0
0,0,1,1,0
0,0,0,0,0

State Weights: 0,1

Rulespace: Single State

B/S Conditions: Outer Totalistic

Tiling: Hexagonal

Rulestring: 2,3/3

Colour Palette:
None
Source Code + WinPython Installation: https://github.com/jedlimlx/Cellular-Automaton-Viewer
Source Code:
Attachments
CAViewer.zip
(4.32 MiB) Downloaded 33 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...

lemon41625
Posts: 268
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 » June 15th, 2020, 8:14 am

Update v1.22:

Fixed Klein Bottle and Cross Surface
Added Spherical with Bubblegum's help (its broken)
Added an agar searching tool under the search menu - It uses the same algorithm as OCAgar and RandAgar and supports all rules supported by CAViewer.
For now it only outputs to the console and the rle header used is also invalid. I'll get that fixed soon.

Fixed some bugs and made some other minor improvements

Source Code + WinPython Installation: https://github.com/jedlimlx/Cellular-Automaton-Viewer
Source Code:
Attachments
CAViewer.zip
(4.36 MiB) Downloaded 31 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...

lemon41625
Posts: 268
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 » June 21st, 2020, 1:29 am

Update v1.23:

Added support for generating apgtables for all INT rules supported by CAViewer and Outer Totalistic B/S Conditions as well as Single State and Extended Generations Rules
Fixed bug where the bounded grid lines weren't showing up
Further optimised the agar searching algorithm.
The agar search program now outputs stuff to a directory chosen by the user.
Added more rules to the sample rules folder.
Added more stuff to the README.md

Also, changed the way that the cython files need to be compiled.
If you are on linux/mac, just compile the setup.py file in the CAViewer directory. No need to compile individually.

I also think I should get started on that LtL search program I was planning to do.

Source Code + WinPython Installation: https://github.com/jedlimlx/Cellular-Automaton-Viewer
Source Code:
Attachments
CAViewer.zip
(7.63 MiB) Downloaded 31 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
martin.novy
Posts: 138
Joined: October 22nd, 2014, 6:22 am
Location: Czechia, EU
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by martin.novy » June 21st, 2020, 6:18 am

lemon41625 wrote:
June 21st, 2020, 1:29 am

I also think I should get started on that LtL search program I was planning to do.
could you tell me something about it?

lemon41625
Posts: 268
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 » June 21st, 2020, 6:20 am

martin.novy wrote:
June 21st, 2020, 6:18 am
lemon41625 wrote:
June 21st, 2020, 1:29 am

I also think I should get started on that LtL search program I was planning to do.
could you tell me something about it?
I orginally wanted to use the lifesrc algorithm. But I changed my mind. It's SMT solver based and I'm building off some code by WildMyron and Scorbie.
It should be able to search for spaceships and oscillators.

I'll provide more details when I release it in a few days.
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: 268
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 » July 6th, 2020, 9:38 am

Update v1.24:

Added Knight INT Rules
Added reptition detection in the agar search via population sequences (approach inspired by Hunting's TODO statement in the OCAgar repo)
Made CAViewer render hexagonal rule with actual hexagons (some stuff is broken but I'll fix it soon)
Added apgtable generation for BSFKL (doesn't work for OT) and Regenerating Generations (untested)
Added more rules into the rules folder.

Added an easter egg 🥚

Also ignore my previous post about the setup.py. Just use the ones in the CACompute and CAComputeParse folder.

Source Code + WinPython Installation: https://github.com/jedlimlx/Cellular-Automaton-Viewer
Source Code:
Attachments
CAViewer.zip
(4.05 MiB) Downloaded 29 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...

lemon41625
Posts: 268
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 » July 24th, 2020, 6:18 am

Update v1.25:

Fixed some compability issues with clang.
Updated the README with new installation instructions.

Fixed? alternating rules. Well its still broken but perhaps less broken.

Source Code + WinPython Installation: https://github.com/jedlimlx/Cellular-Automaton-Viewer
Source Code:
CAViewer.zip
(6.81 MiB) Downloaded 29 times
=====================================

I'm also working on a Java port of CAViewer to fix all those compability issues and improve cross platform support.
It's still a pre-release so its not on github.

It's built using JavaFX and Java's OOP features should make maintaining the code far easier. It also seems to be possible to embed a *.jar into html to get a web app.

JavaFX is also easier to use. Using Java will also allow me to finally implement @bprentice's suggestion to use classes to define rule families.
However, Java does not have dynamic code execution so you'll have to recompile it which also means you need JDK for writing custom rule families.
Otherwise, the JRE should suffice.

Here's the *.exe: https://drive.google.com/file/d/1urlROx ... sp=sharing for those who can't run Java.
Here's the *.jar https://drive.google.com/file/d/1WIgO-E ... sp=sharing
Also that's not my real email address that I'm using to share the files.

If you're in China, wait till I put it on github. The executable files exceed 10 MB so I can't upload them here.
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: 268
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 » July 28th, 2020, 8:30 am

bprentice wrote:
April 22nd, 2020, 3:44 pm
To simplify and reduce the number of your transition functions consider a design that uses python classes to implement rule families.

An object created from the base rule class reads and writes the pattern specification which is common to all rules. Objects created from inherited rule classes implement a specific rule family. Methods in these inherited classes use dialogs to display and obtain rule parameters and options. Methods are also provided to generate and test new rules.
Done!

New features in the prerelease:
Added tooltips
Fix RLE bug
Added headers & comments to RLEs
Added a rule search program to look for rules that support spaceships (it outputs to the invisble console but that will be address soon)
Added documentation for modifying the application MODIFY.md. This includes the custom rule families requested by Brian Prentice.
Added new neighbourhood types - Gaussian & Aligned Checkerboard

Get the precompiled binaries here: https://github.com/jedlimlx/Cellular-Au ... r/releases
martin.novy wrote:
July 28th, 2020, 7:34 am
do you already have a subcollection of interesting rules with just 2 states or "generations-states" and 0/1 neigh. weights and state weights in range 2 ?
Have a look at these searches I ran with the HROT rule search. There are some interesting rules inside. The seed used to run the search is found at the top.
Attachments
ships.zip
(67.87 KiB) Downloaded 23 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
martin.novy
Posts: 138
Joined: October 22nd, 2014, 6:22 am
Location: Czechia, EU
Contact:

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by martin.novy » July 28th, 2020, 9:28 am

lemon41625 wrote:
July 28th, 2020, 8:30 am

Have a look at these searches I ran with the HROT rule search. There are some interesting rules inside. The seed used to run the search is found at the top.
big thanks for the datasets!

I plan to convert the rulestrings to lifelib notation, and feed the list to testOfRules.py

lemon41625
Posts: 268
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 » July 31st, 2020, 3:45 am

After what seemed like a million commits, I finally setup Github Actions.

Well... The MacOS Binary isn't uploading so that might be a problem.

https://github.com/jedlimlx/Cellular-Au ... er/actions
Download the Jar here: https://github.com/jedlimlx/Cellular-Au ... s/12750932
Download the Windows Binaries here: https://github.com/jedlimlx/Cellular-Au ... s/12750934
Download the Linux Binaries here: https://github.com/jedlimlx/Cellular-Au ... s/12750933
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: 268
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer, Bipolar rules

Post by lemon41625 » August 15th, 2020, 12:52 am

martin.novy wrote:
May 6th, 2020, 10:54 am
lemon41625 wrote:
May 6th, 2020, 9:40 am

Do you intend to make a rulestring for this rulespace (if so I can write in code in CAViewer to support it in the rule dialog and the .ca_rule format)?
rulestring ... what does @BPrentice think ?

EDIT in August:
I would either suggest:
A) multiline rulestrings, where every line begins with a #KEYWORD
keep nearly the sqc format

B) Or for single-line rulestrings:

Code: Select all

SQC;Rule=Rule-Table;States=3;Counts=19;SW=1,0,2;NW=0,0,0,0,0;NW=0,1,1,1,0;NW=0,1,1,1,0;NW=0,1,1,1,0;NW=0,0,0,0,0;RT=0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0;RT=0,0,0,0,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0;RT=0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,0,0,0,0
I've already implemented multiline rulestrings for weighted neighbourhoods in CAViewer v2.
See https://github.com/jedlimlx/Cellular-Au ... iewer/wiki. Specifically the portion on HROT rules (note that the LV format isn't actually implemented yet).

Hopefully I can release the new update soon.
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
martin.novy
Posts: 138
Joined: October 22nd, 2014, 6:22 am
Location: Czechia, EU
Contact:

Re: CAViewer, Bipolar rules

Post by martin.novy » August 15th, 2020, 9:27 am

lemon41625 wrote:
August 15th, 2020, 12:52 am
martin.novy wrote:
May 6th, 2020, 10:54 am

EDIT in August:
I would either suggest:
A) multiline rulestrings, ...
I've already implemented multiline rulestrings for weighted neighbourhoods in CAViewer v2.
See https://github.com/jedlimlx/Cellular-Au ... iewer/wiki. Specifically the portion on HROT rules (note that the LV format isn't actually implemented yet).
thanks for info
I have now added a link from that my post to this your post

lemon41625
Posts: 268
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 » August 17th, 2020, 6:01 am

Update v2.0:
  • Added support for HROT Generations (no state weights yet)
  • Added support for LifeViewer's weighted neighbourhood format
  • Added support for apgtable generation for weighted rules
  • Improved the rule search program
    • Added repeat speeds / periods detection
    • Built in parameter setting dialog and dialog to view search results
    • Added support for saving results to *.csv file.
    • Support for multi-threading
  • Improved identification
    • Added support for min, max rules
  • Improved the Giffer
    • Support for pixel sizes > 1 and different timing between frames
  • Added rules to the rules folder
Documentation: https://github.com/jedlimlx/Cellular-Au ... iewer/wiki

Download JAR (Java required, Cross-Platform): https://github.com/jedlimlx/Cellular-Au ... s/14274044
Download Windows Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274047
Download Mac Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274046
Download Linux Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274045
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: 705
Joined: September 10th, 2009, 6:20 pm
Location: Coos Bay, Oregon

Re: CAViewer - A Cellular Automaton Simulator written in Python

Post by bprentice » August 18th, 2020, 2:38 pm

lemon41625 wrote:
August 17th, 2020, 6:01 am
Download JAR (Java required, Cross-Platform): https://github.com/jedlimlx/Cellular-Au ... s/14274044
Download Windows Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274047
Download Mac Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274046
Download Linux Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274045
All of these download references generate:
error.png
error.png (1.01 MiB) Viewed 855 times
Brian Prentice

lemon41625
Posts: 268
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 » August 18th, 2020, 7:02 pm

bprentice wrote:
August 18th, 2020, 2:38 pm
lemon41625 wrote: Download JAR (Java required, Cross-Platform): https://github.com/jedlimlx/Cellular-Au ... s/14274044
Download Windows Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274047
Download Mac Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274046
Download Linux Binary (Java not required): https://github.com/jedlimlx/Cellular-Au ... s/14274045
All of these download references generate:
error.png
Brian Prentice

Try: https://github.com/jedlimlx/Cellular-Au ... er/actions

Link on the latest build with a green tick.

You will need a github account to download the lastest build.

EDIT:
In future, I'll just add the generated binaries to the release on github.
Download the artifacts from here: https://github.com/jedlimlx/Cellular-Au ... s/tag/v2.0

No need for a github account.
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: 268
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 » September 1st, 2020, 10:39 am

Update v2.1:
  • Added apgtable generation for weighted B0 rules
  • Added B0 Generations via a generalised B0 algorithm
    • Now, implementing B0 in other rulespaces is as easy as ABC
  • GUI Improvements
    • Added arbitary range to the neighbourhood selector
    • Added grid lines
    • Added clockwise and anti-clockwise rotation
    • About button will now open up a built-in browser to view documentation
  • Added settings storage (rule will stay the same when application restarts, ...)
  • Improved documentation (setup Github Pages)
  • Added rules to the sample rules folder
Documentation: https://jedlimlx.github.io/Cellular-Automaton-Viewer
Wiki: https://jedlimlx.github.io/Cellular-Aut ... /Home.html

Precompiled Binaries: https://github.com/jedlimlx/Cellular-Au ... r/releases
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: 268
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 » September 10th, 2020, 3:51 am

New features added since last update:
  • Rule Support
    • B0 apgtable generation support
    • State weights support
    • Extended Generations support
    • Triangular rules support
  • GUI / Editing Improvements
    • Pasting now works like in Golly
    • Added Ctrl + A to select all, Ctrl + Z to undo
  • Added a command line interface which supports:
    • Random synthesis generate for any ship (input in North-West-West direction) to pipe into apgsearch
    • Random soup generation
    • Simulation
    • Apgtable Generation
    • Identification
    • Minimum and maximum rule identification
  • Bug Fixes
    • Fixed bug which caused ConcurrentModificationException to be thrown and causing the simulation to randomly pause
    • Fixed issues with using space bar to step 1 generation
Documentation: https://jedlimlx.github.io/Cellular-Automaton-Viewer
Wiki: https://jedlimlx.github.io/Cellular-Aut ... /Home.html

Precompiled Binaries: https://github.com/jedlimlx/Cellular-Au ... r/releases
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: 268
Joined: January 24th, 2020, 7:39 am
Location: 小红点 (if you know where that is)

Re: CAViewer - A Cellular Automaton Simulator written in Java

Post by lemon41625 » Yesterday, 8:53 pm

Update v2.3:
  • Rule Support
    • Added deficient and integer HROT rules
    • Added 1D rules
    • Added HROT History
    • Refactor quite a bit of code
  • GUI / Editing Improvements
    • Simulation is approximately 10 - 20 times faster
    • Ability to adjust step size and maximum simulation speed
  • Command Line Interface
    • Fix simulation command
Documentation: https://jedlimlx.github.io/Cellular-Automaton-Viewer
Wiki: https://jedlimlx.github.io/Cellular-Aut ... /Home.html

Precompiled Binaries: https://github.com/jedlimlx/Cellular-Au ... r/releases


Answering here to avoid cluttering the Symbosis Thread
Yoel wrote:
Yesterday, 3:30 am
lemon41625 wrote:
Yesterday, 12:51 am
Yoel wrote:
Yesterday, 12:42 am
BTW, did anyone try to write extensions to CAViewer in Clojure? I like Lispy syntax, PERL and functional style. Also a matter of personal opinion, of course. :)
I'm afraid that that isn't possible at least in terms of trying to get native support since CAViewer uses Java to define new rulespaces. Find the documentation on how to do it here: https://jedlimlx.github.io/Cellular-Aut ... iewer.html

Nevertheless, you could use an external ruletable generation program once CAViewer supports ruletables (ruletables aren't supported at the moment).
Standard Clojure runs on JVM and is meant to be fully mixable with Java, very much like Scala, but with Lispy syntax and interactivity. It natively supports the entire Java API. Compiled Clojure code is just Java jars. There are dialects of Clojure for Javascript VM and .NET, but I never used them and I don't know much about them. Most likely, there are incompatible with each other, besides some basic functionality.

BTW, there is also an implementation of Common Lisp for Java called Armed Bear Common Lisp (ABCL). It also produces Java jars for integration within Java code, enables the entire Java API inside Lisp (in somewhat ugly way though), inclusion of Java code inside Lisp etc. However, it's slow and it deviates from mainstream Lisps on unexpected subtle levels. People usually use it for functional style of scripting to put pieces of Java code together. Clojure, on the other hand, is only marginally slower than regular Java (like Scala).

ABCL is totally OK for turning my ruletable generator into a Java class, but not suitable for CAs (way too slow for that kind of things).
Then, it should be possible as long as Clojure can do stuff like call Java methods and extend Java classes and implement Java interfaces.
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...

Post Reply