environment provides the Environment class which represents the environment in which Organism‘s live. The environment is essentially an MxN grid. Each square of the grid contains concentrations of each of the chemicals in existence.
These grids can be created in a number of ways, from uniform concentrations of all chemicals, to user-specified hotspots that spread outward.
Later versions of this project may include the possibility of chemical diffusion over time, or other ways of modifying the environment as the simulation progresses. For now, however, those methods are not fully implemented.
Pykaryote Environments
Environment(size, grid=None, name=’‘, data=’‘, log=True)
The environment in which organisms live.
Args:
- size (tuple): The dimensions of the environment. (X,Y) or (X,Y,Z)
- currently supported only for dim = 2
- grid (array): The chemical grid of the environment. If None, the
grid will be created based on the parameters in the configuration file. The last dimension holds the number of each type of chemicals.
For example, to access the number of chemical-2 at location (5, 7), use:
num_chemical_2 = environment.grid[5, 7, 2]
complexes: object
Diffuses chemicals between cells.
Chemicals diffuse between cells at a controlled rate. Not fully implemented Update to use numpy array addition
dim: tuple
families: object
gaussians: list
Returns a lisf of the chemical gaussians at the given cell location.
If no chemical gaussians are present, returns None.
grid: numpy.ndarray
grid_type: str
Returns a random location in the environment grid.