jedlimlx / Cellular-Automaton-Viewer

A Cellular Automaton Simulator written in Kotlin / Java

Home Page:https://jedlimlx.github.io/Cellular-Automaton-Viewer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CAViewer Release badge Build CAViewer Test CAViewer

See python branch for CAViewer v1.

Installation

CAViewer v2 is written in Kotlin / Java.
You will need the Java Runtime Environment / Java Development Kit to run the *.jar file.

If you can't use Java, download the precompiled binaries here.
On Linux and Mac, the binary may not be exectuable by default so run chmod +x CAViewer. This requires a github account.

Alternatively, get the binaries here.

Note that this *.jar runs on the Java Runtime Environment / Java Development Kit 11 and above.

See the wiki for instructions on how to build the application from source and how to modify it.

What is this?

CAViewer is a cellular automaton simulation program written in Java
It aims to support rulespaces unsupported by other CA simulation programs such as Golly and LifeViewer.

The GUI

The GUI is made with JavaFX & Scene Builder.

The Menu Bar

File Menu:
New Pattern - Creates a new pattern
Open Pattern - Opens a pattern file
Save Pattern - Saves the pattern to a file
New Rule - Opens the rule dialog to make a new rule
Set Rule Directory - Sets the directory for CAViewer to look for rules
Close - Closes the application

Edit Menu:
Copy - Copies selected cells to an RLE
Paste - Pastes the cells that are stored as an RLE on the clipboard
Delete - Deletes the selected cells
Random Soup Settings - Settings for the random soup generation

View Menu:
Adjust Colours - Adjusts the colours of the current rule
Grid Lines - Toggles between showing and not showing grid lines
View Population Graph - Displays a graph of the population against generation

Control Menu:
Set Generation - Sets the generation based on user input
Set Step Size - Sets the step size of the simulation
Set Simulation Speed - Sets the maximum simulation speed
Clear Cell Cache - Clears the cell cache to speed up the simulation (application may hang for a while)

Search Menu:
Generate Apgtable - Generates an apgtable to be used with apgsearch
Run Rule Search - Starts a search program that randomly enumerates rules to find spaceships & oscillators
Run Agar Search - Starts a search program that searches for agars
Run Catalyst Search - Starts a search program that searches for catalysts
Run Brute Force Search - Starts a brute force search program similiar to gsearch

Help Menu:
About - Opens the CAViewer Wiki in a built-in browser.
Rule Info - Provides information about the currently loaded rule.

The Tools Bar

Run Simulation Button - Runs the simulation
Simulate in Selection Button - Runs the simulation in the selection
Simulate outside Selection Button - Runs the simulation outside the selection
Drawing Button - Go into drawing mode
Panning Button - Go into panning mode
Selection Button - Go into selection mode

Random Soup Button - Generates a random soup
Flip Button - Flips the pattern horizontally / vertically
Rotate Button - Rotates the pattern clockwise / counter-clockwise
Increase / Decrease Step Size Button - Increases / decreases the step size
Recording Button - Records all patterns that move in the selection area and saves it as a *.gif
Identify Button - Identifies the pattern as a spaceship / oscillator

The Status Bar

The generation of the pattern, the current population and simulation speed is shown.

Keyboard Shortcuts

Space - Step 1 Generation
Delete - Deletes cells

Enter - Toggle Simulation
Shift + Enter - Toggle Simulation (In Selection)
Ctrl + Enter - Toggle Simulation (Outside Selection)

Ctrl + N - New Pattern
Ctrl + O - Open Pattern
Ctrl + S - Save Pattern to File

Ctrl + C - Copy Pattern to RLE
Ctrl + X - Cut Pattern (Copy + Delete)
Ctrl + V - Paste Pattern (requires that an area is already selected)
Ctrl + Shift + O - Load Pattern from Clipboard

Ctrl + A - Select the entire pattern
Ctrl + Z - Undo
Ctrl + Y - Redo

Ctrl + R - Change Rule
Ctrl + 5 - Generate Random Soup

X - Flip Selection Horizontally
Y - Flip Selection Vertically
> - Rotate Clockwise
< - Rotate Counter-Clockwise

GUI TODO List

  • Add tooltips
  • Add menu buttons for delete, paste, copy and cut cells
  • Add menu button for new pattern
  • Add menu button to open rules & patterns
  • Add menu button to save patterns
  • Add button to view search results and save to a file
  • Add grid lines
  • Add help information to the about button
  • Add more information to the status bar
  • Add dialog to ask "Would you like to save changes to untitled"
  • Custom key binds

Editing Features

  • Drawing Cells
  • Selecting Cells
  • Delete Cells
  • Copy Cells to RLE
  • Flip Horizontally / Vertically
  • Rotate Clockwise / Counter-Clockwise
  • Pasting Cells from RLE
  • Undo
  • Select All
  • More Random Soup Symmetries
  • Simulate in selection
  • Simulate outside selection
  • Reset Pattern to Generation 0
  • Nudging up / down / left / right
  • Invert Cells

Supported / Planned Rulespaces

  • Higher Range Outer Totalistic (HROT)
    • 2 State HROT
      • B0 rules
      • Weighted rules
      • Apgtable Generation for B0 rules
      • Apgtable Generation for non-B0 rules
      • Apgtable Generation for weighted rules
    • HROT BSFKL
      • B0, F0 rules
      • Neighbourhood Weights
      • Apgtable Generation for all rules
    • HROT Generations
      • B0 Rules
      • State Weights
      • Neighbourhood Weights
      • Apgtable Generation for B0 rules
      • Apgtable Generation for non-B0 rules
      • Apgtable Generation for rules with neighbourhood weights
      • Apgtable Generation for rules with both state weights & neighbourhood weights
    • HROT Extended Generations
      • B0 Rules
      • Neighbourhood Weights
      • Apgtable Generation for all rules
    • HROT Regenerating Generations
      • B0 Rules
      • Neighbourhood Weights
      • Apgtable Generation for all rules
    • 3-state HROT
      • B0 Rules
      • Weighted Rules
      • Apgtable Generation for all rules
    • Integer HROT
      • Weighted Rules
      • Apgtable Generation for all rules
    • Deficient HROT
      • B0 Rules
      • Weighted Rules
      • Apgtable Generation for all rules
    • Multi-state Cyclic HROT
      • Weighted Rules
      • Apgtable Generation for all rules
  • Isotropic Non-Totalistic (INT)
    • 2 State INT
      • B0 Rules
      • Apgtable Generation
    • INT BSFKL
    • INT Generations
      • B0 Rules
      • Apgtable Generation
    • INT Extended Generations
    • INT Regenerating Generations
    • 3-state INT
    • Deficient INT
      • B0 Rules
      • Apgtable Generation
  • Magma's Notation
  • Primodia
  • Naive Rules
    • Orthogonal Reading Order (O)
    • Diagonal Reading Order (D)
    • Snake Reading Order (SN)
    • Spiral Reading Order (SP)
    • Custom Reading Orders
  • Alternating Rules
    • Strobing Rules
    • Apgtable Generation
  • Second Order Rules
  • Multiple Neighbourhoods Cellular Automaton (MNCA)
  • MCell Cyclic CA
  • Langton's Ant / Turmites
    • Von Neumann Turmites
    • Hexagonal Turmites
    • Moore Turmites
    • Triangular Turmites
    • Splitting Turmites
  • Margolus
    • Basic 2x2 2-state rules
    • Alternating Margolus rules
    • Naive Margolus
    • Multi-state
    • Higher range
  • 1D CA
  • Euclidean CA
    • Euclidean Distance
    • Manhattan Distance
    • Accurate Floating-point Summation
  • [R]History
    • 2-state HROT
    • HROT Generations
    • 2-state INT
    • INT Generations
  • [R]Symbiosis
    • 2-state HROT
    • HROT Generations
    • 2-state INT
    • INT Generations
  • [R]DeadlyEnemies
    • 2-state HROT
    • HROT Generations
    • 2-state INT
    • INT Generations
  • [R]Energetic
    • 2-state HROT
    • HROT Generations
    • 2-state INT
    • INT Generations
  • Custom Rules (*.rule)
    • Golly Ruletables
      • Basic Functionality
      • Unbounded Variables
      • Arbitary Neighbourhoods
      • B0 Rules
      • Block CA
      • Nutshell-like Syntax
    • Golly Ruletrees
      • Basic Functionality
      • Arbitary Neighbourhoods
      • B0 Rules
    • Square Cell Ruletables
      • Basic Functionality
      • Arbitary Neighbourhoods
      • B0 Rules

Supported / Planned INT Neighbourhoods

  • Range 1 Moore Isotropic Non-Totalistic (M)
  • Range 1 Hexagonal Isotropic Non-Totalistic (H)
  • Range 2 Von Neumann Isotropic Non-Totalistic (V2)
  • Range 2 Checkerboard Isotropic Non-Totalistic (B2)
  • Range 2 Far Corners Isotropic Non-Totalistic (FC)
  • Range 2 Knight Life Isotropic Non-Totalistic (K)
  • Range 2 Cross Isotropic Non-Totalistic (C2)
  • Range 3 Cross Isotropic Non-Totalistic (C3)
  • Range 3 Far Edges Isotropic Non-Totalistic (FE)

Supported / Planned Named HROT Neighbourhoods

  • Asterisk (A)
  • Checkerboard (B)
  • Aligned Checkerboard (b)
  • Circular (C)
  • Triangular Neighbourhood on Triangular Grid (D)
  • Gaussian Weighted Neighbourhood (G)
  • Hexagonal (H)
  • Triangular Moore (L)
  • Moore (M)
  • Von Neumann (N)
  • Triangular Neighbourhood on Hexagonal Grid (T)
  • Saltire (X)
  • Euclidean (2)
  • Tripod (3)
  • Hexagram (6)
  • Star (*)
  • Cross (+)
  • Hash (#)
  • CoordCA Format (Custom Neighbourhoods @)
  • LifeViewer Format (Weighted Neighbourhoods W)
  • LifeViewer Format (State Weights W)

Search Programs

  • Rule Search Program
    • More high tech repetition detection function
    • Identification for linear growth patterns, replicators
    • Fine tune RNG function manually
    • Fine tune RNG function via genetic algorithms?
    • Object separation?
  • Agar Search Program
    • Better repetition detection
    • Better wave detection
  • Catalyst Search Program
    • Mutiple catalysts
    • Brute force option
    • Symmetries
    • Repetition detection
  • Brute Force / Soup Search Program
    • Object separation
    • Symmetries
    • Finish Documentation
  • Ship / Oscillator Search Program
    • Rules
      • 2-state rules
      • Multi-state rules
      • Higher-range rules
      • Strobing / Alternating Rules
      • Naive rules
      • Margolus rules
    • Symmetries
      • Asymmetric
      • Odd-symmetric
      • Even-symmetric
      • Gutter-symmetric
      • Glide-symmetric
    • Speeds
      • gcd(k, p) > 1
      • kc/p > c/2
      • Superluminal
      • Oscillators
      • Puffers
      • Diagonal ships
      • Oblique ships
    • Optimisations
      • Lookahead
      • Double-lookahead
      • Repeating-component detection
    • Writing to dump files
    • Multi-threading
    • Inputting partials
    • Sideways searching
    • Adaptive widening
  • Methuselah Search Program

Long-term TODO List

  • Custom search programs
  • Move stuff to the wiki
  • Triangular Rules
  • Command Line Interface
    • Simulation
    • Identification
    • Search Programs
    • Apgtable Generation
    • Random Soup / Symmetries Generation
  • Add Unit Tests
    • Write the first one
    • Rule Families
    • Identification
    • Simulator
    • Pattern Manipulation
    • GUI
  • Bounded Grids
    • Bounded
    • Torus
    • Klein Bottle & Cross Surface
    • Spherical
  • Hexagonal Rendering
  • Triangular Rendering
  • Accept some LifeViewer commands like STEP & RANDOMISE
  • Scripting in Python via Jython?
  • Implement a faster algorithm (QuickLife, HashLife...)

Known Bugs

  • RLEs are pasted rotated (Fixed)
  • Open pattern is bugged (Fixed)
  • HROT B0 isn't working as intended (Fixed)
  • Keyboard shortcuts only work when the ScrollPane is in focus (Fixed)
  • Rule Dialog don't show the most updated rule (Fixed)
  • ConcurrentModificationException is thrown (Fixed)
  • Step with space causes some cells to be rendered incorrectly (Fixed)
  • Viewport doesn't move the center when a new pattern is loaded

About

A Cellular Automaton Simulator written in Kotlin / Java

https://jedlimlx.github.io/Cellular-Automaton-Viewer/


Languages

Language:Java 63.4%Language:Kotlin 36.6%Language:CSS 0.0%