aether::default_sim_state< T > Struct Template Reference

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
 

Detailed Description

template<typename T>
struct aether::default_sim_state< T >

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.

Member Typedef Documentation

template<typename T >
using aether::default_sim_state< T >::agent_reference = T *
template<typename T >
using aether::default_sim_state< T >::opaque_iterator_type = OpaqueIterator

Constructor & Destructor Documentation

template<typename T >
aether::default_sim_state< T >::default_sim_state ( )
default
template<typename T >
aether::default_sim_state< T >::~default_sim_state ( )
virtual

Member Function Documentation

template<typename T >
void aether::default_sim_state< T >::clear_ghost_agents ( )

Remove all nearby agent references from this cell.

template<typename T >
void aether::default_sim_state< T >::drop_agent_local ( size_t  index)

Removes the agent from the local list.

template<typename T >
template<typename Agent >
Agent & aether::default_sim_state< T >::insert_agent_ghost ( Agent &&  agent)

Add a ghost agent.

template<typename T >
template<typename Agent >
Agent & aether::default_sim_state< T >::insert_agent_local ( Agent &&  agent)

Add a local agent.

template<typename T >
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().

template<typename T >
default_sim_state< T >::OpaqueIterator aether::default_sim_state< T >::iterate_ghost ( )

An iterator over the nearby T.

template<typename T >
default_sim_state< T >::OpaqueIterator aether::default_sim_state< T >::iterate_local ( )

An iterator over the local T.

template<typename 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.

template<typename T >
size_t aether::default_sim_state< T >::num_agents_local ( ) const

The number of agents in the cell.s.

template<typename T >
virtual void aether::default_sim_state< T >::post_insert_agent_hook ( T &  agent)
inlinevirtual

hook called after an agent was added

Parameters
agent- the added agent
template<typename T >
virtual void aether::default_sim_state< T >::pre_remove_agent_hook ( T &  agent)
inlinevirtual

hook called after an agent had ben removed

Parameters
agent- the added agent
template<typename T >
template<typename F >
void aether::default_sim_state< T >::reclassify_agents ( is_contained)

Runs through all unclassified T and sets them as either local or ghost.

Member Data Documentation

template<typename T >
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.

template<typename T >
std::vector<T*> aether::default_sim_state< T >::local_points

The list of T that are contained within the cell.

template<typename T >
std::vector<T*> aether::default_sim_state< T >::unclassified_points
protected