This project implements a serial Abelian Sandpile simulation in Java, organized with a Makefile to facilitate compiling and running the program.
- Source Directory:
src/serialAbelianSandpile
- Binary Directory:
bin/serialAbelianSandpile
The Makefile automates the compilation of .java
source files located in the src/serialAbelianSandpile
directory, storing the resulting .class
files in the bin/serialAbelianSandpile
directory.
- AbelianSandpileThread.java: Defines threads used in the simulation.
- AutomatonSimulation.java: The main class, which initiates and runs the sandpile simulation.
- Grid.java: Manages the grid data structure and operations for the simulation.
- Java Development Kit (JDK)
- A command-line interface (CLI) such as Terminal or Command Prompt.
To compile the project, navigate to the directory containing the Makefile and run:
make
This command will:
- Create the
bin/serialAbelianSandpile
directory if it doesn't exist. - Compile all
.java
files in thesrc/serialAbelianSandpile
directory, storing the.class
files inbin/serialAbelianSandpile
.
Once compiled, you can run the simulation with:
make run
This will execute the main class, serialAbelianSandpile.AutomatonSimulation
, with default arguments specified in the Makefile:
- Input:
input/2000_by_2000_All_1.csv
- Output:
output/c.png
To override the default input and output files, specify ARGS
:
make run ARGS="path/to/input.csv path/to/output.png"
To remove all compiled files, run:
make clean
- Changing Arguments: Update the
ARGS
variable in the Makefile to specify different default input/output files if needed.
This project is licensed under the MIT License.