Cellular Automata CHEM274B Group Project
Contributor(s): Chongye Feng, Emmanuel Cortes, Trevor Oldham
Loading...
Searching...
No Matches
Functions
test_CA.cpp File Reference

this file creates a new CA object and tests the basic functionality to prove correctness More...

#include "CAdatatypes.h"
#include <iostream>
#include <array>

Functions

void custom_rule (int *cell_index, const int index_size, int *neighborhood_cells, const int neighborhood_size, int &new_cell_state)
 Test custom rule function for setting a new cell state for the cell at cell_index. More...
 
void test_CA_init (CellularAutomata< int > &CA)
 Tests the initialization of CellularAutomata instances. More...
 
void test_CA_step (CellularAutomata< int > &CA)
 Tests the CellularAutomata instances's step function. More...
 
void test_CA (CellularAutomata< int > &CA)
 Main testing function that calls all other types of tests. More...
 
void test_CA_vector ()
 Tests the implementation of the CA with vector of cells. More...
 
void test_CA_matrix ()
 Tests the implementation of the CA with a matrix of cells. More...
 
void test_CA_tensor ()
 Tests the implementation of the CA with a tensor of cells. More...
 
int main ()
 

Detailed Description

this file creates a new CA object and tests the basic functionality to prove correctness

Author
Trevor Oldham (trevo.nosp@m.ldha.nosp@m.m@ber.nosp@m.kele.nosp@m.y.edu)

Contributor(s)
   Emmanuel Cortes

Date
2022-12-03

Function Documentation

◆ custom_rule()

void custom_rule ( int *  cell_index,
const int  index_size,
int *  neighborhood_cells,
const int  neighborhood_size,
int &  new_cell_state 
)

Test custom rule function for setting a new cell state for the cell at cell_index.

Parameters
cell_indexarray of cell indices that we are going to update it state for
index_sizenumber of indices need to address the cell
neighborhood_cellsarray of neighboring cells
neighborhood_sizesize of neighborhood_cells array
new_cell_statereference to the new cell state

◆ test_CA()

void test_CA ( CellularAutomata< int > &  CA)

Main testing function that calls all other types of tests.

Parameters
CAthe CellularAutomata instance

◆ test_CA_init()

void test_CA_init ( CellularAutomata< int > &  CA)

Tests the initialization of CellularAutomata instances.

Parameters
CAthe CellularAutomata instance

◆ test_CA_matrix()

void test_CA_matrix ( )

Tests the implementation of the CA with a matrix of cells.

◆ test_CA_step()

void test_CA_step ( CellularAutomata< int > &  CA)

Tests the CellularAutomata instances's step function.

Parameters
CAthe CellularAutomata instance

◆ test_CA_tensor()

void test_CA_tensor ( )

Tests the implementation of the CA with a tensor of cells.

◆ test_CA_vector()

void test_CA_vector ( )

Tests the implementation of the CA with vector of cells.