|
| CopyExecutionContext (const std::shared_ptr< ThreadSafeAgentUidMap > &map, std::shared_ptr< std::vector< std::vector< Agent * >>> agents) |
|
| ~CopyExecutionContext () override |
|
void | SetupIterationAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | TearDownAgentOpsAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | Execute (Agent *agent, AgentHandle ah, const std::vector< Operation * > &operations) override |
|
| InPlaceExecutionContext (const std::shared_ptr< ThreadSafeAgentUidMap > &map) |
|
| ~InPlaceExecutionContext () override |
|
void | SetupIterationAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | TearDownIterationAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | SetupAgentOpsAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | TearDownAgentOpsAll (const std::vector< ExecutionContext * > &all_exec_ctxts) override |
|
void | Execute (Agent *agent, AgentHandle ah, const std::vector< Operation * > &operations) override |
|
void | ForEachNeighbor (Functor< void, Agent * > &lambda, const Agent &query, void *criteria) override |
|
void | ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Agent &query, real_t squared_radius) override |
|
void | ForEachNeighbor (Functor< void, Agent *, real_t > &lambda, const Real3 &query_position, real_t squared_radius) override |
|
void | AddAgent (Agent *new_agent) override |
| Adds the agent to the simulation (threadsafe, takes ownership). Note that we avoid the use of smart pointers for the agents to avoid unnecessary overhead during construction of the agent (performance argument). usage example : More...
|
|
void | RemoveAgent (const AgentUid &uid) override |
|
Agent * | GetAgent (const AgentUid &uid) override |
|
const Agent * | GetConstAgent (const AgentUid &uid) override |
|
virtual | ~ExecutionContext ()=default |
|
This execution context derives from InPlaceExecutionContext
and replaces the logic when agent updates will be visible to other agents. The remaining implementation is the same as in InPlaceExecutionContext
. The CopyExecutionContext
creates and updates a copy of an agent. The changes to this copy are committed at the end of the iteration.
Thus, all agents see the same agent state if they read attributes from their neighbors. The value of the neighbor attributes will be from the last iteration.
NB: This execution context does not support neighbor modification, Param::ExecutionOrder::kForEachOpForEachAgent
, and agent filter Scheduler::SetAgentFilters
.
Definition at line 37 of file copy_execution_context.h.