59 this->ASBM |= 0x01<<idx;
65 this->ASBM &= ~(0x01<<idx);
72 if((this->ASBM>>bit_pos) & 0x01){
88 for(uint8_t i=0;i<4;i++){
101 for(uint8_t i=0;i<4;i++){
105 DNGS |= (_ng[N].
NGS >> W & 0x01) << N_W;
106 DNGS |= (_ng[N].
NGS >> E & 0x01) << N_E;
111 DNGS |= (_ng[E].
NGS >> N & 0x01) << N_E;
112 DNGS |= (_ng[E].
NGS >> S & 0x01) << S_E;
117 DNGS |= (_ng[S].
NGS >> E & 0x01) << S_E;
118 DNGS |= (_ng[S].
NGS >> W & 0x01) << S_W;
123 DNGS |= (_ng[W].
NGS >> S & 0x01) << S_W;
124 DNGS |= (_ng[W].
NGS >> N & 0x01) << N_W;
This file defines cardinal and relative directions enumerations.
This file contains the Sensing types, the sensors enumeration, and defines the sensing holder Sensing...
The base class (the soul) for all the beings in the simulation.
Definition: Being.h:23
void dye()
Sets the cell's state to dead.
Definition: Being.h:51
uint32_t age
The age of the being, since the board is up.
Definition: Being.h:30
boolean isactive(uint8_t bit_pos)
Checks if a sensor is active in the 32bit Active Sensor Bit Map (ASBM)
Definition: Being.h:70
void updateNGS(Being *_ng)
Updates the 8bit Neighborhood State Map (NGS) by setting it's four less significant bits to dead(0) o...
Definition: Being.h:86
boolean alive
The state of the being (dead = 0, alive = 1)
Definition: Being.h:28
void deactivate(uint8_t idx)
Deactivates a sensor in the 32bit Active Sensor Bit Map (ASBM)
Definition: Being.h:64
SensingData sensors
Sensor dada holder It has all the sensor types defined in the Sensing.h file. Think of it as a holde...
Definition: Being.h:35
void born()
Sets the cell's state to alive.
Definition: Being.h:44
void calcDNGS(Being *_ng)
Calculates the Diagonal neighbors of the being and sets the four most significant bits of the 8bit Ne...
Definition: Being.h:99
byte NGS
The neighborhood state mapping (NGS)
Definition: Being.h:37
void activate(uint8_t idx)
Activates a sensor in the 32bit Active Sensor Bit Map (ASBM)
Definition: Being.h:58
void updateAge()
Updates the Age of the being by seting it to the current time.
Definition: Being.h:78
long ASBM
The active sensor mapping (ASBM)
Definition: Being.h:39
Sensing holder structure with all the sensor types, ordered by the ASBM bits from its least significa...
Definition: Sensing.h:130