init_simulation: Initialize a growth simulation.

View source: R/growthSimulation.R

init_simulationR Documentation

Initialize a growth simulation.

Description

Method to initialize a growthSimulation object

Usage

init_simulation(
  universePolygon,
  gridFieldSize = 1,
  gridFieldLayers = 3,
  deltaTime = 1/6,
  rMotion = 0.1
)

Arguments

universePolygon

A two column matrix specifying the x and y coordinates of the polygon corners, that describe the growth environment boundaries. Alternatively, a character indicating one of the polygon presets can be provided (see details).

gridFieldSize

double. Distance between neighboring environments 3D mesh field elements (rhombic dodecahedrons) in μm.

gridFieldLayers

integer. z-dimension (height) as the number of layers of field elements.

deltaTime

double specifying the length of each time step for the simulation in hours.

rMotion

double. Maximum distance a cell can travel by means of Brownian motion in μ per minute. Default: 0.1 μm

Details

Available universe polygon presets:

  • "Petri_<R>" is a Petri dish-like object (actually a 99-corner polygon), where '<R>' should be replaced with an integer, indicating the radius of the dish in μm.

  • "Rectangle_<X>_<Y>" is a, *surprise*, rectangle. '<X>' and '<Y>' should be integers specifying the width and height in μm, respectively.

  • "Kiel_<L>" let microbes thrive within Kiel's city limits. Use '<L>' to specify the latitude dimension in μm (integer). The longitude is automatically scaled accordingly.

Value

Object of class growthSimulation.

Examples

# Construction a square environment of dimensions 100\eqn{\mu}m x 120\eqn{\mu}m x 3\eqn{\mu}m
sim <- init_simulation(cbind(c(-50, -50, 50, 50),
                             c(-60, 60, 60, -60)),
                       gridFieldSize = 1, gridFieldLayers = 3)
sim <- init_simulation("rectangle_100_120", gridFieldSize = 1,
                       gridFieldLayers = 3)

# Construct a Petri dish-like simulation environment (radius: 75 \eqn{\mu}m)
sim <- init_simulation("Petri_75", gridFieldSize = 1,
                       gridFieldLayers = 3)


Waschina/Eutropia documentation built on Jan. 4, 2023, 12:42 p.m.