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
-
inline virtual ~StateReader()
Virtual destructor for correct inheritance behaviour
Loads the file to an internal data-structure
- Parameters:
input_file – Path to file to be read
model – Model description to ensure file loaded is suitable
verbosity – Verbosity level to use during load
Grab the full simulation state from the input file
Note
CUDASimulation Config is not included and should be requested separately
-
void getSimulationConfig(Simulation::Config &cfg)
Overwrite the provided simulation config with the one loaded from file
- Parameters:
cfg – The config struct to be overwritten
- Throws:
If – the parsed file did not contain a simulation config or a file has not been parsed
-
void getCUDAConfig(CUDASimulation::Config &cfg)
Overwrite the provided CUDA config with the one loaded from file
- Parameters:
cfg – The config struct to be overwritten
- Throws:
If – the parsed file did not contain a CUDA config or a file has not been parsed
-
void getMacroEnvironment(std::unordered_map<std::string, std::vector<char>> ¯o_environment_init)
Protected Functions
-
void resetCache()
Protected Attributes
-
std::string input_filepath
-
std::unordered_map<std::string, std::any> simulation_config
-
std::unordered_map<std::string, std::any> cuda_config
-
std::unordered_map<std::string, std::vector<char>> macro_env_init
-
util::StringPairUnorderedMap<std::shared_ptr<AgentVector>> agents_map
-
inline virtual ~StateReader()