zasim.cagen.loops

Inheritance diagram of zasim.cagen.loops

class zasim.cagen.loops.OneDimCellLoop[source]

Bases: zasim.cagen.bases.CellLoop

The OneDimCellLoop iterates over all cells in order from 0 to sizeX.

requires_features = ['one_dimension']
get_pos()[source]
visit()[source]
get_iter()[source]
build_name(parts)[source]
class zasim.cagen.loops.TwoDimCellLoop[source]

Bases: zasim.cagen.bases.CellLoop

The TwoDimCellLoop iterates over all cells from left to right, then from top to bottom.

requires_features = ['two_dimensions']
get_pos()[source]
visit()[source]
get_iter()[source]
build_name(parts)[source]
class zasim.cagen.loops.SparseCellLoop[source]

Bases: zasim.cagen.bases.CellLoop

The SparseCellLoop offers common code for loops that only calculate those fields, where the neighbours have changed in the last step.

This is based on a list of positions called sparse_list as well as a mask of booleans called sparse_mask, that only internally gets used to make sure, that no fields are enlisted more than once.

The sparse_list is duplicated into the property prev_sparse_list, from which reads are performed. All entries in the sparse_list arrays are valid up to the first -1.

For the pure-py version, a normal python set is used.

It requires an ActivityRecord for the was_active flag.

probab = None
set_target(target)[source]

Adds the activity mask and position list to the target attributes.

bind(code)[source]
get_pos()[source]
calculate_size()[source]

Calculate how big the mask and list have to be.

The current strategy is to just allocate one field for each field of the configuration.

mark_cell_py(pos)[source]
new_config()[source]
get_iter()[source]
visit()[source]
class zasim.cagen.loops.OneDimSparseCellLoop[source]

Bases: zasim.cagen.loops.SparseCellLoop

requires_features = ['one_dimension', 'activity']
class zasim.cagen.loops.TwoDimSparseCellLoop[source]

Bases: zasim.cagen.loops.SparseCellLoop

requires_features = ['two_dimensions', 'activity']
class zasim.cagen.loops.OneDimSparseNondetCellLoop(probab=0.5)[source]

Bases: zasim.cagen.loops.OneDimSparseCellLoop

requires_features = ['one_dimension', 'activity', 'random_generator']
class zasim.cagen.loops.TwoDimSparseNondetCellLoop(probab=0.5)[source]

Bases: zasim.cagen.loops.SparseCellLoop

requires_features = ['two_dimensions', 'activity', 'random_generator']

Previous topic

zasim.cagen.bases - Base classes for cagen

Next topic

zasim.cagen.accessors

This Page