Learn R Programming

BacArena (version 1.0.1)

simEnv: Main function for simulating all processes in the environment

Description

The generic function simEnv for a simple simulation of the environment.

Usage

simEnv(object, time, lrw = NULL, continue = F)
"simEnv"(object, time, lrw = NULL, continue = F)

Arguments

object
An object of class Arena or Eval.
time
A number giving the number of iterations to perform for the simulation
lrw
A numeric value needed by solver to estimate array size (by default lwr is estimated in the simEnv() by the function estimate_lrw())
continue
A boolean indicating whether the simulation should be continued or restarted.

Value

Returns an object of class Eval which can be used for subsequent analysis steps.

Details

The returned object itself can be used for a subsequent simulation, due to the inheritance between Eval and Arena.

See Also

Arena-class and Eval-class

Examples

Run this code
data(Ec_core, envir = environment()) #get Escherichia coli core metabolic model
bac <- Bac(Ec_core,deathrate=0.05,
           growthlimit=0.05,growtype="exponential") #initialize a bacterium
arena <- Arena(n=20,m=20) #initialize the environment
addOrg(arena,bac,amount=10) #add 10 organisms
addSubs(arena,40) #add all possible substances
eval <- simEnv(arena,10)

Run the code above in your browser using DataLab