Environment — Pykaryote 1.1.0d documentation

### Navigation

- index
- modules |
- next |
- previous |
- Pykaryote 1.1.0d documentation »
- Modules »

# Environment

## Overview

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.

## Documentation

Pykaryote Environments

class `pykaryote.sim.environment.` `Environment`

  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`

    complexes: object

  `diffuse`(self)

    Diffuses chemicals between cells.

    Chemicals diffuse between cells at a controlled rate. Not fully implemented Update to use numpy array addition

  `dim`

    dim: tuple

  `families`

    families: object

  `gaussians`

    gaussians: list

  `gaussians_at_location`(self, location)

    Returns a lisf of the chemical gaussians at the given cell location.

    If no chemical gaussians are present, returns None.

  `grid`

    grid: numpy.ndarray

  `grid_type`

    grid_type: str

  `random_location`(self)

    Returns a random location in the environment grid.

### Navigation

- index
- modules |
- next |
- previous |
- Pykaryote 1.1.0d documentation »
- Modules »