This is an object that represents the state of a village at a particular time.
initialize()Creates a new village
propagate()Advances the village a single time step
set_initial_state()Initializes the initial state of the village
nameAn optional name for the village
initial_conditionA function that sets the initial state of the village
current_stateThe village's current state
previous_stateThe village's previous state
modelsA list of functions or a single function that should be run at each timestep
model_dataOptional data that models may need
agent_mgrThe manager that handles all of the agents
resource_mgrThe manager that handles all of the resources Initializes a village
new()This method is meant to set the variables that are needed for a village to propagate through time.
village$new(
name,
initial_condition,
models = list(),
agent_class = villager::agent,
resource_class = villager::resource
)nameAn optional name for the village
initial_conditionA function that gets called on the first time step
modelsA list of functions or a single function that should be run at each time step
agent_classThe class that's being used to represent agents
resource_classThe class being used to describe the resources Propagates the village a single time step
propagate()village$propagate(current_step)current_stepThe current time step
This method is used to advance the village a single time step. It should NOT be used to set initial conditions. See the set_initial_state method.
None Runs the user defined function that sets the initial state of the village
set_initial_state()Runs the initial condition model
village$set_initial_state()
clone()The objects of this class are cloneable with this method.
village$clone(deep = FALSE)deepWhether to make a deep clone.
This class acts as a type of record that holds the values of the different village variables. This class can be subclassed to include more variables that aren't present.