Cellular Automata CHEM274B Group Project
Contributor(s): Chongye Feng, Emmanuel Cortes, Trevor Oldham
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
BaseCellularAutomata Class Reference

A base CellularAutomata class that contains non-templated member variables and method definitions from which templated and specialized template classes can inherit. More...

#include <CAdatatypes.h>

Inheritance diagram for BaseCellularAutomata:
CellularAutomata< GalaxyCell > CellularAutomata< T >

Public Member Functions

 BaseCellularAutomata ()
 Construct a new Cellular Automata:: Cellular Automata object. More...
 
virtual ~BaseCellularAutomata ()
 Destroy the Cellular Automata:: Cellular Automata object. More...
 
int setup_neighborhood (CAEnums::Neighborhood neighborhood_type)
 Setup neighborhood with values from enum neighborhood. More...
 
int setup_cell_states (int num_states)
 Defines the range of cell states to be used in the CA object. More...
 
int setup_rule (CAEnums::Rule rule_type)
 Setup the rule choice to specify the rule type to be used in CA object. More...
 
void print_error_status (CAEnums::ErrorCode error)
 Prints an error message for the given error code. More...
 

Public Attributes

CAEnums::Boundary boundary_type
 enum code to hold boundary
 
int boundary_radius
 declare a radius for the boundary
 
CAEnums::Neighborhood neighborhood_type
 enum code to hold neighborhood type
 
int num_states
 integer code for number of states
 
CAEnums::Rule rule_type
 enum code for rule type
 
int axis1_dim
 count of cells in first dimension
 
int axis2_dim
 count of cells in second dimension
 
int axis3_dim
 count of cells in third dimension
 

Detailed Description

A base CellularAutomata class that contains non-templated member variables and method definitions from which templated and specialized template classes can inherit.

Default values:
   boundary_type = CAEnums::Periodic
   neighborhood_type = CAEnums::Moore
   rule_type = CAEnums::Majority

Constructor & Destructor Documentation

◆ BaseCellularAutomata()

BaseCellularAutomata::BaseCellularAutomata ( )

Construct a new Cellular Automata:: Cellular Automata object.

Sets the default value to all class attributes.

◆ ~BaseCellularAutomata()

virtual BaseCellularAutomata::~BaseCellularAutomata ( )
inlinevirtual

Destroy the Cellular Automata:: Cellular Automata object.

Deallocates memory reserved for vector/matrix/tensor.

Member Function Documentation

◆ print_error_status()

void BaseCellularAutomata::print_error_status ( CAEnums::ErrorCode  error)

Prints an error message for the given error code.

Parameters
errorErrorCode enum type

◆ setup_cell_states()

int BaseCellularAutomata::setup_cell_states ( int  num_states)

Defines the range of cell states to be used in the CA object.

Parameters
num_statesdescribes the range of numbers to use for cell states
Returns
int - error code
InvalidNumStates: num_states can't be less than to 2
0: no error

◆ setup_neighborhood()

int BaseCellularAutomata::setup_neighborhood ( CAEnums::Neighborhood  neighborhood_type)

Setup neighborhood with values from enum neighborhood.

Parameters
neighborhood_typeenum value for neighborhood type (VonNeumann or Moore)
Returns
int error code

◆ setup_rule()

int BaseCellularAutomata::setup_rule ( CAEnums::Rule  rule_type)

Setup the rule choice to specify the rule type to be used in CA object.

Parameters
rule_typeenum rule representing the rule type
Returns
int error code

The documentation for this class was generated from the following file: