circulartransition.cpp 357 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#include "circulartransition.hpp"

unsigned CircularTransition::getState(unsigned cell, const Neighborhood &neighborhood) const
{
    unsigned next_state = (cell+1) % states.val;
    unsigned next_state_neighbors = neighborhood.getNb(next_state);
    if ((int)next_state_neighbors >= thresold.val)
        return next_state;
    else
        return cell;
}