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_bcSet boundary conditions. Processes **kwargs.
base.LGCA_base.set_dimsSet the lattice geometry. Processes **kwargs.
base.LGCA_base.init_nodesInitialize the lattice. Processes **kwargs.
base.LGCA_base.set_interactionSet 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):
lgca.base.LGCA_base: classical LGCA with volume exclusion
lgca.ib_base.IBLGCA_base: identity-based LGCA with volume exclusion
lgca.nove_base.NoVE_LGCA_base: classical LGCA without volume exclusion
lgca.nove_ib_base.NoVE_IBLGCA_base: identity-based LGCA without volume exclusion
lgca.multispecies_base.MultiSpeciesNoVE_LGCA_base: multi-species LGCA without volume exclusion
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...