WindRose 1.0
Custom Hardware , Firmware and Software for Robotic Cellular Automata Experiments
 
Loading...
Searching...
No Matches
Being Class Reference

The base class (the soul) for all the beings in the simulation. More...

#include <Being.h>

Public Member Functions

void born ()
 Sets the cell's state to alive.
 
void dye ()
 Sets the cell's state to dead.
 
void activate (uint8_t idx)
 Activates a sensor in the 32bit Active Sensor Bit Map (ASBM)
 
void deactivate (uint8_t idx)
 Deactivates a sensor in the 32bit Active Sensor Bit Map (ASBM)
 
boolean isactive (uint8_t bit_pos)
 Checks if a sensor is active in the 32bit Active Sensor Bit Map (ASBM)
 
void updateAge ()
 Updates the Age of the being by seting it to the current time.
 
void updateNGS (Being *_ng)
 Updates the 8bit Neighborhood State Map (NGS) by setting it's four less significant bits to dead(0) or alive(1)
 
void calcDNGS (Being *_ng)
 Calculates the Diagonal neighbors of the being and sets the four most significant bits of the 8bit Neighborhood State Map (NGS)
 

Public Attributes

boolean alive = 0
 The state of the being (dead = 0, alive = 1)
 
uint32_t age = 0
 The age of the being, since the board is up.
 
SensingData sensors
 Sensor dada holder It has all the sensor types defined in the Sensing.h file.
Think of it as a holder for data captured from sensors, organized by sensor types.
 
byte NGS =0x00
 The neighborhood state mapping (NGS)
 
long ASBM = 0x00
 The active sensor mapping (ASBM)
 

Detailed Description

The Being class contains the basic attributes of a being, such as its age, its state,
its Active Sensors Bit Mapping (ASBM),
the Neighborhood State Mapping (NGS).
It used for storing automata data and managing sensors.

Member Function Documentation

◆ activate()

void Being::activate ( uint8_t idx)
inline
Parameters
idxThe id of the sensor to be activated

◆ calcDNGS()

void Being::calcDNGS ( Being * _ng)
inline
Parameters
*_ngThe being to be checked against (is a pointer to the being to be checked)

◆ deactivate()

void Being::deactivate ( uint8_t idx)
inline
Parameters
idxThe id of the sensor to be deactivated

◆ isactive()

boolean Being::isactive ( uint8_t bit_pos)
inline
Parameters
bit_posThe bit position(same as the id) of the sensor to be checked in the ASBM

◆ updateNGS()

void Being::updateNGS ( Being * _ng)
inline
Parameters
*_ngThe being to be checked against (is a pointer to the being to be checked)

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