Factory reference¶
The package entry point is lgca.get_lgca(). It chooses the concrete
simulator class from four main switches:
geometryLattice geometry. Supported values and aliases are:
"1d","lin","linear""square","sq","rect","rectangular""hex","hx","hexagonal""cubic","cb""moore","moore3d"
ibIf
True, use identity-based particles with individual labels and properties. Identity-based multi-species classes are not implemented.veIf
True, enforce volume exclusion: at most one particle can occupy each channel. IfFalse, channels may contain multiple particles or particle IDs depending on the LGCA family.n_speciesNumber of species. Values greater than one select the multi-species class family. Multi-species classes are currently classical, not identity-based.
Model class matrix¶
Family |
1D |
Square |
Hexagonal |
Cubic |
Moore |
|---|---|---|---|---|---|
Classical, volume exclusion |
|
|
|
|
|
Identity-based, volume exclusion |
|
|
|
|
|
Classical, no volume exclusion |
|
|
|
|
|
Identity-based, no volume exclusion |
|
|
|
|
|
Multi-species, volume exclusion |
|
|
|
|
|
Multi-species, no volume exclusion |
|
|
|
|
|
Common keyword arguments¶
dimsLattice dimensions. An integer expands to equal dimensions for square, hexagonal, cubic and Moore geometries. A tuple is interpreted by geometry.
nodesCustom initial lattice state. If supplied, it overrides
dims,densityand inferredrestchannels.densityInitial random density used when
nodesis not supplied.restchannelsNumber of resting channels in addition to velocity channels. Some interactions require rest channels; some NoVE interactions require none.
interactionName of a built-in interaction or a callable assigned after construction. Built-in options depend on the selected class family.
bcBoundary condition. Geometry-specific classes implement periodic, reflecting and absorbing variants where available.
seedSeed passed to the simulator’s NumPy random generator for deterministic simulations.
Examples¶
from lgca import get_lgca
classical = get_lgca(geometry="hex", interaction="alignment", seed=1)
identity = get_lgca(geometry="1d", ib=True, interaction="birth", seed=1)
nove = get_lgca(geometry="square", ve=False, restchannels=0,
interaction="dd_alignment", seed=1)
multispecies = get_lgca(geometry="square", n_species=2, restchannels=1,
interaction="excitable_medium_ms", seed=1)
Placeholders¶
Detailed shape diagrams for custom nodes arrays and boundary-condition
tables are still missing. The current authoritative reference is the class API
documentation and the geometry-specific set_dims implementations.