zasim.cagen.accessors

Inheritance diagram of zasim.cagen.accessors

class zasim.cagen.accessors.SimpleStateAccessor[source]

Bases: zasim.cagen.bases.StateAccessor

The SimpleStateAccessor offers a base for classes that just linearly grant access to any-dimensional configuration space.

size_names = ()

The names to use in the C code

border_names = ((),)

The names of border offsets.

The first tuple contains the borders with lower coordinate values, the second one contains the borders with higher coordinate values.

border_size = {}

The sizes of the borders.

The key is the name of the border from border_names, the value is the size of the border.

size = None

The size of the target configuration.

cell_count = 0

The number of cells in the target configuration.

conf_names = ('nconf', 'cconf')
set_size(size)[source]
read_access(pos)[source]
write_access(pos)[source]
init_once()[source]

Set the sizeX const and register nconf and cconf for extraction from the targen when running C code.

bind(code)[source]

Get the bounding box from the neighbourhood object, set consts for borders.

visit()[source]

Take care for result and sizeX to exist in python and C code, for the result to be written to the config space and for the configs to be swapped by the python code.

set_target(target)[source]

Get the size from the target objects config.

read_from(pos)[source]
read_from_next(pos)[source]
write_to(pos, value)[source]
write_to_current(pos, value)[source]
get_size_of(dimension=0)[source]
swap_configs()[source]

Swaps nconf and cconf in the target.

multiplicate_config()[source]

Copy cconf to nconf in the target.

gen_copy_code()[source]

Generate a bit of C code to copy the current field over from the old config. This is necessary for instance for nondeterministic step funcs combined with swapping two confs around.

gen_copy_py_code()[source]

Generate a bit of py code to copy the current field over from the old config.

class zasim.cagen.accessors.SubcellAccessor(cells)[source]

Bases: zasim.cagen.accessors.SimpleStateAccessor

With the SubcellAccessor you can handle configurations where each cell is conceptually made up of multiple cells. This can be done either with one ndarray per subcell or a suitable record ndarray, from which views for each subcell “plane” can be created.

visit()[source]

Take care for result and sizeX to exist in python and C code, for the result to be written to the config space and for the configs to be swapped by the python code.

read_access(pos, cell)[source]
write_access(pos, cell)[source]
read_from(pos, cell)[source]
read_from_next(pos, cell)[source]
write_to(pos, value, cell)[source]
write_to_current(pos, value, cell)[source]
get_size_of(dimension=0)[source]
multiplicate_config()[source]

Copy cconf to nconf in the target.

swap_configs()[source]
gen_copy_code()[source]

Generate a bit of C code to copy the current field over from the old config. This is necessary for instance for nondeterministic step funcs combined with swapping two confs around.

gen_copy_py_code()[source]

Generate a bit of py code to copy the current field over from the old config.

Previous topic

zasim.cagen.loops

Next topic

zasim.cagen.neighbourhoods

This Page