This course has covered:
numpy
for numerical work in PythonAdapt your one-dimensional cellular automaton code to follow a new set of rules. For each cell, look at the cells to its left and right and:
0
;1
.Run a simulation for an array of size 100, for 50 time steps. The initial value of the array should be all 0
s, except a single 1
at index 50.
Put the code which runs the simulation in a Python script called run_simulation.py
and run it on the command line. This script should save its results to a numpy output file.
Put the code which visualises the results into a Jupyter Notebook which should read the numpy file and create some graphs or images.
See what happens if instead of starting with a single value of 1
, you instead initialise your array randomly.
Note: this automaton has a name: "Rule 90". It's one of a class of automata called elementary cellular automata.
This course was written by Matt Williams. All text is published under a Creative Commons Attribution 4.0 International License with all code snippets licensed as MIT.
The source for the material can be found on GitLab where fixes are welcome.