data_writer | R Documentation |
A class responsible for the simulation data to disk.
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.
write()
Writes the agent and resources to disk.
Create a new data writer.
results_directory
The folder where the simulation results are written to
agent_filename
The location where the agents are written to
resource_filename
The 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_directory
The directory where the results file is written to
agent_filename
The name of the file for the agent data
resource_filename
The 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)
state
The village's village_state that's being written
village_name
The 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)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.