Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Readme images alignment fix.
  • Loading branch information
ghjansen committed Aug 15, 2019
1 parent 6cf841c commit 3a472fc
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ The Cellular Automata Simulator (CAS) is a project of didactic and scientific pu

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

<div style="text-align:center"><img src="cas-docs/demo/casdemo.gif" /></div>
<p align="center">
<img src="cas-docs/demo/casdemo.gif" />
</p>

## Download
Download the [latest release here](https://github.com/ghjansen/cas/releases/latest). You can also check out [all previous releases here](https://github.com/ghjansen/cas/releases).
Expand All @@ -31,11 +33,15 @@ Originally conceived to simulate [elementary cellular automaton](http://mathworl

The data model in [`cas-core`](/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.

<div style="text-align:center"><img src="cas-docs/diagrams/cas-core-datamodel.png" /></div>
<p align="center">
<img src="cas-docs/diagrams/cas-core-datamodel.png" />
</p>

The image below highlights some of the elements of the data model through a [elementary cellular automaton](http://mathworld.wolfram.com/ElementaryCellularAutomaton.html) by using the representation commonly found in literature. In the image below you can find [`Rule`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Rule.java) (A), [`Transition`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Transition.java) (B), [`Combination`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Combination.java) (C), [`State`](cas-core/src/main/java/com/ghjansen/cas/core/ca/State.java) (D), [`Space`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Space.java) (E) and [`Cell`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Cell.java) (F).

<div style="text-align:center"><img src="cas-docs/diagrams/cas-core-datamodel-representation.png" /></div>
<p align="center">
<img src="cas-docs/diagrams/cas-core-datamodel-representation.png" />
</p>

From all elements of the data model, [`Time`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Time.java), [`Space`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Space.java) and [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/CellularAutomaton.java) are the most important. More information about each one of these elements is detailed below.

Expand All @@ -48,12 +54,16 @@ The [`Time`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Time.java) cla

[`Time`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Time.java) 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.

<div style="text-align:center"><img src="cas-docs/formulas/time-increasement.png" /></div>
<p align="center">
<img src="cas-docs/formulas/time-increasement.png" />
</p>

### Space
The [`Space`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Space.java) class is a dynamic array responsible for keeping all [`Cell`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Cell.java)s 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.

<div style="text-align:center"><img src="cas-docs/diagrams/cas-core-space-representation.png" /></div>
<p align="center">
<img src="cas-docs/diagrams/cas-core-space-representation.png" />
</p>

### CellularAutomaton
The [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/CellularAutomaton.java) class is the conceptual representation of the cellular automaton used in the simulation. The logic of this class uses other classes like [`Rule`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Rule.java), [`Transition`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Transition.java), [`Combination`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Combination.java) and [`State`](cas-core/src/main/java/com/ghjansen/cas/core/ca/State.java). The algorithm executed by the [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/CellularAutomaton.java) is:
Expand All @@ -64,7 +74,9 @@ The [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/Cellul

The amount of times that the algorithm of the [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/CellularAutomaton.java) is executed can be represented by a mathematical ratio similar to [`Time`](cas-core/src/main/java/com/ghjansen/cas/core/physics/Time.java) increasement formula, except that for the [`CellularAutomaton`](cas-core/src/main/java/com/ghjansen/cas/core/ca/CellularAutomaton.java) algorithm execution formula there is no subtraction of 1, as shown by the image below.

<div style="text-align:center"><img src="cas-docs/formulas/rule-execution.png" /></div>
<p align="center">
<img src="cas-docs/formulas/rule-execution.png" />
</p>

## Contribute
There is a lot to be improved and created. Check [the list of issues](https://github.com/ghjansen/cas/issues) and [all projects](https://github.com/ghjansen/cas/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-docs/text/contact.png).

0 comments on commit 3a472fc

Please sign in to comment.