Base class for Agent.
More...
#include <bases.h>
|
| Agent (shared_ptr< ENV > env, string class_name) |
|
virtual | ~Agent () |
|
virtual void | step () |
|
virtual void | inherit (shared_ptr< AGENT > father) |
| To define agent behavior. More...
|
|
virtual void | update () |
| To define inheritage. More...
|
|
void | move (shared_ptr< PATCH > dest, bool quiet=false) |
| Moves the agent to the given destination patch. More...
|
|
void | order_hatch (shared_ptr< PATCH > patch=nullptr, bool inherit=false, bool quiet=false, bool reset=false) |
| Orders agent to hatch. This will execute during Env::update . More...
|
|
void | order_move (shared_ptr< PATCH > patch=nullptr, bool quiet=false, bool reset=false) |
| Orders agent to move. This will execute during Env::update . More...
|
|
void | order_switch (string to) |
|
void | reset_hatch () |
| Orders agent to switch to another agent. This will execute during Env::update . More...
|
|
void | reset_move () |
|
void | reset_switch () |
|
| Agent (shared_ptr< ENV > env, string class_name) |
|
virtual | ~Agent () |
|
virtual void | step () |
|
virtual void | inherit (shared_ptr< AGENT > father) |
| To define agent behavior. More...
|
|
virtual void | update () |
| To define inheritage. More...
|
|
void | move (shared_ptr< PATCH > dest, bool quiet=false) |
| Moves the agent to the given destination patch. More...
|
|
void | order_hatch (shared_ptr< PATCH > patch=nullptr, bool inherit=false, bool quiet=false, bool reset=false) |
| Orders agent to hatch. This will execute during Env::update . More...
|
|
void | order_move (shared_ptr< PATCH > patch=nullptr, bool quiet=false, bool reset=false) |
| Orders agent to move. This will execute during Env::update . More...
|
|
void | order_switch (string to) |
|
void | reset_hatch () |
| Orders agent to switch to another agent. This will execute during Env::update . More...
|
|
void | reset_move () |
|
void | reset_switch () |
|
|
std::pair< bool, std::string > | switch_info = std::make_pair(false,"") |
|
HATCH_CONFIG< ENV, AGENT, PATCH > | _hatch = HATCH_CONFIG<ENV,AGENT,PATCH>() |
|
MOVE_CONFIG< ENV, AGENT, PATCH > | _move = MOVE_CONFIG<ENV,AGENT,PATCH>() |
|
SWITCH_CONFIG | _switch = SWITCH_CONFIG() |
|
std::shared_ptr< PATCH > | patch |
| Pointer to the residing patch. More...
|
|
std::shared_ptr< ENV > | env |
| Pointer to the simulation world. More...
|
|
bool | disappear = false |
| if set to true, the agent will be removed from the simulation. This will execute during Env::update More...
|
|
string | class_name |
| Unique ID of this class. More...
|
|
bool | has_patch = false |
| Indicates if an agent residing on a patch. More...
|
|
template<class ENV, class AGENT, class PATCH>
struct Agent< ENV, AGENT, PATCH >
Base class for Agent.
Agent class simulates movable objects
Definition at line 103 of file bases.h.
◆ Agent() [1/2]
template<class ENV , class AGENT , class PATCH >
Agent< ENV, AGENT, PATCH >::Agent |
( |
shared_ptr< ENV > |
env, |
|
|
string |
class_name |
|
) |
| |
|
inline |
◆ ~Agent() [1/2]
template<class ENV , class AGENT , class PATCH >
◆ Agent() [2/2]
template<class ENV , class AGENT , class PATCH >
Agent< ENV, AGENT, PATCH >::Agent |
( |
shared_ptr< ENV > |
env, |
|
|
string |
class_name |
|
) |
| |
|
inline |
◆ ~Agent() [2/2]
template<class ENV , class AGENT , class PATCH >
◆ inherit() [1/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::inherit |
( |
shared_ptr< AGENT > |
father | ) |
|
|
inlinevirtual |
To define agent behavior.
Definition at line 113 of file bases.h.
◆ inherit() [2/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::inherit |
( |
shared_ptr< AGENT > |
father | ) |
|
|
inlinevirtual |
To define agent behavior.
Definition at line 113 of file bases.h.
◆ move() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::move |
( |
shared_ptr< PATCH > |
dest, |
|
|
bool |
quiet = false |
|
) |
| |
Moves the agent to the given destination patch.
◆ move() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::move |
( |
shared_ptr< PATCH > |
dest, |
|
|
bool |
quiet = false |
|
) |
| |
Moves the agent to the given destination patch.
◆ order_hatch() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_hatch |
( |
shared_ptr< PATCH > |
patch = nullptr , |
|
|
bool |
inherit = false , |
|
|
bool |
quiet = false , |
|
|
bool |
reset = false |
|
) |
| |
Orders agent to hatch. This will execute during Env::update
.
◆ order_hatch() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_hatch |
( |
shared_ptr< PATCH > |
patch = nullptr , |
|
|
bool |
inherit = false , |
|
|
bool |
quiet = false , |
|
|
bool |
reset = false |
|
) |
| |
Orders agent to hatch. This will execute during Env::update
.
◆ order_move() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_move |
( |
shared_ptr< PATCH > |
patch = nullptr , |
|
|
bool |
quiet = false , |
|
|
bool |
reset = false |
|
) |
| |
Orders agent to move. This will execute during Env::update
.
◆ order_move() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_move |
( |
shared_ptr< PATCH > |
patch = nullptr , |
|
|
bool |
quiet = false , |
|
|
bool |
reset = false |
|
) |
| |
Orders agent to move. This will execute during Env::update
.
◆ order_switch() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_switch |
( |
string |
to | ) |
|
|
inline |
◆ order_switch() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::order_switch |
( |
string |
to | ) |
|
|
inline |
◆ reset_hatch() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_hatch |
( |
| ) |
|
|
inline |
Orders agent to switch to another agent. This will execute during Env::update
.
Definition at line 126 of file bases.h.
◆ reset_hatch() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_hatch |
( |
| ) |
|
|
inline |
Orders agent to switch to another agent. This will execute during Env::update
.
Definition at line 126 of file bases.h.
◆ reset_move() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_move |
( |
| ) |
|
|
inline |
◆ reset_move() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_move |
( |
| ) |
|
|
inline |
◆ reset_switch() [1/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_switch |
( |
| ) |
|
|
inline |
◆ reset_switch() [2/2]
template<class ENV , class AGENT , class PATCH >
void Agent< ENV, AGENT, PATCH >::reset_switch |
( |
| ) |
|
|
inline |
◆ step() [1/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::step |
( |
| ) |
|
|
inlinevirtual |
◆ step() [2/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::step |
( |
| ) |
|
|
inlinevirtual |
◆ update() [1/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::update |
( |
| ) |
|
|
inlinevirtual |
To define inheritage.
Reimplemented in Cell, and Cell.
Definition at line 116 of file bases.h.
◆ update() [2/2]
template<class ENV , class AGENT , class PATCH >
virtual void Agent< ENV, AGENT, PATCH >::update |
( |
| ) |
|
|
inlinevirtual |
To define inheritage.
Reimplemented in Cell, and Cell.
Definition at line 116 of file bases.h.
◆ _hatch
template<class ENV , class AGENT , class PATCH >
◆ _move
template<class ENV , class AGENT , class PATCH >
◆ _switch
template<class ENV , class AGENT , class PATCH >
◆ class_name
template<class ENV , class AGENT , class PATCH >
string Agent< ENV, AGENT, PATCH >::class_name |
Unique ID of this class.
Definition at line 136 of file bases.h.
◆ disappear
template<class ENV , class AGENT , class PATCH >
bool Agent< ENV, AGENT, PATCH >::disappear = false |
if set to true, the agent will be removed from the simulation. This will execute during Env::update
Definition at line 135 of file bases.h.
◆ env
template<class ENV , class AGENT , class PATCH >
std::shared_ptr< ENV > Agent< ENV, AGENT, PATCH >::env |
Pointer to the simulation world.
Definition at line 134 of file bases.h.
◆ has_patch
template<class ENV , class AGENT , class PATCH >
bool Agent< ENV, AGENT, PATCH >::has_patch = false |
Indicates if an agent residing on a patch.
Definition at line 137 of file bases.h.
◆ patch
template<class ENV , class AGENT , class PATCH >
std::shared_ptr< PATCH > Agent< ENV, AGENT, PATCH >::patch |
Pointer to the residing patch.
Definition at line 133 of file bases.h.
◆ switch_info
template<class ENV , class AGENT , class PATCH >
std::pair< bool, std::string > Agent< ENV, AGENT, PATCH >::switch_info = std::make_pair(false,"") |
The documentation for this struct was generated from the following file:
- /Users/matin/Downloads/testProjs/CppyABM/include/cppyabm/bases.h