Collects empirical data for our CA fitness program. More...
#include <stdio.h>
#include <stdlib.h>
#include "cellularAutomata.h"
Go to the source code of this file.
Data Structures | |
struct | SimResult |
Represents the result of a simulation on a CA, with respect to majority classification. More... | |
Defines | |
#define | MAX_CA_ITERATIONS 200 |
The number of iterations that the rule has to classify the CA, no more. | |
Functions | |
void | simulate (CA *curr, CA *next, int rule[], SimResult *result) |
Runs through all the iterations of the CA, cutting off the evaluation at MAX_CA_ITERATIONS if the simulation runs too long. | |
void | usage () |
Explains how to use this program. | |
void | correctClassification (int argc, char **argv) |
Determines both the frequency with which a rule set correctly classifies as a function of the percentage of ones in a CA and the average number of iterations that correct classifications requires. | |
int | main (int argc, char **argv) |
Basically calls the correct sub-function, based on the first argument, which indicates what empirical data to collect. |
Collects empirical data for our CA fitness program.
Definition in file empiridata.c.
#define MAX_CA_ITERATIONS 200 |
The number of iterations that the rule has to classify the CA, no more.
Definition at line 15 of file empiridata.c.
void correctClassification | ( | int | argc, | |
char ** | argv | |||
) |
Determines both the frequency with which a rule set correctly classifies as a function of the percentage of ones in a CA and the average number of iterations that correct classifications requires.
argc | The number of arguments passed to the program. | |
argv | The arguments passed to the program. |
Definition at line 73 of file empiridata.c.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Basically calls the correct sub-function, based on the first argument, which indicates what empirical data to collect.
Although this is kind of stupid considering we only collect one kind of data set.
argc | The number of arguments passed to the program. | |
argv | The arguments passed to the program. |
Definition at line 45 of file empiridata.c.
Runs through all the iterations of the CA, cutting off the evaluation at MAX_CA_ITERATIONS if the simulation runs too long.
The values of a SimResult are calculated along the way.
curr | The initial state of the CA. | |
next | Just a already memory allocated CA that is used in the transition function from one CA iteration to the next. | |
rule | The rule being evaluated. | |
result | The struct that will be set with the information regarding the number of steps that it took to classify the CA and also whether or not the CA was correctly classified. |
Definition at line 133 of file empiridata.c.
void usage | ( | ) |
Explains how to use this program.
Definition at line 152 of file empiridata.c.