CaState Class Reference

#include <Ca.h>

List of all members.


Detailed Description

Simple CA state representation.

The CA has fixed size [width = height] and two possible states per cell. Cyclic or hard-zeroed CA's boundary can be switched by the CA_CYCLIC_NEIGHBORHOOD compile-time option.

Definition at line 114 of file Ca.h.


Public Member Functions

 CaState (size_t size)
 
Parameters:
size Size of 2D CA in one direction.

size_t size () const
 Return size of CA in one direction.
bool getCellAtPos (Pos pos) const
 Return cell state at given position (respecting selected boundary settings).
void setCellAtPos (Pos pos, bool val)
 Set cell state at given position to given value (respecting selected boundary settings).
bool operator== (const CaState &other) const
bool operator!= (const CaState &other) const

Private Attributes

size_t size_
boost::dynamic_bitset bitset_

Constructor & Destructor Documentation

CaState ( size_t  size  ) 

Parameters:
size Size of 2D CA in one direction.

It means the CA will have size*size cells in sum.

Definition at line 142 of file Ca.cpp.

References bitset_.


Member Function Documentation

size_t size (  )  const

Return size of CA in one direction.

Definition at line 149 of file Ca.cpp.

References size_.

Referenced by applyRules(), operator<<(), and writeCaState().

Here is the caller graph for this function:

bool getCellAtPos ( Pos  pos  )  const

Return cell state at given position (respecting selected boundary settings).

Parameters:
pos Position of the cell whose state ought be returned.

Definition at line 153 of file Ca.cpp.

References bitset_, Pos::col, Pos::row, and size_.

Referenced by applyRule(), operator<<(), and writeCaState().

Here is the caller graph for this function:

void setCellAtPos ( Pos  pos,
bool  val 
)

Set cell state at given position to given value (respecting selected boundary settings).

Parameters:
pos Position of the cell whose state is being changed.
val New value (state) for the selected cell.

Definition at line 174 of file Ca.cpp.

References bitset_, Pos::col, Pos::row, and size_.

Referenced by applyRules().

Here is the caller graph for this function:

bool operator== ( const CaState other  )  const

Definition at line 194 of file Ca.cpp.

References bitset_, and size_.

Referenced by operator!=().

Here is the caller graph for this function:

bool operator!= ( const CaState other  )  const [inline]

Definition at line 143 of file Ca.h.

References operator==().

Here is the call graph for this function:


Member Data Documentation

size_t size_ [private]

Definition at line 148 of file Ca.h.

Referenced by getCellAtPos(), operator==(), setCellAtPos(), and size().

boost::dynamic_bitset bitset_ [private]

Definition at line 149 of file Ca.h.

Referenced by CaState(), getCellAtPos(), operator==(), and setCellAtPos().


The documentation for this class was generated from the following files:
Generated on Sat May 2 16:39:38 2009 for nucad by  doxygen 1.5.4