This module offers CellLoop classes for nondeterministic step function execution.
The idea behind this is, that in a physical realisation of a cellular automaton, the single cells may not update with the exact same frequency, so that the order in which the cells execute may be arbitrary and asynchronous.
This is formally defined with a probability that decides, for each cell in turn, if it may update or not.
zasim.cagen.beta_async implements a different kind of asynchronous execution. While the formal definitions are compatible, the implementations in nondeterministic should not be mixed with the implementations in beta_async.
This implementation offers the NondeterministicCellLoopMixin, which you can add as a first base class next to any kind of CellLoop. For your convenience, the classes OneDimNondeterministicCellLoop and TwoDimNondeterministicCellLoop are already composed for you.
Add this StepFuncVisitor to your stepfunc, so that random generators can be used by python and c code in a proper manner. Supply the random_generator argument to define the seed, that is used at the beginnig.
The random generator will be used directly by the python code, but the C code is a bit more complex.
The C code carries a randseed with it that gets seeded by the Python random number generator at the very beginning, then it uses the randseed attribute in the target to seed srand. After the computation, randseed will be set to rand(), so that the same starting seed will still give the same result.
If reproducible randomness sequences are desired, do NOT mix the pure python and weave inline step functions!
Add code to C and python
Adds the randseed attribute to the target.
Deriving from a CellLoop and this Mixin will cause every cell to be skipped with a given probability
The probability with which to execute each cell.
Adds C code for handling the skipping.
This Nondeterministic Cell Loop loops over one dimension, skipping cells with a probability of probab.
This Nondeterministic Cell Loop loops over two dimensions, skipping cells with a probability of probab.