cppyabm  1.0.17
An agent-based library to integrate C++ and Python
Public Types | Public Member Functions | Public Attributes | List of all members
Domain Struct Reference

Domain class to coordinate the simulation. More...

#include <cpp_example.h>

Inheritance diagram for Domain:
Env< Domain, Cell, Tissue >

Public Types

using baseEnv = Env< Domain, Cell, Tissue >
 
using baseEnv = Env< Domain, Cell, Tissue >
 

Public Member Functions

 Domain (bool _output_flag)
 
virtual shared_ptr< Cellgenerate_agent (std::string agent_name)
 
virtual shared_ptr< Tissuegenerate_patch (MESH_ITEM)
 
virtual void update ()
 Update the world. All built-in utilities such as Agent::order_move are executed here. More...
 
void damage ()
 
void setup ()
 
virtual void step ()
 
void episode ()
 
void output ()
 
 Domain (bool _output_flag)
 
virtual shared_ptr< Cellgenerate_agent (std::string agent_name)
 
virtual shared_ptr< Tissuegenerate_patch (MESH_ITEM)
 
virtual void update ()
 Update the world. All built-in utilities such as Agent::order_move are executed here. More...
 
void damage ()
 
void setup ()
 
virtual void step ()
 
void episode ()
 
void output ()
 
- Public Member Functions inherited from Env< Domain, Cell, Tissue >
 Env ()
 
 Env ()
 
virtual ~Env ()
 
virtual ~Env ()
 
virtual shared_ptr< Cellgenerate_agent (string class_name)
 A template class to generate patch. More...
 
virtual shared_ptr< Cellgenerate_agent (string class_name)
 A template class to generate patch. More...
 
virtual void update_repo ()
 A template class to generate agent. More...
 
virtual void update_repo ()
 A template class to generate agent. More...
 
void setup_domain (vector< MESH_ITEM > mesh)
 Sets up the domain by creating patch objects in accordance to mesh objects. More...
 
void setup_domain (vector< MESH_ITEM > mesh)
 Sets up the domain by creating patch objects in accordance to mesh objects. More...
 
void setup_agents (map< string, unsigned > config)
 Creates agents and randomly distributes them in the simulation domain. More...
 
void setup_agents (map< string, unsigned > config)
 Creates agents and randomly distributes them in the simulation domain. More...
 
void step_agents ()
 Calls step function of agents. More...
 
void step_agents ()
 Calls step function of agents. More...
 
void step_patches ()
 Calls step function of patches. More...
 
void step_patches ()
 Calls step function of patches. More...
 
void place_agent (shared_ptr< Tissue > patch, shared_ptr< Cell > agent)
 Places the given agent in the given patch. Raises an exception if the patch is not available. More...
 
void place_agent (unsigned patch_index, shared_ptr< Cell > agent)
 Places the given agent in the given patch index. Raises an exception if the patch is not available. More...
 
void place_agent (shared_ptr< Tissue > patch, shared_ptr< Cell > agent)
 Places the given agent in the given patch. Raises an exception if the patch is not available. More...
 
void place_agent (unsigned patch_index, shared_ptr< Cell > agent)
 Places the given agent in the given patch index. Raises an exception if the patch is not available. More...
 
void place_agent_randomly (shared_ptr< Cell > agent)
 Places the given agent randomly in the domain. Raises exception if no patch is available. More...
 
void place_agent_randomly (shared_ptr< Cell > agent)
 Places the given agent randomly in the domain. Raises exception if no patch is available. More...
 
shared_ptr< Tissuefind_empty_patch ()
 Finds empty patches in the entire domain. More...
 
shared_ptr< Tissuefind_empty_patch ()
 Finds empty patches in the entire domain. More...
 
void remove_agent (shared_ptr< Cell > agent)
 
void remove_agent (shared_ptr< Cell > agent)
 
void process_switch ()
 Process swtich requests. More...
 
void process_switch ()
 Process swtich requests. More...
 
void process_hatch ()
 Process hatch requests. More...
 
void process_hatch ()
 Process hatch requests. More...
 
void process_move ()
 Process move requests. More...
 
void process_move ()
 Process move requests. More...
 
void process_disappear ()
 Process disappear requests. More...
 
void process_disappear ()
 Process disappear requests. More...
 
map< string, unsigned > count_agents ()
 steps the simulation More...
 
map< string, unsigned > count_agents ()
 steps the simulation More...
 
double memory_usage ()
 
double memory_usage ()
 

Public Attributes

bool output_flag = false
 
std::map< std::string, std::vector< int > > data = {{"cell_count",{}}}
 
int tick =0
 
double memory_usage_max
 
- Public Attributes inherited from Env< Domain, Cell, Tissue >
std::map< std::string, unsigned > agents_count
 Keeps the record the agents according to Agent::class_name. More...
 
std::set< string > agent_classes
 stores a list of Agent::class_name. More...
 
vector< shared_ptr< Cell > > agents
 Agent container. More...
 
map< unsigned, shared_ptr< Tissue > > patches
 Patch container. More...
 

Detailed Description

Domain class to coordinate the simulation.

Definition at line 13 of file cpp_example.h.

Member Typedef Documentation

◆ baseEnv [1/2]

Definition at line 14 of file cpp_example.h.

◆ baseEnv [2/2]

Definition at line 14 of file cpp_example.h.

Constructor & Destructor Documentation

◆ Domain() [1/2]

Domain::Domain ( bool  _output_flag)
inline

Definition at line 16 of file cpp_example.h.

◆ Domain() [2/2]

Domain::Domain ( bool  _output_flag)
inline

Definition at line 16 of file cpp_example.h.

Member Function Documentation

◆ damage() [1/2]

void Domain::damage ( )
inline

Definition at line 78 of file cpp_example.h.

◆ damage() [2/2]

void Domain::damage ( )

◆ episode() [1/2]

void Domain::episode ( )
inline

Definition at line 130 of file cpp_example.h.

◆ episode() [2/2]

void Domain::episode ( )

◆ generate_agent() [1/2]

shared_ptr< Cell > Domain::generate_agent ( std::string  agent_name)
inlinevirtual

Definition at line 60 of file cpp_example.h.

◆ generate_agent() [2/2]

virtual shared_ptr<Cell> Domain::generate_agent ( std::string  agent_name)
virtual

◆ generate_patch() [1/2]

shared_ptr< Tissue > Domain::generate_patch ( MESH_ITEM  mesh)
inlinevirtual

Reimplemented from Env< Domain, Cell, Tissue >.

Definition at line 65 of file cpp_example.h.

◆ generate_patch() [2/2]

virtual shared_ptr<Tissue> Domain::generate_patch ( MESH_ITEM  )
virtual

Reimplemented from Env< Domain, Cell, Tissue >.

◆ output() [1/2]

void Domain::output ( )
inline

Definition at line 142 of file cpp_example.h.

◆ output() [2/2]

void Domain::output ( )

◆ setup() [1/2]

void Domain::setup ( )
inline

Definition at line 70 of file cpp_example.h.

◆ setup() [2/2]

void Domain::setup ( )

◆ step() [1/2]

void Domain::step ( )
inlinevirtual

Reimplemented from Env< Domain, Cell, Tissue >.

Definition at line 101 of file cpp_example.h.

◆ step() [2/2]

virtual void Domain::step ( )
virtual

Reimplemented from Env< Domain, Cell, Tissue >.

◆ update() [1/2]

void Domain::update ( )
inlinevirtual

Update the world. All built-in utilities such as Agent::order_move are executed here.

Reimplemented from Env< Domain, Cell, Tissue >.

Definition at line 92 of file cpp_example.h.

◆ update() [2/2]

virtual void Domain::update ( )
virtual

Update the world. All built-in utilities such as Agent::order_move are executed here.

Reimplemented from Env< Domain, Cell, Tissue >.

Member Data Documentation

◆ data

std::map< std::string, std::vector< int > > Domain::data = {{"cell_count",{}}}

Definition at line 28 of file cpp_example.h.

◆ memory_usage_max

double Domain::memory_usage_max

Definition at line 34 of file cpp_example.h.

◆ output_flag

bool Domain::output_flag = false

Definition at line 19 of file cpp_example.h.

◆ tick

int Domain::tick =0

Definition at line 29 of file cpp_example.h.


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