A class responsible for the simulation data to disk.
write()Writes the agent and resources to disk.
Create a new data writer.
results_directoryThe folder where the simulation results are written to
agent_filenameThe location where the agents are written to
resource_filenameThe location where the resources are written to
new()Creates a new data writer object that has optional paths for data files.
data_writer$new(
results_directory = "results",
agent_filename = "agents.csv",
resource_filename = "resources.csv"
)results_directoryThe directory where the results file is written to
agent_filenameThe name of the file for the agent data
resource_filenameThe name of the file for the resource data
A new agent object Writes a village's state to disk.
write()Takes a state an the name of a village and writes the agents and resources to disk
data_writer$write(state, village_name)stateThe village's village_state that's being written
village_nameThe name of the village. This is used to create the data directory
None
clone()The objects of this class are cloneable with this method.
data_writer$clone(deep = FALSE)deepWhether to make a deep clone.
This class can be subclasses to provide advanced data writing to other data sources. This should also be subclassed if the agent and resource classes are subclasses, to write any additional fields to the data source.