|
Cellular Automata CHEM274B Group Project
Contributor(s): Chongye Feng, Emmanuel Cortes, Trevor Oldham
|
The repository contains a general-purpose library for create cellular automata models. The cellular automata cell states can be ints or class/struct types. See CAdatatypes.h for information on the class/struct requirements. The general-purpose library also supports parallelization with the aid of OpenMP. A log file with the cellular states for each step is located in Data/data.csv. The log file can be utilized by a plotting Python module for visualizing the cellular automata.
Provided in this repository is an example model that simulates the formation of galaxies using GalaxyCell class instances as the cell type. Once the model is compiled (see below for information), you will find an executable called galaxy_app (sequential) or optionally galaxy_app_omp (parallel). To run the model from root project directory run: Bindir/galaxy_model.
Requirements for compilation:
g++makeOpenMP (parallelized code)Requirements for plotting:
matplotlibmpl_toolkitsnumpyTo compile the sequential implementation, run:
make sequential.To compile the parallel implementation, run:
make parallel.To compile both, run:
make all.To clean all object files and executables, run:
make cleanall.*util.h files in the Include directoryint data type. Added utility functions to CAutils.h that are general and will useful for our galaxy model. Add unit tests for CA_utils.cpp.galaxydatatypes.h, galaxy.cpp, and an application that runs our model galaxy_app.cpp using user input. Modified makefiles based on Trevor's input so targets compile for MasOS systems and can handle other edge cases. Updated doc.create_log, append_log to CellularAutomata class. Added Utils/plotting.py for plotting CellularAutomata data. Added get_density function to CAutils.h and its implementation to CA_utils.cpp.galaxy_formation_rule for computing the gravitational force and updating the cellular position using the equations of motion.