123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- # pragma once
- // only for glib stuff so fix me... (gint, g boolean)
- // make it only need glib could be better
- #include <gtk/gtk.h>
- #include "mt64.h" // Pseudo Random Number Generation 64bit MT Lib
- #include <math.h> // math to transform random n from continuos to discrete
- #include <time.h> // time library to initialize random generator with time seed
- // Lattice size // 2D Latice of 256 x 256 sites
- #define X_SIZE 256
- #define Y_SIZE 256
- // Default mortality value
- #define MORTALITY 0.58
- // Simulation data (state - parameters)
- struct simulation
- {
- // Latice configuration
- int lattice_configuration[X_SIZE][Y_SIZE];
- gint run; // time handler tag
- gboolean running; // Are we running?
- gboolean initialized; // Have we been initialized?
- int generation_time; // generations simulated
- double occupancy; // lattice occupancy
- float dead_rate; // particle mortality
- };
- // Define a new data type
- typedef struct simulation IPSmodel;
- // Prepare default parameters and Random number generator
- void prepare_IPS(IPSmodel *s);
- // Initialize the lattice
- void initialize_IPS(IPSmodel *s);
- // Update the lattice (Monte Carlo)
- void update_IPS(IPSmodel *s);
- // Some simulation Ctrl callbacks
- void show_about(GtkWidget *widget, gpointer data);
|