lgca.get_lgca

lgca.get_lgca(geometry='hex', ib=False, ve=True, n_species=1, **kwargs)

Build an LGCA with the specified geometry and initial conditions. Choose the correct LGCA subclass from the package and pass remaining keyword parameters on to it for initialization.

Parameters:

geometry – Lattice geometry. Supported are 1D, 2D square, 2D hexagonal, 3D cubic and 3D Moore lattices.

Returns:

LGCA simulator object.

See also

base.LGCA_base.set_bc

Set boundary conditions. Processes **kwargs.

base.LGCA_base.set_dims

Set the lattice geometry. Processes **kwargs.

base.LGCA_base.init_nodes

Initialize the lattice. Processes **kwargs.

base.LGCA_base.set_interaction

Set the interaction and corresponding parameters. Processes **kwargs.

Notes

The function mediates between user and package. It picks the correct LGCA subclass and initializes an instance of it. Allowed types and values of keyword arguments for initialization may vary. Details can be found in the documentation of the subclasses.

How to navigate: Subclasses are structured as follows (omitting geometry inheritance):

Examples

Request a classical LGCA with a hexagonal lattice and a random walk interaction.

>>> from lgca import get_lgca
>>> lgca = get_lgca(interaction='random_walk')
Random walk interaction is used.

Used default values for interactions are printed to the terminal.

Request an identity-based LGCA in a linear geometry with a birth interaction.

>>> lgca = get_lgca(ib=True, geometry='1d', interaction='birth')
Birth rate set to r_b = 0.2
Standard deviation set to std = 0.01
Max. birth rate set to a_max = 1.0

The returned LGCA object can then be used to simulate.

>>> # simulate for 50 timesteps
>>> lgca.timeevo(timesteps=50)
Progress: [####################] 100% Done...