CA                  package:simecol                  R Documentation

_S_t_o_c_h_a_s_t_i_c _C_e_l_l_u_l_a_r _A_u_t_o_m_a_t_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     'simecol' example: This model simulates a stochastic cellular
     automaton.

_U_s_a_g_e:

     data(conway)

_F_o_r_m_a_t:

     An S4 object according to the 'gridModel' specification.  The
     object contains the following slots:

     '_m_a_i_n' Functions with the state transition rules of Coway's Game
          of Life.

     '_p_a_r_m_s' A list with two vector elements:

          '_p_b_i_r_t_h' probability of birth,

          '_p_d_e_a_t_h' death probability, dependend on neighbors

     '_t_i_m_e_s' Number of time steps to be simulated.

     '_i_n_i_t' A matrix, giving the initial state of the cellular grid
          (default: rectangle in the middle of the grid).

_D_e_t_a_i_l_s:

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

_S_e_e _A_l_s_o:

     'sim', 'parms', 'init', 'times'.

_E_x_a_m_p_l_e_s:

         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))
         ))

