This is the default implementation of cell state without using the ecs. More...
#include <types.hh>
Classes | |
class | OpaqueIterator |
This must be implemented as part of cell_state. More... | |
Public Types | |
using | agent_reference = T * |
using | opaque_iterator_type = OpaqueIterator |
Public Member Functions | |
default_sim_state ()=default | |
virtual | ~default_sim_state () |
void | clear_ghost_agents () |
Remove all nearby agent references from this cell. More... | |
template<typename Agent > | |
Agent & | insert_agent_local (Agent &&agent) |
Add a local agent. More... | |
template<typename Agent > | |
Agent & | insert_agent_ghost (Agent &&agent) |
Add a ghost agent. More... | |
virtual void | post_insert_agent_hook (T &agent) |
hook called after an agent was added More... | |
virtual void | pre_remove_agent_hook (T &agent) |
hook called after an agent had ben removed More... | |
void | insert_agent_unclassified (agent_reference agent) |
Used by the default handover to add an agent to a cell. More... | |
size_t | num_agents_local () const |
The number of agents in the cell.s. More... | |
size_t | num_agents_ghost () const |
The number of agents in neighbouring cells that are close enough to be visible in this cell. More... | |
opaque_iterator_type | iterate_local () |
An iterator over the local T. More... | |
opaque_iterator_type | iterate_ghost () |
An iterator over the nearby T. More... | |
void | drop_agent_local (size_t index) |
Removes the agent from the local list. More... | |
template<typename F > | |
void | reclassify_agents (F is_contained) |
Runs through all unclassified T and sets them as either local or ghost. More... | |
Public Attributes | |
std::vector< T * > | local_points |
The list of T that are contained within the cell. More... | |
std::vector< T * > | foreign_points |
The list of T that are in neighbouring cells, and close enough to this cell to be visible. More... | |
Protected Attributes | |
std::vector< T * > | unclassified_points |
This is the default implementation of cell state without using the ecs.
Any class that implements the functions and typedefs contained in this can be used as octree_params_default::cell_state_type. T must be a type of actor that can move from cell to cell.
using aether::default_sim_state< T >::agent_reference = T * |
using aether::default_sim_state< T >::opaque_iterator_type = OpaqueIterator |
|
default |
|
virtual |
void aether::default_sim_state< T >::clear_ghost_agents | ( | ) |
Remove all nearby agent references from this cell.
void aether::default_sim_state< T >::drop_agent_local | ( | size_t | index | ) |
Removes the agent from the local list.
Agent & aether::default_sim_state< T >::insert_agent_ghost | ( | Agent && | agent | ) |
Add a ghost agent.
Agent & aether::default_sim_state< T >::insert_agent_local | ( | Agent && | agent | ) |
Add a local agent.
void aether::default_sim_state< T >::insert_agent_unclassified | ( | agent_reference | agent | ) |
Used by the default handover to add an agent to a cell.
It is later reclassified by reclassify_agents().
default_sim_state< T >::OpaqueIterator aether::default_sim_state< T >::iterate_ghost | ( | ) |
An iterator over the nearby T.
default_sim_state< T >::OpaqueIterator aether::default_sim_state< T >::iterate_local | ( | ) |
An iterator over the local T.
size_t aether::default_sim_state< T >::num_agents_ghost | ( | ) | const |
The number of agents in neighbouring cells that are close enough to be visible in this cell.
size_t aether::default_sim_state< T >::num_agents_local | ( | ) | const |
The number of agents in the cell.s.
|
inlinevirtual |
hook called after an agent was added
agent | - the added agent |
|
inlinevirtual |
hook called after an agent had ben removed
agent | - the added agent |
void aether::default_sim_state< T >::reclassify_agents | ( | F | is_contained | ) |
Runs through all unclassified T and sets them as either local or ghost.
std::vector<T*> aether::default_sim_state< T >::foreign_points |
The list of T that are in neighbouring cells, and close enough to this cell to be visible.
std::vector<T*> aether::default_sim_state< T >::local_points |
The list of T that are contained within the cell.
|
protected |