Learn R Programming

simecol (version 0.5-5)

CA: Stochastic Cellular Automaton

Description

simecol example: This model simulates a stochastic cellular automaton.

Usage

data(conway)

Arguments

Details

To see all details, please have a look into the implementation.

See Also

sim, parms, init, times.

Examples

Run this code
data(CA)
    times(CA)["to"] <- 10
    plot(sim(CA))

    set.seed(345)
    times(CA)["to"] <- 50
    CA <- sim(CA)

    library(lattice)
    tcol <- (terrain.colors(13))[-13]
    x <- out(CA, last=TRUE)
    x <- ifelse(x == 0, NA, x)
    print(levelplot(x,
                 cuts = 11,
                 col.regions = tcol,
                 colorkey=list(at=seq(0,55,5))
    ))

Run the code above in your browser using DataLab