sim                 package:simecol                 R Documentation

_S_i_m_u_l_a_t_i_o_n _o_f '_s_i_m_O_b_j' _m_o_d_e_l _o_b_j_e_c_t_s

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

     This function provides the core functionality of the `simecol'
     package. Several methods depending on the class of the model are
     available.

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

       sim(obj, initialize=TRUE, ...)
       # sim(obj, animation=FALSE, delay=0, ...)

_A_r_g_u_m_e_n_t_s:

     obj: an object of class 'simObj' or one of its subclasses.

initialize: re-initialize the object if the object contains a
          user-defined initializing function ('initfunc'). Setting
          'initialize' to 'FALSE' can be useful to avoid time-consuming
          computations during initialization or to reproduce
          simulations of models which assign random values during the
          initialization process.

animation: logical value to switch animation on (for classes
          'gridModel' and 'rwalkModel'.

   delay: delay (in ms and in addition to the time needed for the
          simulation) between consecutive images (for 'gridModel's) or
          xy-plots (for 'rwalkModel's).

     ...: optional parameters passed to the solver function (e.g.
          'hmax' for 'lsoda').

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

     'sim' re-initializes the model object (if 'initialize==TRUE' and
     calls the appropriate solver, specified in the 'solver'-slot.
     Objects of class 'rwalkModel' and 'indbasedModel' are simulated by
     the default 'simObj' method. If you derive own sublasses from
     'simObj' it may be neccessary to write an appropriate 'sim' method
     and/or solver function.

_V_a_l_u_e:

     The function returns the complete 'simObj' instance with the
     simulation results in the 'out' slot.

_M_e_t_h_o_d_s:


     _o_b_j = "_s_i_m_O_b_j" simulates the respective model object with optional
          animation.

     _o_b_j = "_o_d_e_M_o_d_e_l" simulates the respective model object.

     _o_b_j = "_i_n_d_b_a_s_e_d_M_o_d_e_l" simulates the respective model object with
          optional animation.

     _o_b_j = "_g_r_i_d_M_o_d_e_l" simulates the respective model object with
          optional animation.

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

     data(lv)
     plot(sim(lv))

     lv2 <- lv
     parms(lv2)["k1"] <- 0.5
     lv2 <- sim(lv2)
     plot(out(lv2))

