fpmas 1.6
Classes | Public Member Functions | List of all members
fpmas::model::BehaviorWithArgs< AgentType, Args > Class Template Reference

#include <model.h>

Inheritance diagram for fpmas::model::BehaviorWithArgs< AgentType, Args >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::BehaviorWithArgs< AgentType, Args >:
Collaboration graph
[legend]

Public Member Functions

 BehaviorWithArgs (void(AgentType::*behavior)(Args...), Args... args)
 
void execute (api::model::Agent *agent) const override
 
virtual void execute (Agent *agent) const =0
 

Detailed Description

template<typename AgentType, typename ... Args>
class fpmas::model::BehaviorWithArgs< AgentType, Args >

An api::model::Behavior implementation that can take some arbitrary arguments.

The arguments are provided in the constructor, and are passed to the specified behavior each time execute() is called. Using pointers or references can be used as arguments if dynamic parameter update is required.

Constructor & Destructor Documentation

◆ BehaviorWithArgs()

template<typename AgentType , typename ... Args>
fpmas::model::BehaviorWithArgs< AgentType, Args >::BehaviorWithArgs ( void(AgentType::*)(Args...)  behavior,
Args...  args 
)
inline

BehaviorWithArgs constructor.

Parameters
behaviorThe AgentType method that will be called by execute() with the specified arguments
argsargument list that will be passed to behavior

Member Function Documentation

◆ execute()

template<typename AgentType , typename ... Args>
void fpmas::model::BehaviorWithArgs< AgentType, Args >::execute ( api::model::Agent agent) const
inlineoverridevirtual

Calls behavior on the specified agent with the arguments specified in the constructor.

Parameters
agentagent to execute

Implements fpmas::api::model::Behavior.


The documentation for this class was generated from the following file: