zasim.cagen.beta_async - Nondeterministic cell communication

Inheritance diagram of zasim.cagen.beta_async

This module implements a Neighbourhood and a StateAccessor for beta-asynchronous step function execution.

The idea behind beta asynchronous execution is, that in a physical realisation of a cellular automaton, there may be delays in communication between the cells whenever the value of a neighbour is read.

This is simulated by splitting the value of a cell into an inner and an outer value.

At the beginning of each step, each cell reads its own inner value and the outer value of each surrounding cell. These values are then used just like during normal calculation. At the end of the step, the cell then writes the result to its inner value and, with the probability set before, updates the outer value with the inner value.

See also

zasim.cagen.nondeterministic 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.

Implementation details

This implementation realises the above specification by offering both a Neighbourhood base class as well as a StateAccessor derived from SimpleStateAccessor.

The BetaAsynchronousNeighbourhood acts just like SimpleNeighbourhood, but reads the current outer value into orig_foo and the inner value into foo (assuming foo is the name of the central cell.)

The BetaAsynchronousAccessor takes care of updating the outer state with the inner state at the end of the computation and ensures that, in case there’s any stats object in place, at the end of the computation “foo” (as defined above) contains the outer value of the current cell.

class zasim.cagen.beta_async.BetaAsynchronousNeighbourhood(*args, **kwargs)[source]

Bases: zasim.cagen.neighbourhoods.SimpleNeighbourhood

requires_features = ['beta_async_accessor']
provides_features = ['beta_async_neighbourhood']
visit()[source]

Adds C and python code to get the neighbouring values and stores them in local variables. The neighbouring values will be taken from the outer array, the own value will be taken from the inner array.

class zasim.cagen.beta_async.BetaAsynchronousAccessor(probab=0.5, **kwargs)[source]

Bases: zasim.cagen.accessors.SimpleStateAccessor

requires_features = ['beta_async_neighbourhood', 'random_generator']
provides_features = ['beta_async_accessor']
init_once()[source]
new_config()[source]
write_to_inner(pos, value)[source]
inner_write_access(pos)[source]
read_from_inner(pos)[source]
inner_read_access(pos)[source]
visit()[source]
set_target(target)[source]
build_name(parts)[source]