fdschneider / caspr

Cellular Automata for Spatial Pressure in R
MIT License
4 stars 0 forks source link

Test for simulation stop in while loop ? #38

Closed alexgenin closed 9 years ago

alexgenin commented 9 years ago

I think there is a problem with the test in the while loop in ca() that tests whether to stop the simulation or not (line 162). Currently the following code will run forever, although it is obviously stable (lattice is empty) :

ca(init_landscape(c("+","0","-"), c(0, 1, 0)), musselbed, 
   t_max = 450, stopifsteady = TRUE)

Also, but that's a minor quirk: the test uses & and | operators where it should really use && and ||.

alexgenin commented 9 years ago

Should be fixed now in 853dfac608849f37595ae65a427307e7d4a56742