Skip to content
Prev 4267 / 29559 Next

question about simulating patchy landscapes [solved]

Dylan,

You might also want to explore cellular based models.

Here is an example, somebody else posted this to the R site but I don't
recall who to give credit to.
This a patch model which considers changes to the "landscape" over time.

Have fun.

library(simecol)

CA <- new("gridModel", main = function(time, init, parms) {
    z <- init
    nb <- eightneighbors(z)
    pgen <- 1 - (1-parms$pbirth)^nb
    zgen <- ifelse(z == 0 &
              runif(z) < pgen, 1, 0)
    zsurv <- ifelse(z >= 1 &
              runif(z) < (1 - parms$pdeath), z + 1, 0)
    zgen + zsurv
    },
    parms = list(pbirths = 0.02, pdeath = 0.01),
    times = c(from = 1, to = 50, by = 1),
    init = matrix(0, nrow = 30, ncol = 30),
    solver = "iteration"
)

init(CA)[18:22, 18:22] <- 1

data(CA, package = "simecol")

times(CA)
times(CA) <- c(to = 1000)
CA <- sim(CA)
plot(CA)


Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Office (305) 224 - 4282
Steve_Friedman at nps.gov


                                                                           
             Dylan Beaudette                                               
             <dylan.beaudette@                                             
             gmail.com>                                                 To 
             Sent by:                  r-sig-geo at stat.math.ethz.ch         
             r-sig-geo-bounces                                          cc 
             @stat.math.ethz.c                                             
             h                                                     Subject 
                                       Re: [R-sig-Geo] question about      
                                       simulating patchy landscapes        
             10/03/2008 10:49          [solved]                            
             AM MST                                                        
                                                                           
                                                                           
             Please respond to                                             
             dylan.beaudette at g                                             
                 mail.com
On Friday 03 October 2008, Dylan Beaudette wrote:
using
Oops. It looks like my second example works when I set 'beta=0.5'. Probably
my
lack of experience in this field that caused me to overlook the importance
of
this parameter. Anyone care to explain why?

Cheers,

Dylan
have
TRUE)
--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo