![]() |
fpmas 1.6
|
#include <model.h>
Public Member Functions | |
template<typename ... T> | |
Behavior (T... behaviors) | |
void | execute (api::model::Agent *agent) const |
virtual void | execute (Agent *agent) const =0 |
api::model::Behavior implementation.
This Behavior can be defined from any sequence of member methods of AgentType.
|
inline |
Behavior constructor.
Builds an Agent behavior from the member methods specified as arguments. Those methods must take no argument, and will be called in the order specified on each Agent to which this behavior is applied.
Each agent
to which this behavior is applied must be of type AgentType, or be a child class of AgentType, so that specified methods can be called on agent
. Otherwise, the behavior of execute() is undefined.
Notice that AgentType might be an abstract class, and specified methods can be virtual. In such a case, this Behavior can be applied to any AgentType implementation.
behaviors | A comma separated list of AgentType member methods, in the form &AgentType::method |
|
inlinevirtual |
Executes this behavior on the specified agent
.
agent | on which this behavior must be executed. |
Implements fpmas::api::model::Behavior.