Skip to content

Commit

Permalink
Added new section, languages improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jmiszczak committed May 24, 2023
1 parent 2325c1f commit e57f199
Showing 1 changed file with 55 additions and 15 deletions.
70 changes: 55 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,32 @@ Implementation of the Game of Life with rule switching.
This repo contains model and scripts used to run numerical experiments for Game
of Life with rule switching mechanisms.

## Reproducing data
# Reproducing data

Scripts in this repo can be used to reproduce data ilustrattgin the behaviur of
Scripts in this repo can be used to reproduce data illustrating the behaviour of
the Game of Live cellular automata extended with the mechanisms for rule
switching. Additionally, the model can be used in asynchronouse and synhronouse
switching. Additionally, the model can be used in asynchronous and synchronous
mode.

Compilation and code runing is controlled by file `Makefile` in the main
directory. This file should be modified to suit our NetLogo installation.
In the provided `Makefile` it is assumes that NetLogo is installed in
Code compilation and runing is controlled by file `Makefile` in the main
directory. This file should be modified to suit our NetLogo installation. In
the provided `Makefile` it is assumes that NetLogo is installed in

~/Local/NetLogo/3.0.0

directory. It is also assumed that `java` and `javac` are in you PATH.
directory. It is also assumed that `java` and `javac` are in you `PATH`
environment variable.

`Makefile` also uses GNU pararell for running Java programmes.

### Fianl configurations
## Final configurations

Sample configurations are produced using `GenerateExample.java` script. To
compile this file run

make

in the main directory. This will also compile `CalculateMeanLiving.java`.
in the main directory. This will also compile `CalculateMeanLiving.java` and `GenerateConfigurations.java`.

Examples are generated by issuing

Expand All @@ -53,7 +54,7 @@ To plot all data from the generated examples run

**Note:** Plots are saved in `plots` subdirectory.

### Realizations
## Realizations

Exlemplary realizations can be obtained by using `run.sh` script and
`experiments.xml` file. For each experiment defined in `experiments.xml` file,
Expand All @@ -79,17 +80,56 @@ To plot data from the realizations run

**Note:** Configure name of the data files in the plotting script.

### Average growth
## Average growth

Data for the average number of living cells are calculate by
`CalculateMeanLiving.java` and can be obtained by running

Date for the average number of living cells are calculate by `CalculateMeanLiving.java` and can be obtained by running

make calcmean

You need to compile `CalculateMeanLiving.java` first

**Note:** BY default, 200 realizations are used fo averaging. This value can be
modified in `CalculateMeanLiving.java` file by altering `steps` variable.

Ploting of the data is handled by `plot_living_average.py`, which accepts one argument with name of the data file.
Ploting of the data is handled by `plot_living_average.py`, which accepts one
argument with name of the data file.

**Note:** Data from this experiment are saved in
*`living_data_250steps_200runs.csv` file. This file is included in the
*repository. The name of the file used to save data should be configured in
*`Makefile` and in the plotting script `plot_living_average.py`.

## Mutual entropy

For the purposa of analysing the mutula entropy of the generated patters it is
necessary to generate a number of final configurations. This data are generate
using `genfc` target in the Makefile,

make gencf

You nee to compile `GenerateConfigurations.java` prior to running this command.

Resultsing `csv` files in `configurations` subdirectory. For each combination of
parameters 1000 files representing final configuraitons are generated. The names
of the resulting configurations can be saved in a shhell variable using

golTypes=$(for i in *_0001.csv ; do echo `echo $i | sed s/_0001.csv//g` ; done)

in the `configurations` directory.

The calculation of the average mutula entropy is implemented in
`analyze_mutent.py` script. Using GNU parallel the analysis rsults can be
obtained by running

parallel ./analyze.py {} ::: $golTypes

in `configurations` subdirectory.

This will result in one `*.dat` file for each combination of parameters. To
obtain the file with all data run

bash postprocess_dat.sh

**Note:** Data from this experiment are saved in `living_data_250steps_200runs.csv` file. This should be configures in `Makefile` and in the plotting script `plot_living_average.py`.
script. This will produce `anayze_mutent.csv`, used by the plotting script
`plot_mutual_entropy.py` located in the main directory.

0 comments on commit e57f199

Please sign in to comment.