Struct ModelData
Defined in File ModelData.h
Inheritance Relationships
Base Type
public std::enable_shared_from_this< ModelData >
Struct Documentation
-
struct ModelData : public std::enable_shared_from_this<ModelData>
This is the internal data store for ModelDescription Users should only access that data stored within via an instance of ModelDescription
Public Types
-
typedef std::unordered_map<std::string, std::shared_ptr<AgentData>> AgentMap
Map of name:agent definition map<string, AgentData>
-
typedef std::unordered_map<std::string, std::shared_ptr<MessageBruteForce::Data>> MessageMap
Map of name:message definition map<string, MessageData>
-
typedef std::unordered_map<std::string, std::shared_ptr<SubModelData>> SubModelMap
Map of name:message definition map<string, MessageData>
-
typedef std::vector<FLAMEGPU_INIT_FUNCTION_POINTER> InitFunctionVector
Vector of Init function pointers. Uses a vector rather than a set to preserve order.
-
typedef std::vector<FLAMEGPU_STEP_FUNCTION_POINTER> StepFunctionVector
Vector of Step function pointers. Uses a vector rather than a set to preserve order.
-
typedef std::vector<HostFunctionCallback*> HostFunctionCallbackVector
Vector of Step function callback pointers. Uses a vector rather than a set to preserve order.
-
typedef std::vector<HostConditionCallback*> HostConditionCallbackVector
Vector of host condition callback pointers. Uses a vector rather than a set to preserve order.
-
typedef std::vector<FLAMEGPU_EXIT_FUNCTION_POINTER> ExitFunctionVector
Vector of Exit function pointers. Uses a vector rather than a set to preserve order.
-
typedef std::vector<FLAMEGPU_EXIT_CONDITION_POINTER> ExitConditionVector
Vector of Exit condition pointers. Uses a vector rather than a set to preserve order.
Public Functions
-
virtual ~ModelData() = default
-
std::shared_ptr<ModelData> clone() const
Creates a copy of the entire model definition hierarchy This is called when a ModelDescription is passed to a Simulation (e.g. CUDASimulation)
-
bool operator==(const ModelData &rhs) const
Equality operator, checks whether ModelData hierarchies are functionally the same
Note
Instead compare pointers if you wish to check that they are the same instance
- Returns:
True when models are the same
Public Members
-
MessageMap messages
Holds all of the model’s message definitions
-
SubModelMap submodels
Holds all of the model’s sub models
-
InitFunctionVector initFunctions
Holds pointers to all of the init functions used by the model
-
HostFunctionCallbackVector initFunctionCallbacks
-
StepFunctionVector stepFunctions
Holds pointers to all of the step functions used by the model
-
HostFunctionCallbackVector stepFunctionCallbacks
-
ExitFunctionVector exitFunctions
Holds pointers to all of the exit functions used by the model
-
HostFunctionCallbackVector exitFunctionCallbacks
-
ExitConditionVector exitConditions
Holds pointers to all of the exit conditions used by the model
-
HostConditionCallbackVector exitConditionCallbacks
-
std::shared_ptr<EnvironmentData> environment
Holds all of the model’s environment property definitions
-
std::string name
The name of the model This must be unique among Simulation (e.g. CUDASimulation) instances
-
std::shared_ptr<DependencyGraph> dependencyGraph
The dependency graph representing the dependencies of agent functions, submodels and host functions for this model.
Public Static Attributes
-
static const char *DEFAULT_STATE = "default"
Default state, all agents and agent functions begin in/with this state
Protected Functions
-
explicit ModelData(const ModelData &other)
Copy constructor This should only be called via clone();
-
explicit ModelData(const std::string &model_name)
Normal constructor This should only be called by ModelDescription
Constructors
Protected Attributes
- friend SubModelData
Friends
- friend class ModelDescription
-
typedef std::unordered_map<std::string, std::shared_ptr<AgentData>> AgentMap