lgca.ib_base.IBLGCA_base¶
- class lgca.ib_base.IBLGCA_base(nodes=None, dims=None, restchannels=0, density=0.1, bc='periodic', seed=None, propagation=True, **kwargs)¶
Bases:
LGCA_base,ABCAbstract base class for identity-based LGCA with volume exclusion.
It holds all methods and attributes that are common for all geometries. Cannot simulate on its own. If you want to use it, instantiate one of the geometry-specific derived classes.
- Parameters:
bc ({'absorbing', 'reflecting', 'periodic', 'inflow'}, default='periodic') – Boundary conditions. Not all bc are supported in all geometries (yet).
- Attributes:
- occupied
numpy.ndarray Boolean array indicating which channels are filled in the current lattice state. Dimensions:
lgca.dims + (lgca.K,).- propsdict
Dictionary storing properties of individual cells indexed by their particle label.
- maxlabelint
Identifier of the highest particle label currently in use.
- family_propsdict, optional
Dictionary storing properties of cell families if inheritance is tracked.
- maxfamilyint, optional
Identifier of the highest family in
family_props.- apply_boundariescallable
Function implementing the boundary conditions.
c(Class attribute.) Array of the velocity channel vectors. Dimensions:
(dims, lgca.velocitychannels),- cell_density
numpy.ndarray Number of particles at each lattice node in the current LGCA state. Computed field. Dimensions:
lgca.dims.- cij
numpy.ndarray Nematic tensor. Element-wise multiplication of neighborhood vectors with themselves. Computed from the geometry. Dimensions:
(lgca.c.shape[1], lgca.c.shape[0], lgca.c.shape[0}). First dimension: neighborhood vector, second and third dimension: combination of x and y components of the vector as[[cix*cix, cix*ciy], [ciy*cix, ciy*ciy]].- concentration
Internal variable for the chemotaxis interaction.
- dens_t
numpy.ndarray Number of particles at each lattice node for all timesteps in the previous simulation. Only available after a simulation performed with
timeevo(recorddens=True). Dimensions:(timesteps,) + lgca.dims.- dimstuple
Lattice dimensions/size of the lattice as
(xdim,)(1D LGCA) or(xdim, ydim)(2D LGCA), excluding shadow nodes on the border.- guiding_tensor
Internal variable for the contact_guidance interaction.
- interactioncallable
Interaction rule assigned to the LGCA.
interactions(Class attribute.) List of interaction functions suitable for this type of LGCA.
- jlist of
numpy.ndarray Flux for each possible channel configuration. Dimensions:
(lgca.K + 1, len(lgca.c)).- Kint
Number of channels per node. Equal to
lgca.velocitychannels + lgca.restchannels.- n_crit
Internal variable for the wetting interaction.
- n_t
numpy.ndarray Sum of particles in the lattice for all timesteps in the previous simulation. Only available after a simulation performed with
timeevo(recordN=True). Dimensions:(timesteps,).- nodes
numpy.ndarray State of the lattice, configuration of all channels. Dimensions:
(lgca.l + 2*lgca.r_int, lgca.K)(in 1D LGCA) or(lgca.lx + 2*lgca.r_int, lgca.ly + 2*lgca.r_int, lgca.K). Includes shadow nodes on all borders for implementing boundary conditions.- nodes_t
numpy.ndarray Full lattice configuration of non-border nodes for all timesteps in the previous simulation. Only available after a simulation performed with
timeevo(record=True). Dimensions:(timesteps,) + lgca.dims + (K,).- nonbordertuple of
numpy.ndarray Indices of non-border nodes in the
lgca.nodesarray as(x-indices,)(in 1D LGCA) or(x-indices, y-indices)(in 2D LGCA), i.e. all nodes excluding shadow nodes for boundary conditions. Both arrays x-indices and y-indices have the dimensionslgca.dims.- permutationslist of
numpy.ndarray All possible configurations for a lattice site with
lgca.Kchannels. Dimensions:(lgca.K + 1, n, lgca.K). n is the number of possible permutations for the node if x channels are occupied, where x is given by the first dimension.- r_intint, default=1
Interaction radius. Must be at least 1 to handle propagation.
- restchannelsint
Number of resting channels.
- silist of
numpy.ndarray Nematic tensor for all possible node configurations, obtained from
lgca.permutationsandpy.cij. Dimensions:(lgca.K + 1, n, len(lgca.c), len(lgca.c)). n is the number of possible permutations for the node if x channels are occupied, where x is given by the first dimension.- velcells_t, restcells_t
numpy.ndarray Sum of particles in velocity/rest channels, respectively, for all timesteps in the previous simulation. Only available after a simulation performed with
timeevo(recordpertype=True). Dimensions:(timesteps,) + lgca.dims.velocitychannels(Class attribute.) Number of velocity channels.
- occupied
See also
lgca.lgca_1d.IBLGCA_1DIdentity-based LGCA in a 1D geometry.
lgca.lgca_square.IBLGCA_SquareIdentity-based LGCA in a 2D square geometry.
lgca.lgca_hex.IBLGCA_HexIdentity-based LGCA in a 2D hexagonal geometry.
- add_family(ancestor_fam)¶
Create a new family and register it in the family tree.
- Parameters:
ancestor_fam (
int) – Family that the new one descends from.
Warning
Please do not call this unless you are writing an interaction function that deals with mutations.
It accesses
self.maxfamilyandself.family_propswhich do not exist ifself.init_families()has not been called in the LGCA initialization.
- apply_abc()¶
Apply absorbing boundary conditions.
Update
self.nodes, using the shadow border nodes and respecting the geometry.
- apply_inflowbc()¶
Apply inflow boundary conditions.
Update
self.nodes, using the shadow border nodes and respecting the geometry.
- apply_pbc()¶
Apply periodic boundary conditions.
Update
self.nodes, using the shadow border nodes and respecting the geometry.
- apply_rbc()¶
Apply reflecting boundary conditions.
Update
self.nodes, using the shadow border nodes and respecting the geometry.
- abstract property c: ndarray¶
(Class attribute.) Array of the velocity channel vectors. Dimensions:
(dims, lgca.velocitychannels), where dims is 1 or 2 depending on the geometry.
- calc_family_generations()¶
Calculate which generation each family belongs to, i.e. how many mutations have occurred. The list is returned and stored in
self.family_props['generation'].- Returns:
Family generations indexed by family ID, helper root family = generation 0, families at the beginning of the simulation = generation 1.
- calc_family_pop_alive()¶
Calculate how many cells of each family are alive.
- Returns:
Array of family population counts indexed by family ID.
- calc_flux(nodes)¶
Calculate the flux vector for all lattice sites in nodes.
The elements of the flux vectors are computed as the dot product between the LGCA’s neighborhood vectors and the velocity channel configuration in nodes.
- Parameters:
nodes (
numpy.ndarray) – Lattice configuration to compute the flux for. Must have more than or the same number of dimensions asself.nodesandnodes.shape[-1] >= self.velocitychannels. Is typicallyself.nodes.- Returns:
Array of flux vectors at each lattice site. Dimensions:
nodes.shape[:-1] + (len(self.c),).
- calc_generation_pop()¶
Calculate the current population per family generation.
- Returns:
Cell numbers per generation, indexed by generation (helper root family is generation 0, families present at initialization are generation 1).
- calc_generation_pop_t(cutoff_abs=None, cutoff_rel=None)¶
Calculate the population per family generation at each simulation step. Requires a previous
self.timeevo()withrecordfampop=True.- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
- Returns:
Cell numbers per generation at each timestep (helper root family is generation 0, families present at initialization are generation 1). Dimensions:
(timesteps+1, generations+1).
- calc_init_families_pop()¶
Calculate the current population per family that was initialised in the beginning of the simulation (“initial ancestor”) and its descendants.
- Returns:
init_families_pop (
numpy.ndarray) – Population per initial family.init_ancestor_IDs (
numpy.ndarray) – Initial family ID corresponding to each position in init_families_pop.
- calc_init_families_pop_t(cutoff_abs=None, cutoff_rel=None)¶
Calculate the current population per family that was initialised in the beginning of the simulation (“initial ancestor”) and its descendants at each simulation step. Requires a previous
self.timeevo()withrecordfampop=True.- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
- Returns:
init_families_pop (
numpy.ndarray) – Population per initial family at each timestep, dimensions:(timesteps+1, num_init_families+1).init_ancestor_IDs (
numpy.ndarray) – Family ID corresponding to each position on the family dimension in init_families_pop.
- calc_permutations()¶
Initialize lazy computation structures for permutations. Only compute permutations when actually needed.
- calc_prop_mean(nodes=None, props=None, propname=None)¶
Calculate the mean of particle property propname across the lattice configuration nodes.
- Parameters:
nodes (
numpy.ndarray, default=``self.nodes[self.nonborder]``) – Lattice configuration with particle IDs.propname (hashable type, default=first key in props) – Key for the desired property in the props dictionary. If props is the default, propname needs to be a string.
props (dict, default=``self.props``) – Property dictionary that maps a property identifier, e.g. a name like
'r_b', to a 1d array or list of values for this property. Indices in the list/array must reflect the ID of the particle that the value is associated with. The value at the 0th element is used for empty lattice sites.
- Returns:
Mean value of property propname among particles in each node, dimensions:
self.dims.
See also
lgca.lgca_1d.IBLGCA_1D.plot_prop_spatialPlot mean value of a property in all nodes over time.
lgca.lgca_square.IBLGCA_Square.plot_prop_spatialPlot mean value of a property in all nodes. Also used for hexagonal IBLGCA.
- static convert_bool_to_ib(conf)¶
Convert the booleans in the lattice configuration of a classical LGCA with volume exclusion into unique particle identifiers.
- Parameters:
conf (
numpy.ndarray) – Lattice configuration for a classical LGCA with volume exclusion.- Returns:
Node configuration of conf converted to an identity-based LGCA. Dimensions:
conf.shape.
- filter_family_population_t(fam_pop_t=None, cutoff_abs=None, cutoff_rel=None)¶
Mask out families from fam_pop_t that never exceeded the given population threshold.
- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
fam_pop_t (
numpy.ndarray, default=``self.fam_pop_t``) – Each family’s population size over time, dimensions:(timesteps + 1, num_families + 1).
- Returns:
fam_pop_t with all population values for too small families set to 0, dimensions:
(timesteps + 1, num_families + 1). Original fam_pop_t if both cutoff parameters are None.
- get_flux_permutations(n_particles)¶
Get flux permutations for
n_particles.
- get_permutations(n_particles)¶
Get permutations for
n_particles.- Parameters:
n_particles (int) – Number of occupied channels.
- Returns:
Array of permutations for
n_particles.
- get_prop(nodes=None, props=None, propname=None)¶
Obtain the value of property propname for all particles in the lattice configuration nodes.
The value is drawn from the property dictionary props and placed in the channel that the respective particle resides in.
- Parameters:
nodes (
numpy.ndarray, default=``self.nodes[self.nonborder]``) – Lattice configuration with particle IDs.propname (hashable type, default=first key in props) – Key for the desired property in the props dictionary. If props is the default, propname needs to be a string.
props (dict, default=``self.props``) – Property dictionary that maps a property identifier, e.g. a name like
'r_b', to a 1d array or list of values for this property. Indices in the list/array must reflect the ID of the particle that the value is associated with. The value at the 0th element is used for empty lattice sites.
- Returns:
Lattice configuration with value for property propname associated to each particle instead of particle ID, dimensions:
nodes.shape.
See also
calc_prop_meanCalculate the mean of a particle property in each node.
plot_prop_timecoursePlot the timecourse of the mean and standard deviation of a particle property across the lattice.
- abstractmethod gradient(qty)¶
Compute the gradient of qty along all axes.
- Parameters:
qty (
numpy.ndarray) – Quantity to take the gradient of. Needs to have the same number of dimensions asself.nodes. Ifqty.shape == self.nodes.shape[:-1]the result can be indexed with the LGCA coordinates (see example).- Returns:
Computed gradient. Dimensions:
qty.shape + (len(self.c),). Ifselfandqtyare 2D arrays,gradient(qty)[...,0]is the gradient in x direction andgradient(qty)[...,1]the gradient in y direction.
Notes
The gradient is calculated using
numpy.gradient()with stepwidth h=0.5 (s.t. no normalization takes place). It is computed as the central finite difference with equidistant support points and supports one-sided differences at the boundaries.In most cases this yields the simple difference between the two closest array elements in the given direction. For example, the gradient at position 1 of
np.array([1, 2, 4])would be (4 - 1)/(2 * 0.5) = 3.Examples
If the input quantity has the same x (and y) dimensions as the LGCA’s nodes, the gradient at each node position can be accessed the same way as the node itself.
>>> from lgca import get_lgca >>> import numpy as np >>> # define a square LGCA to illustrate dimensions >>> lgca = get_lgca(geometry='square', dims=(2,3)) >>> lgca.nodes.shape # (xdim, ydim, number of channels) (4, 5, 4) >>> my_qty = np.array([[0,0,0,0,0], >>> [1,1,1,1,1], >>> [2,2,2,3,2], >>> [3,3,3,3,3]]) >>> my_qty.shape # (xdim, ydim) (4, 5) >>> grad = lgca.gradient(my_qty) >>> grad.shape # (xdim, ydim, number of dimensions) (4, 5, 2) >>> # address like internal LGCA fields: first dimension is x (printed vertically), >>> # second dimension is y (printed horizontally), this can be a bit confusing >>> for coord in lgca.coord_pairs: >>> if np.any(grad[coord]>2): >>> print("Gradient at index", coord, "is ", grad[coord]) >>> print("Configuration at index ", coord, " is ", lgca.nodes[coord], >>> ", with cell density ", lgca.cell_density[coord]) Gradient at index (1, 3) is [3. 0.] Configuration at index (1, 3) is [False False False True] , with cell density 1
The first element of the gradient holds the gradient in x direction, the second element the gradient in y direction. Note that
(1, 3)is the index corresponding to a logical non-border coordinate(0, 2)if the interaction radius is 1. This is relevant for defining a custom field qty: Only the field values at non-border indices will be “felt” by the particles in the LGCA if the interaction is defined accordingly, but border nodes can be used to specify the field’s boundary conditions.The gradient in x direction is 3 = (3 - 0)/1. In y direction it is 0 = (1 - 1)/1.
- abstractmethod init_coords()¶
Initialize LGCA coordinates. These are used to index the lattice nodes. In the implementation, set
self.nonborder,self.xcoords,self.ycoords, andself.coord_pairsto meaningful and consistent values.Must match what is done in
set_dims()andinit_nodes(). For the attribute types seelgca.base.LGCA_base.
- init_families(type='homogeneous', mutation=True)¶
Initialize structures to track inheritance between cells and/or cell families.
Initializes the
'family'property inself.propsand, if needed, the counterself.maxfamilyand the dictionaryself.family_props. The'ancestor'and'descendants'properties in the latter can be used to reconstruct a family tree.- Parameters:
mutation (bool, default=True) – If true, mutation can occur so that offspring can have different properties and found its own family. The additional dictionary
self.family_propsand the counterself.maxfamilykeep track of this. If false, the number of families is not supposed to increase during the simulation so thatself.family_propsandself.maxfamilyare not needed.type ({'homogeneous', 'heterogeneous'}, default='homogeneous') – Family composition for the initial population. If homogeneous, all initial cells belong to the same family and have the same properties. If heterogeneous, each initial cell founds its own family and can have individual properties that it passes on to its offspring.
See also
add_familyAdd a family to the family tree after a mutation has occurred.
muller_plotDraw a Muller plot for a simulation timecourse.
- abstractmethod init_nodes(density, nodes=None, **kwargs)¶
Initialize LGCA lattice configuration. Create the lattice and then assign particles to channels in the nodes. In the implementation, set
self.nodes.Must match what is done in
set_dims()andinit_coords(). For arguments and attribute types seelgca.base.LGCA_base.
- abstract property interactions: list¶
(Class attribute.) List of interaction functions suitable for this type of LGCA.
- list_families_alive()¶
Calculate which families are alive and list their IDs.
- Returns:
Array of family IDs in ascending order.
- muller_plot(t_start_index=None, t_slice=slice(None, None, None), prop=None, cutoff_abs=None, cutoff_rel=None, **kwargs)¶
Draw a Muller plot from the LGCA simulation data (runtime, family tree, recorded family populations).
- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
prop (hashable type, key of the dictionary self.family_props) – Colour the area for each family according to this family property. If None, colour area according to family identity.
t_slice (slice) – Which parts of the simulation time to consider for the plot.
t_start_index (int) – First number to appear on the x axis (time).
**kwargs – Keyword arguments to further style the plot drawn by
lgca.plots.muller_plot().
- Returns:
fig (
matplotlib.figure.Figure) – Matplotlib figure handle.ax (
matplotlib.axes.Axes) – Muller plot axis handle.(ret) – Handle of legend, handle of colourbar or None. The separate colourbar axis handle can be retrieved as
ret.ax.
- num_families_alive()¶
Calculate how many families are alive.
- Returns:
Number of families alive.
- num_families_alive_t(cutoff_abs=None, cutoff_rel=None)¶
Calculate how many families have been alive at each simulation step. Requires a previous
self.timeevo()withrecordfampop=True.- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
- Returns:
Number of families at each timestep, dimensions:
timesteps+1.
- num_families_total()¶
Calculate how many families there are in total, including extinct ones.
- Returns:
Number of families.
- num_families_total_t(cutoff_abs=None, cutoff_rel=None)¶
Calculate how many families there are in total at each timestep, including extinct ones.
- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
- Returns:
Number of families at each timestep, dimensions:
timesteps+1.
- plot_prop_timecourse(nodes_t=None, props=None, propname=None, figindex=None, figsize=None, **kwargs)¶
Plot the time course of the mean and standard deviation of particle property propname across the lattice.
The mean is plotted as a line with the standard deviation shadowed in both directions.
- Parameters:
figindex (int or str, optional) – An identifier for the figure (passed to
matplotlib.pyplot.figure()). If it is a string, the figure label and the window title is set to this value.figsize (tuple of int or tuple of float with 2 elements, optional) – Desired figure size in inches
(x, y).nodes_t (
numpy.ndarray, default=``self.nodes_t``) – Lattice configuration with particle IDs over time, first dimension: time.propname (hashable type, default=first key in props) – Key for the desired property in the props dictionary. If props is the default, propname needs to be a string.
props (dict, default=``self.props``) – Property dictionary that maps a property identifier, e.g. a name like
'r_b', to a 1d array or list of values for this property. Indices in the list/array must reflect the ID of the particle that the value is associated with. The value at the 0th element is used for empty lattice sites.**kwargs – Keyword arguments for the
matplotlib.pyplot.plot()command.
- Returns:
line (
matplotlib.lines.Line2D) – Plot of the mean property over time.errors (
matplotlib.collections.PolyCollection) – Polygons representing the standard deviation of the property over time, in both directions.
- print_interactions()¶
Print the list of pre-implemented interactions for this LGCA type.
- print_nodes()¶
Print the full lattice configuration as integers.
- propagate_ancestor_to_descendants()¶
Traverse family tree to find the families that were initialised in the beginning of the simulation (“initial ancestors”) and which families descend from them, including the 2nd, 3rd, … generations.
- Returns:
Initial ancestors indexed by family ID. The helper root family and initial ancestors have 0, all others their ancestor’s family ID.
- propagate_family_prop_to_cells(prop)¶
Propagate a family property down to all cells that belong to the family. Uses contents of
self.family_props[prop]to create a new cell propertyself.props[prop]- Parameters:
prop (str) – Key of the family property in
self.family_props[prop].
- static propagate_pop_to_parents(pop_t, ancestor)¶
Propagate family population in pop_t to all ancestors recorded in ancestor.
- Parameters:
pop_t (
numpy.ndarray) – Population of each family for all timesteps, dimensions:(timesteps, num_families).ancestor (list) – Record of each family’s parent (initially existing families have 0), length:
num_families + 1.
- Returns:
Family populations over time summed up to all ancestors recursively, cum_pop_t[:, 0] holds total population over time.
See also
muller_plotDraw a Muller plot for a simulation timecourse.
- abstractmethod propagation()¶
Perform the transport step of the LGCA: Move particles through the lattice according to their velocity.
Propagate the particles by updating
self.nodes, respecting the geometry. Boundary conditions are enforced later byapply_boundaries().
- random_reset(density)¶
Randomly fill channels so that each node has on average
densityparticles.Each channel is independently occupied with probability
density / self.K.- Parameters:
density (float) – Desired average number of particles per node.
density = total_number_of_particles / number_of_nodes.
- set_bc(bc)¶
Set the boundary conditions.
Selects a method which is called every timestep to enforce boundary conditions. The methods to select from are implemented in the derived classes. The chosen one is assigned to
self.apply_boundaries().- Parameters:
bc ({'absorbing', 'reflecting', 'periodic', 'inflow'}) – Boundary conditions. Not all bc are supported in all geometries (yet).
- abstractmethod set_dims(dims=None, nodes=None, restchannels=0)¶
Set LGCA dimensions. In the implementation, set
self.K,self.restchannelsandself.dimsto meaningful and consistent values.Must match what is done in
init_coords()andinit_nodes(). For arguments and attribute types seelgca.base.LGCA_base.
- set_interaction(**kwargs)¶
Set the interaction rule and respective needed parameters.
Set
self.interactionand possibly add entries inself.interaction_paramsandself.props. If inheritance is involved, initializeself.family_propsandself.maxfamily. Do not use this to specify a custom interaction. In order to do this (as of now),self.interactionandself.interaction_paramsmust be manipulated directly from an external script.- Parameters:
kwargs['interaction'] (str, default='random_walk') – Name of the predefined interaction in
lgca.interactions.**kwargs – Interaction parameters.
- set_r_int(r)¶
Change the interaction radius. Update shadow border nodes accordingly.
This has effects on
self.nodes, the coordinates and the computed fields.- Parameters:
r (int) – New interaction radius.
- timeevo(timesteps=100, record=False, recordN=False, recorddens=True, showprogress=True, recordfampop=False)¶
Perform a simulation of the LGCA for timesteps timesteps.
Different quantities can be recorded during the simulation, e.g. the total number of particles at each timestep. They are stored in LGCA attributes.
- Parameters:
timesteps (int, default=100) – How long the simulation should be performed.
record (bool, default=False) – Record the full lattice configuration for each timestep in
self.nodes_t.recorddens (bool, default=True) – Record the number of particles at each lattice site for each timestep in
self.dens_t.recordfampop (bool, default=False) – Record the population of all families for each timestep in
self.fam_pop_t.recordN (bool, default=False) – Record the total number of particles in the lattice for each timestep in
self.n_t.showprogress (bool, default=True) – Show a simple progress bar with a percentage of performed timesteps in the standard output.
- timestep()¶
Update the state of the LGCA from time k to k+1. Includes the interaction and propagation steps.
- total_population()¶
Calculate the amount of particles in the lattice.
- Returns:
Total population size.
- total_population_t(cutoff_abs=None, cutoff_rel=None)¶
Calculate the total population of cells at each simulation step. Requires a previous
self.timeevo()withrecordfampop=Truedue to the filtering option.- Parameters:
cutoff_abs (int) – Exclude families that never exceeded this population size in absolute numbers. cutoff_rel takes precedence over cutoff_abs.
cutoff_rel (float) – Exclude families that never exceeded this population size, expressed as a fraction of the total population. cutoff_rel takes precedence over cutoff_abs.
- Returns:
Number of cells at each timestep, dimensions:
timesteps+1.
- update_dynamic_fields()¶
Update “fields” from the current LGCA state that store important variables to compute other dynamic steps.
Computes
self.cell_density, number of particles at each lattice node, andself.occupied, a boolean array that shows which channels are occupied.
- abstract property velocitychannels: int¶
(Class attribute.) Number of velocity channels.