Domain class to coordinate the simulation. More...
#include <cpp_example.h>
Public Types | |
| using | baseEnv = Env< Domain, Cell, Tissue > |
| using | baseEnv = Env< Domain, Cell, Tissue > |
Public Member Functions | |
| Domain (bool _output_flag) | |
| virtual shared_ptr< Cell > | generate_agent (std::string agent_name) |
| virtual shared_ptr< Tissue > | generate_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< Cell > | generate_agent (std::string agent_name) |
| virtual shared_ptr< Tissue > | generate_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< Cell > | generate_agent (string class_name) |
| A template class to generate patch. More... | |
| virtual shared_ptr< Cell > | generate_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< Tissue > | find_empty_patch () |
| Finds empty patches in the entire domain. More... | |
| shared_ptr< Tissue > | find_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... | |
Domain class to coordinate the simulation.
Definition at line 13 of file cpp_example.h.
| using Domain::baseEnv = Env<Domain,Cell,Tissue> |
Definition at line 14 of file cpp_example.h.
| using Domain::baseEnv = Env<Domain,Cell,Tissue> |
Definition at line 14 of file cpp_example.h.
|
inline |
Definition at line 16 of file cpp_example.h.
|
inline |
Definition at line 16 of file cpp_example.h.
|
inline |
Definition at line 78 of file cpp_example.h.
| void Domain::damage | ( | ) |
|
inline |
Definition at line 130 of file cpp_example.h.
| void Domain::episode | ( | ) |
|
inlinevirtual |
Definition at line 60 of file cpp_example.h.
|
virtual |
Reimplemented from Env< Domain, Cell, Tissue >.
Definition at line 65 of file cpp_example.h.
Reimplemented from Env< Domain, Cell, Tissue >.
|
inline |
Definition at line 142 of file cpp_example.h.
| void Domain::output | ( | ) |
|
inline |
Definition at line 70 of file cpp_example.h.
| void Domain::setup | ( | ) |
|
inlinevirtual |
Reimplemented from Env< Domain, Cell, Tissue >.
Definition at line 101 of file cpp_example.h.
|
virtual |
Reimplemented from Env< Domain, Cell, Tissue >.
|
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.
|
virtual |
Update the world. All built-in utilities such as Agent::order_move are executed here.
Reimplemented from Env< Domain, Cell, Tissue >.
| std::map< std::string, std::vector< int > > Domain::data = {{"cell_count",{}}} |
Definition at line 28 of file cpp_example.h.
| double Domain::memory_usage_max |
Definition at line 34 of file cpp_example.h.
| bool Domain::output_flag = false |
Definition at line 19 of file cpp_example.h.
| int Domain::tick =0 |
Definition at line 29 of file cpp_example.h.
1.8.19