conway                package:simecol                R Documentation

_T_h_e _C_l_a_s_s_i_c_a_l _C_o_w_a_y'_s _G_a_m_e _o_f _L_i_f_e

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

     'simecol' example: This model simulates a deterministic 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:

          '_s_r_v' number of neighbours, necessary to survive,

          '_g_e_n' number of neighbours, necessary to generate a new cell.

     '_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: random).

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

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

_R_e_f_e_r_e_n_c_e_s:

     Gardner, Martin (1970) The Fantastic Combinations of John Conway's
      New Solitaire Game 'Life.' _Scientific American_, October 1970.

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

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

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

         data(conway)
         plot(sim(conway))

         # more interesting start conditions
         m <- matrix(0, 40, 40)
         m[5:35,19:21] <-1
         init(conway) <- m
         plot(sim(conway), col=c("white", "green"), axes=FALSE)

         # change survival rules
         parms(conway) <- list(srv=c(3,4), gen=c(3,4))
         plot(sim(conway), col=c("white", "green"), axes=FALSE)
         ## Not run: 
         init(conway) <- matrix(0, 10, 10)
         fixInit(conway) # enter some "1"
         sim(conway, animate=TRUE, delay=100)
         
     ## End(Not run)

