Utopia
2
Framework for studying models of complex & adaptive systems.
|
Agent specialization for asynchronous update. More...
#include <agent.hh>
Public Types | |
using | Self = Agent< Traits, Space > |
The type of this agent. More... | |
using | State = typename Traits::State |
The type of the state. More... | |
using | Position = typename Space::SpaceVec |
The type of the position vector. More... | |
Public Types inherited from Utopia::Entity< Agent< Traits, Space >, Traits > | |
using | Traits = Traits |
The traits of this entity. More... | |
using | Self = Entity< Agent< Traits, Space >, Traits > |
The type of this entity. More... | |
using | State = typename Traits::State |
The type of the state of this entity. More... | |
using | Tags = typename Traits::Tags |
The tags associated with this entity. More... | |
using | CustomLinkContainers = typename Traits::template CustomLinks< EntityContainer< Agent< Traits, Space > > > |
A construct that has as members containers for custom-linked entities. More... | |
Public Member Functions | |
Agent (const IndexType id, const State initial_state, const Position &initial_pos) | |
Construct an agent. More... | |
const Position & | position () const |
Return a const reference of the current position of the agent. More... | |
Public Member Functions inherited from Utopia::Entity< Agent< Traits, Space >, Traits > | |
Entity (const IndexType id, const State initial_state) | |
Construct an entity. More... | |
const IndexType & | id () const |
Return const reference to entity ID. More... | |
CustomLinkContainers & | custom_links () |
Return reference to custom link containers. More... | |
const CustomLinkContainers & | custom_links () const |
Return const reference to custom link containers. More... | |
Protected Member Functions | |
void | set_pos (const Position &pos) |
Set the position of the agent. More... | |
Private Attributes | |
Position | _pos |
The position of the agent. More... | |
Friends | |
template<class T , class M > | |
class | AgentManager |
Make the agent manager a (template) friend of this class. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Utopia::Entity< Agent< Traits, Space >, Traits > | |
static constexpr Update | mode |
Whether this entity is updated synchronously. More... | |
Agent specialization for asynchronous update.
using Utopia::Agent< Traits, Space, std::enable_if_t< Traits::mode !=Update::sync > >::Position = typename Space::SpaceVec |
The type of the position vector.
using Utopia::Agent< Traits, Space, std::enable_if_t< Traits::mode !=Update::sync > >::Self = Agent<Traits, Space> |
The type of this agent.
using Utopia::Agent< Traits, Space, std::enable_if_t< Traits::mode !=Update::sync > >::State = typename Traits::State |
The type of the state.
|
inline |
Construct an agent.
id | The id of this agent, ideally unique |
initial_state | The initial state |
initial_pos | The initial position |
|
inline |
Return a const reference of the current position of the agent.
|
inlineprotected |
Set the position of the agent.
This function allows befriended classes to set the position of this agent.
pos | The new position of the agent |
|
friend |
Make the agent manager a (template) friend of this class.
|
private |
The position of the agent.