#include <environment.h>
|
virtual | ~Environment ()=default |
|
void | MarkAsOutOfSync () |
|
void | Update () |
|
void | ForcedUpdate () |
| Updates the environment. Prefer Update() for implementations. More...
|
|
virtual void | ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Agent &query, real_t squared_radius)=0 |
|
virtual void | ForEachNeighbor (Functor< void, Agent * > &lambda, const Agent &query, void *criteria)=0 |
|
virtual void | ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Real3 &query_position, real_t squared_radius, const Agent *query_agent=nullptr)=0 |
|
virtual void | Clear ()=0 |
|
virtual std::array< int32_t, 6 > | GetDimensions () const =0 |
|
virtual std::array< int32_t, 2 > | GetDimensionThresholds () const =0 |
|
real_t | GetLargestAgentSize () const |
| Return the size of the largest agent. More...
|
|
real_t | GetLargestAgentSizeSquared () const |
|
virtual LoadBalanceInfo * | GetLoadBalanceInfo ()=0 |
|
virtual NeighborMutexBuilder * | GetNeighborMutexBuilder ()=0 |
|
bool | HasGrown () const |
|
Definition at line 30 of file environment.h.
◆ ~Environment()
virtual bdm::Environment::~Environment |
( |
| ) |
|
|
virtualdefault |
◆ CalcSimDimensionsAndLargestAgent()
void bdm::Environment::CalcSimDimensionsAndLargestAgent |
( |
std::array< real_t, 6 > * |
ret_grid_dimensions | ) |
|
|
inlineprotected |
Calculates what the grid dimensions need to be in order to contain all the agents
Definition at line 193 of file environment.h.
◆ Clear()
virtual void bdm::Environment::Clear |
( |
| ) |
|
|
pure virtual |
◆ ForcedUpdate()
void bdm::Environment::ForcedUpdate |
( |
| ) |
|
|
inline |
◆ ForEachNeighbor() [1/3]
virtual void bdm::Environment::ForEachNeighbor |
( |
Functor< void, Agent * > & |
lambda, |
|
|
const Agent & |
query, |
|
|
void * |
criteria |
|
) |
| |
|
pure virtual |
◆ ForEachNeighbor() [2/3]
◆ ForEachNeighbor() [3/3]
virtual void bdm::Environment::ForEachNeighbor |
( |
Functor< void, Agent *, real_t > & |
lambda, |
|
|
const Real3 & |
query_position, |
|
|
real_t |
squared_radius, |
|
|
const Agent * |
query_agent = nullptr |
|
) |
| |
|
pure virtual |
Iterates over all neighbors of a query position that appear in a distance of less than sqrt(squared_radius). Typically, the distance is computed as the Euclidean distance in 3D environments. Typically iterating over the neighbors of a certain agent or a certain position are fairly similar tasks. If you implement an environment, the optional argument agent_query can be used to to treat both cases in the same function, keep the implementation lean, and avoid redundant code.
Implemented in bdm::UniformGridEnvironment, bdm::KDTreeEnvironment, and bdm::OctreeEnvironment.
◆ GetDimensions()
virtual std::array<int32_t, 6> bdm::Environment::GetDimensions |
( |
| ) |
const |
|
pure virtual |
◆ GetDimensionThresholds()
virtual std::array<int32_t, 2> bdm::Environment::GetDimensionThresholds |
( |
| ) |
const |
|
pure virtual |
◆ GetLargestAgentSize()
real_t bdm::Environment::GetLargestAgentSize |
( |
| ) |
const |
|
inline |
Return the size of the largest agent.
Definition at line 94 of file environment.h.
◆ GetLargestAgentSizeSquared()
real_t bdm::Environment::GetLargestAgentSizeSquared |
( |
| ) |
const |
|
inline |
◆ GetLoadBalanceInfo()
◆ GetNeighborMutexBuilder()
◆ HasGrown()
bool bdm::Environment::HasGrown |
( |
| ) |
const |
|
inline |
◆ MarkAsOutOfSync()
void bdm::Environment::MarkAsOutOfSync |
( |
| ) |
|
|
inline |
This function informs the environment that it is no longer up to date and that the state of the simulation might not be reflected correctly in the current environment. For instance, the load balancing operation causes such a synchronization issue and therefore calls this member function.
Definition at line 44 of file environment.h.
◆ Update()
void bdm::Environment::Update |
( |
| ) |
|
|
inline |
Updates the environment if it is marked as out_of_sync_. This function should not be called in parallel regions for performance reasons.
Definition at line 48 of file environment.h.
◆ UpdateImplementation()
virtual void bdm::Environment::UpdateImplementation |
( |
| ) |
|
|
protectedpure virtual |
◆ has_grown_
bool bdm::Environment::has_grown_ = false |
|
protected |
◆ largest_object_size_
real_t bdm::Environment::largest_object_size_ = 0.0 |
|
protected |
The size of the largest object in the simulation.
Definition at line 128 of file environment.h.
◆ largest_object_size_squared_
real_t bdm::Environment::largest_object_size_squared_ = 0.0 |
|
protected |
◆ out_of_sync_
bool bdm::Environment::out_of_sync_ = true |
|
private |
The documentation for this class was generated from the following file: