Struct ModelData

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< ModelData >

Struct Documentation

struct flamegpu::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 unsigned int size_type

Common size type used in the definition of models

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::list<std::shared_ptr<LayerData>> LayerList

List of layer definitions list<LayerData>

typedef std::set<FLAMEGPU_INIT_FUNCTION_POINTER> InitFunctionSet

Set of Init function pointers set<FLAMEGPU_INIT_FUNCTION_POINTER>

typedef std::set<FLAMEGPU_STEP_FUNCTION_POINTER> StepFunctionSet

Set of Step function pointers set<FLAMEGPU_STEP_FUNCTION_POINTER>

typedef std::set<HostFunctionCallback*> HostFunctionCallbackSet

Set of Step function callback pointers set<HostFunctionCallback>

typedef std::set<HostFunctionConditionCallback*> HostFunctionConditionCallbackSet

Set of host condition callback pointers set<HostFunctionConditionCallback>

typedef std::set<FLAMEGPU_EXIT_FUNCTION_POINTER> ExitFunctionSet

Set of Exit function pointers set<FLAMEGPU_EXIT_FUNCTION_POINTER>

typedef std::set<FLAMEGPU_EXIT_CONDITION_POINTER> ExitConditionSet

Set of Exit condition pointers set<FLAMEGPU_EXIT_CONDITION_POINTER>

Public Functions

virtual ~ModelData()
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

bool operator!=(const ModelData &rhs) const

Equality operator, checks whether ModelData hierarchies are functionally different

Note

Instead compare pointers if you wish to check that they are not the same instance

Returns

True when models are not the same

ModelData::size_type getMaxLayerWidth() const
Returns

The maximum layer width within the model’s hierarchy

Public Members

AgentMap agents

Holds all of the model’s agent definitions

MessageMap messages

Holds all of the model’s message definitions

SubModelMap submodels

Holds all of the model’s sub models

LayerList layers

Holds all of the model’s layer definitions

InitFunctionSet initFunctions

Holds pointers to all of the init functions used by the model

HostFunctionCallbackSet initFunctionCallbacks
StepFunctionSet stepFunctions

Holds pointers to all of the step functions used by the model

HostFunctionCallbackSet stepFunctionCallbacks
ExitFunctionSet exitFunctions

Holds pointers to all of the exit functions used by the model

HostFunctionCallbackSet exitFunctionCallbacks
ExitConditionSet exitConditions

Holds pointers to all of the exit conditions used by the model

HostFunctionConditionCallbackSet exitConditionCallbacks
std::shared_ptr<EnvironmentDescription> 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