BioDynaMo
v1.05.120-25dc9790
|
#include <behavior.h>
Public Member Functions | |
Behavior () | |
virtual | ~Behavior ()=default |
virtual Behavior * | New () const =0 |
Create a new instance of this object using the default constructor. More... | |
virtual Behavior * | NewCopy () const =0 |
Create a new copy of this behavior. More... | |
virtual void | Initialize (const NewAgentEvent &event) |
virtual void | Update (const NewAgentEvent &event) |
virtual void | Run (Agent *agent)=0 |
void | AlwaysCopyToNew () |
Always copy this behavior to new agents. More... | |
void | NeverCopyToNew () |
Never copy this behavior to new agents. More... | |
void | CopyToNewIf (const std::initializer_list< NewAgentEventUid > &uids) |
void | AlwaysRemoveFromExisting () |
void | NeverRemoveFromExisting () |
void | RemoveFromExistingIf (const std::initializer_list< NewAgentEventUid > &uids) |
bool | WillBeCopied (NewAgentEventUid event) const |
bool | WillBeRemoved (NewAgentEventUid event) const |
void * | operator new (size_t size) |
void | operator delete (void *p) |
Private Member Functions | |
BDM_CLASS_DEF (Behavior, 2) | |
Private Attributes | |
NewAgentEventUid | copy_mask_ = 0 |
NewAgentEventUid | remove_mask_ = 0 |
Behavior encapsulates logic to decide for which NewAgentEventUids a behavior should be copied to the new agent and/or removed from existing one. The default behavior is never copy to new agents, and never remove from existing agents.
Definition at line 29 of file behavior.h.
|
inline |
Definition at line 31 of file behavior.h.
|
virtualdefault |
|
inline |
Always copy this behavior to new agents.
Definition at line 63 of file behavior.h.
|
inline |
Always remove this behavior from the existing agent if a new agent is created.
Definition at line 78 of file behavior.h.
|
private |
|
inline |
If a new agent will be created with one of these NewAgentEventUids, this behavior will be copied to the new agent.
Definition at line 70 of file behavior.h.
|
inlinevirtual |
This method is called to initialize new behaviors that are created during a NewAgentEvent. Override this method to initialize attributes of your own Behavior subclasses. NB: Don't forget to call the implementation of the base class first. Base::Initialize(event);
Failing to do so will result in errors.
Reimplemented in bdm::StatelessBehavior, bdm::Secretion, bdm::GeneRegulation, bdm::Chemotaxis, and bdm::GrowthDivision.
Definition at line 47 of file behavior.h.
|
inline |
Never copy this behavior to new agents.
Definition at line 67 of file behavior.h.
|
inline |
Never remove this behavior from the existing agent if a new agent is created.
Definition at line 83 of file behavior.h.
|
pure virtual |
Create a new instance of this object using the default constructor.
|
pure virtual |
Create a new copy of this behavior.
|
inline |
Definition at line 114 of file behavior.h.
|
inline |
Definition at line 105 of file behavior.h.
|
inline |
If a new agent will be created with one of these NewAgentEventUids, this behavior will be removed from the existing agent.
Definition at line 86 of file behavior.h.
|
pure virtual |
Implemented in bdm::GeneRegulation, bdm::StatelessBehavior, bdm::GrowthDivision, bdm::Secretion, and bdm::Chemotaxis.
|
inlinevirtual |
This method is called to update the existing behavior at the end of a NewAgentEvent. Override this method to update attributes of your own Behavior subclasses. NB: Don't forget to call the implementation of the base class first. Base::Update(event);
Failing to do so will result in errors.
Definition at line 58 of file behavior.h.
|
inline |
Function returns whether the behavior will be copied for the given event.
Definition at line 95 of file behavior.h.
|
inline |
Function returns whether the behavior will be removed for the given event.
Definition at line 101 of file behavior.h.
|
private |
Definition at line 124 of file behavior.h.
|
private |
Definition at line 125 of file behavior.h.