Open charlos1204 opened 2 years ago
Hi @charlos1204, yes this is definitely possible! The returned simulation object can be used to continue a simulation! Something like this should work:
library(BacArena)
data(Ec_core)
arena <- Arena(n=10,m=10)
ec <- Bac(Ec_core)
arena <- addOrg(arena, ec, amount=5)
arena <- addDefaultMed(arena, ec)
sim <- simEnv(arena, time=2)
sim2 <- simEnv(sim, time=2)
Maybe you can give it a try?
Thanks @jotech you for your quick response. I have tried it. But my question was, if I run the simEnv for 5 time steps like this: sim <- simEnv(arena, time=5) and then I want to ignore the last two time steps and rerun the simulation to reach the 5 steps again. How can I make simEnv ignore the last two time steps? Because if I run the simulation like this: sim2 <- simEnv(sim, time=2) It's going to add two more time steps, instead of replacing time steps 4 and 5.
Thanks and sorry for not being clear in my initial question.
Thank you @jotech for your answer! In other words: Assume we have done a simulation of 5 time steps. Is it possible to use the situation after time step 3 as initial condition for a new simulation? Perhaps as explanation: Eventually, we want to simulate a community which, shortly before a species is getting extinct, receives additional nutrients. Hence, we need to run a simulation, check when the first species gets extinct, fix the conditions (abundances, nutrient concentration) some steps earlier and restart the simulation from there, just adding some additional nutrients. I hope this is more or less understandable. Best regards, Hannah
Hi,
Is there a way to continue a simulation at desired time step? For example, if my simulation ended at time step 45 and I want to continue the simulation from time step 40. How can I achieve this? Is there a way to do so?
Thanks in advance