Class StateReader
Defined in File StateReader.h
Inheritance Relationships
Derived Types
public flamegpu::io::JSONStateReader
(Class JSONStateReader)public flamegpu::io::XMLStateReader
(Class XMLStateReader)
Class Documentation
-
class StateReader
Abstract representation of a class for importing model data (agent population data, environment properties, run configuration) from file
See also
XMLStateReader The XML implementation of a StateReader
See also
JSONStateReader The JSON implementation of a StateReader
Subclassed by flamegpu::io::JSONStateReader, flamegpu::io::XMLStateReader
Public Functions
Constructs a reader capable of reading model state from a specific format (this class is abstract) Environment properties will be read into the Simulation instance pointed to by ‘sim_instance_id’ Agent data will be read into ‘model_state’
- Parameters:
_model_name – Name from the model description hierarchy of the model to be loaded
_env_desc – Environment description for validating property data on load
_env_init – Dictionary of loaded values map:<{name, index}, value>
_model_state – Map of AgentVector to load the agent data into per agent, key should be agent name
input – Filename of the input file (This will be used to determine which reader to return)
_sim_instance – Instance of the simulation (for configuration data IO)
-
inline virtual ~StateReader()
Virtual destructor for correct inheritance behaviour
-
virtual int parse() = 0
Actually perform the file load
- Returns:
Returns a return code
Protected Attributes
-
util::StringPairUnorderedMap<std::shared_ptr<AgentVector>> &model_state
-
std::string inputFile
-
const std::string model_name
-
const std::unordered_map<std::string, EnvironmentData::PropData> &env_desc
-
Simulation *sim_instance