Description Usage Arguments Details See Also Examples

The generic function `addOrg`

adds individuals to the environment.

1 2 3 4 5 6 7 |

`object` |
An object of class Arena. |

`specI` |
An object of class Organism. |

`amount` |
A numeric number giving the number of individuals to add. |

`x` |
A numeric vector giving the x positions of individuals on the grid. |

`y` |
A numeric vector giving the y positions of individuals on the grid. |

`posmat` |
A As an alternative to parameter x, y, a matrix with corrdinates an be specified |

`biomass` |
A numeric vector giving the starting biomass of the individuals. (unit: fg) |

`n0` |
Start column of matrix to take free positions from (default 1) |

`n` |
End column of matrix to take free positions from (default [email protected]) |

`m0` |
Start row of matrix to take free positions from (default 1) |

`m` |
End row of matrix to take free positions from (default [email protected]) |

The arguments `x`

and `y`

should be in the same length as the number of organisms added (given by the argument `amount`

).

`Arena-class`

and `Bac-class`

1 2 3 4 5 6 7 8 9 10 11 | ```
data(Ec_core, envir = environment()) #get Escherichia coli core metabolic model
bac <- Bac(Ec_core,deathrate=0.05,
minweight=0.05,growtype="exponential") #initialize a bacterium
arena <- Arena(n=20,m=20) #initialize the environment
arena <- addOrg(arena,bac,amount=10) #add 10 organisms
# Alternative way: adding organisms by giving matrix with positions
arena <- Arena(n=20,m=20)
mat <- matrix(sample(c(0,1), 400, replace = TRUE), nrow = 20, ncol = 20)
bac <- Bac(Ec_core)
arena <- addOrg(arena, specI=bac, posmat = mat)
``` |

BacArena documentation built on May 9, 2018, 5:04 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.