Struct AgentFunctionData

Struct Documentation

struct AgentFunctionData

This is the internal data store for AgentFunctionDescription Users should only access that data stored within via an instance of AgentFunctionDescription

Public Functions

bool operator==(const AgentFunctionData &rhs) const

Equality operator, checks whether AgentFunctionData hierarchies are functionally the same

Note

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

Returns:

True when agent functions are the same

bool operator==(const CAgentFunctionDescription &rhs) const
bool operator!=(const AgentFunctionData &rhs) const

Equality operator, checks whether AgentFunctionData hierarchies are functionally different

Note

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

Returns:

True when agent functions are not the same

AgentFunctionData(const AgentFunctionData &other) = delete

Default copy constructor, not implemented

Public Members

std::weak_ptr<const ModelData> model

Parent model

AgentFunctionWrapper *func

The cuda kernel entry point for executing the agent function

See also

void agent_function_wrapper(detail::curve::Curve::NamespaceHash, detail::curve::Curve::NamespaceHash, detail::curve::Curve::NamespaceHash, detail::curve::Curve::NamespaceHash, const int, const void *, const unsigned int, const unsigned int)

std::string rtc_source

The string representing the RTC defined agent function

std::string rtc_func_name

The string representing the RTC defined agent function name

std::string initial_state

Agent’s must be in this state to execute this function

std::string end_state

Agent’s which execute this function leave in this state

std::weak_ptr<MessageBruteForce::Data> message_input

If set, this type of message is input to the function

std::weak_ptr<MessageBruteForce::Data> message_output

If set, this type of message is output by the function

bool message_output_optional

If set, message outputs from this function are optional

std::weak_ptr<AgentData> agent_output

If set, this is the agent type which is output by the function

std::string agent_output_state

If set, this is the agent type which is output by the function

bool has_agent_death = false

This must be marked to true if the agent function can return DEAD Enabling this tells FLAMEGPU to sort agents to remove those which have died from the population

AgentFunctionConditionWrapper *condition

The cuda kernel entry point for executing the agent function condition

See also

void agent_function_condition_wrapper(detail::curve::Curve::NamespaceHash, detail::curve::Curve::NamespaceHash, const int, const unsigned int, const unsigned int)

std::string rtc_condition_source

The string representing the RTC defined agent function condition

std::string rtc_func_condition_name

The string representing the RTC defined agent function condition

std::weak_ptr<AgentData> parent

The agent which this function is a member of

std::string name

Name of the agent function, used to refer to the agent function in many functions

std::string message_in_type

Input messaging type (as string) specified in FLAMEGPU_AGENT_FUNCTION. Used for type checking in model specification.

std::string message_out_type

Output messaging type (as string) specified in FLAMEGPU_AGENT_FUNCTION. Used for type checking in model specification.

Protected Functions

AgentFunctionData(const std::shared_ptr<const ModelData> &model, std::shared_ptr<AgentData> _parent, const AgentFunctionData &other)

Copy constructor This is unsafe, should only be used internally, use clone() instead

Parameters:
  • model – Model hierarchy root, used for performing lookup copies (e.g. messages)

  • _parent – Parent agent description

  • other – Agent function description being copied

AgentFunctionData(std::shared_ptr<AgentData> _parent, const std::string &function_name, AgentFunctionWrapper *agent_function, const std::string &in_type, const std::string &out_type)

Normal constructor, only to be called by AgentDescription

Parameters:
  • _parent – Parent agent description

  • function_name – User defined name of the agent function

  • agent_function – Pointer to compile time agent function

  • in_type – String form of the input message type

  • out_type – String form of the output message type

AgentFunctionData(std::shared_ptr<AgentData> _parent, const std::string &function_name, const std::string &rtc_function_src, const std::string &in_type, const std::string &out_type, const std::string &code_func_name)

Normal constructor for RTC function, only to be called by AgentDescription

Parameters:
  • _parent – Parent agent description

  • function_name – User defined name of the agent function

  • rtc_function_src – Pointer to runtime agent function

  • in_type – String form of the input message type

  • out_type – String form of the output message type

  • code_func_name – Name of the RTC agent function

Friends

friend class AgentDescription
friend struct ModelData
friend std::shared_ptr<const AgentData> clone() const

Cloning an AgentData requires access to AgentFunctionData for building the cloned function map