Giter VIP home page Giter VIP logo

cas's Introduction

CAS - Cellular Automata Simulator

Build Status Latest Quality Gate Status Maintainability Rating Lines of Code

The Cellular Automata Simulator (CAS) is a project of didactic and scientific purposes, based on the publications of Stephen Wolfram and other great authors like Andrew Ilachinski, Harold V. McIntosh, Joel L. Schiff; also inspired by the ideas of Stanislaw Ulam and John von Neumann. See the full reference on page 65 of the monograph.

The project assists in the study of cellular automata by providing a simple platform that allows for practical experience of the theoretical concepts.

Download

Download the latest release here. You can also check out all previous releases here.

Before using CAS, please consider reading this page from Wolfram Research to ensure the basic understanding of Elementary Cellular Automaton. The monograph is also available in brazilian portuguese here.

CAS is distributed under the GNU Affero General Public Licence v3.0 (AGPLv3) and is compatible with Mac, Linux and Windows.

Structure

CAS is currently organized in 5 modules: cas-core, cas-control, cas-unidimensional, cas-ui-desktop and cas-docs. The table below contains a summary of each one of the modules:

Module name Description
cas-core Abstract structures that represent the common characteristics of most cellular automata, independent of the amount of dimensions.
cas-control Abstract resources for controlling the simulation lifecycle.
cas-unidimensional One-dimensional implementation of the cas-core and cas-control modules, responsible for defining specific characteristics and controlling the simulation of one-dimensional cellular automata.
cas-docs Documentation.

Core overview

Originally conceived to simulate elementary cellular automaton, CAS was designed to allow for the implementation of most kinds of cellular automata, independent of the amount of cells, dimensions, iterations, rules, etc.

The data model in cas-core abstracts common characteristics of cellular automata, forming a fundamental structure to simulate any cellular automaton. The set diagram below shows the composition between the elements of the data model, suppressing cardinality.

The image below highlights some of the elements of the data model through a elementary cellular automaton by using the representation commonly found in literature. In the image below you can find Rule (A), Transition (B), Combination (C), State (D), Space (E) and Cell (F).

From all elements of the data model, Time, Space and CellularAutomaton are the most important. More information about each one of these elements is detailed below.

Time

The number of dimensions used by the cellular automaton affects not only the cellular Space but also Time. This feature is oriented to the sequential nature of the simulator, which updates the Space and Time in an atomic operation until the end of the simulation.

To allow for Time to operate in a dimensional way, two approaches were created: absolute time and relative time. The absolute time is responsible for maintaining the amount of Space iterations already processed by the CellularAutomaton and is represented by an integer. The relative time informs the next Cell to be processed within the current iteration and is represented by a list of integers, where the number of elements in the list is equal to the number of dimensions of the CellularAutomaton.

The Time class is a dynamic counter incremented from its lower limit (zero) acting on each of the dimensions (relative time) until it completely processes a Space iteration (absolute time), repeating this cycle until it reaches the limits of Time.

Time increases its counters during a simulation in a mathematical ratio equivalent to the product of the limits of the relative counters multiplied by the limit of the absolute counter, minus one. This formula is shown in the image below, where a represents the absolute counter,d represents the amount of relative counters (or amount of dimensions), ri represents a relative counter i and lim is the function that obtains the limit of each counter.

Space

The Space class is a dynamic array responsible for keeping all Cells from the initial condition defined for the simulation (initial attribute), the history of the iterations already processed (history attribute), the last iteration processed (last attribute) and the iteration that is being processed (current attribute). The initial, last and current attributes are lists of generic type in order to allow multidimensional structures, whereas the history attribute is a list of lists, since history stores copies of current. The image below shows a representation of the attributes initial (A), history (B), last (C) and current (D) through the computation of elementary rule 110.

CellularAutomaton

The CellularAutomaton class is the conceptual representation of the cellular automaton used in the simulation. The logic of this class uses other classes like Rule, Transition, Combination and State. The algorithm executed by the CellularAutomaton is:

The amount of times that the algorithm of the CellularAutomaton is executed can be represented by a mathematical ratio similar to Time increasement formula, except that for the CellularAutomaton algorithm execution formula there is no subtraction of 1, as shown by the image below.

Contribute

There is a lot to be improved and created. Check the list of issues and all projects to see what's happening, maybe including your suggestions or bugs found. If you feel inspired by one of the issues/projects or by CAS itself, feel free to make contact through .

cas's People

Contributors

dependabot[bot] avatar ghjansen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cas's Issues

Support for initial conditions based on the fibonacci sequence

Maybe would be wise to wait for project Interface lift to develop this issue.

The pattern can be distributed through sequences coloured cells with the size of the next number on the fibonacci sequence, or the other way around - coloured cells are separated by sequences of quiescent cells in the sizes of the fibonacci sequence.

Support for advanced options during Export

When exporting the simulation as an image, support the following options:

  1. Cell scale: square root of the amount of pixels representing 1 cell (Type: Integer)
  2. Show grid lines: configuration for inclusion or exclusion of the lines of the grid of cells (Type: Boolean)
  3. Grid lines thickness: the amount of pixels to be used as grid line thickness (Type: Integer)
  4. Grid lines colour: the colour of the lines of the grid of cells (Type: String)

Research about SWING/AWT/Processing replacement

CAS is currently mixing SWING/AWT with 2 Processing applets, which doesn't seems really good.

SWING/AWT was used to avoid the time required to draw GUI control components using Processing, but the idea of having the entire GUI using Processing only is great! There are Processing GUI libraries out there like ControlP5 that require some investigation to conclude if their components support all CAS needs (window resizing, fullscreen, scrolls, buttons, fields, etc..).

The use of 2 Processing applets (one for the rule configuration and the other for the simulation view) seems to cause an excessive resource consumption that could be avoided by using a single Processing instance (with or without SWING/AWT). Also, it is important to use latest Processing. If the entire GUI could not be migrated to a single Processing instance somehow, then different technologies should be considered.

If no technology could be found to handle the job, maybe it should be considered to keep using SWING/AWT but along with JOGL.

Allow full screen mode

This issue should consider conclusions reached on issues #5 and #6.
The simulation view area should always handle the resizing, other components like configuration can stay at a static size.

Provide set of *.png files

Create a set of *.png files, each dedicated to the configuration of one elementary rule, covering all the 256 elementary rules.

(related to #23 )

Allow window resizing

This issue should consider conclusions reached on issues #5 and #6.
The simulation view area should always handle the resizing, other components like configuration can stay at a static size.

Find a way to compare the Time from Universe with the Time from Space

Time is used in the constructors of both Space and Universe.
Space uses Time in its constructor to validate the amount of dimensions across them, but don't keep Time as attribute.
Universe, however, only keeps Time as attribute.
The instance of Time informed in the constructors of both Space and Universe must be the exact same, therefore, a validation must take place to match them somehow.

Support for neighborhood configuration

The neighborhood configuration should allow to choose a specific set of neighbors for a given amount of dimensions.

e.g one-dimensional cellular automata can set the range of neighbors used at the sides of the reference cell, while two-dimensional cellular automata should decide between Moore neighborhood and von Neuman neighborhood.

Provide set of *.cas files

Create a set of *.cas files, each dedicated to the configuration of one rule, covering all the 256 elementary rules.

Prototype a new GUI

This issue should consider the conclusions achieved on #5.
Here is a proposal for a new GUI:

cas-gui

The three components on top of the window should act as tabs, switching everything that is displayed in other components. This way, each tab acts independent from the others, so the user can simulate three cellular automata (one per tab) and see each one of them by navigating through the tabs.

Left corner keeps all configurations grouped by domain (similar to how it is today). Each option shows a panel on the right side that provides a good amount of space to interact with components. This panel can have a scrollbar if the amount of components is too big. The user can show/hide this panel at any time by clicking in the configuration options. The visualization of each configuration option is mutually excludent.

Right corner holds the tools to analyze the result of a simulation, same as it is today.

Bottom of the window contains the flow controls of the simulation (play complete, by step, discard/new, etc.)

All the white area of the window can be used to render the result of the simulation. This way, the window can be resized or enter fullscreen mode and all components can still be oriented to the window corners.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.