Class StateReaderFactory

Class Documentation

class flamegpu::io::StateReaderFactory

Factory for creating instances of StateReader

Public Static Functions

static inline StateReader *createReader(const std::string &model_name, const std::unordered_map<std::string, EnvironmentDescription::PropData> &env_desc, util::StringUint32PairUnorderedMap<util::Any> &env_init, util::StringPairUnorderedMap<std::shared_ptr<AgentVector>> &model_state, const std::string &input, Simulation *sim_instance)

Returns a reader capable of reading ‘input’ 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 object (This is used for setting/getting config)

Throws

exception::UnsupportedFileType – If the file extension does not match an appropriate reader