1#ifndef UTOPIA_CORE_AGENT_HH
2#define UTOPIA_CORE_AGENT_HH
18template<
typename StateType,
20 bool use_def_state_constr=
false,
27 CustomLinkContainers>;
46template<
typename Traits,
typename Space,
typename enabled=
void>
51template<
typename Traits,
typename Space>
54 std::enable_if_t<Traits::mode != Update::sync>>
56 public Entity<Agent<Traits, Space>, Traits>
63 using State =
typename Traits::State;
69 template<
class T,
class M>
83 const State initial_state,
115template<
typename Traits,
typename Space>
118 std::enable_if_t<Traits::mode == Update::sync>>
120 public Entity<Agent<Traits, Space>, Traits>
127 using State =
typename Traits::State;
133 template<
class T,
class M>
150 const State& initial_state,
155 _pos_new(initial_pos)
void set_pos(const Position &pos)
Set the position of the agent.
Definition agent.hh:107
Position _pos
The position of the agent.
Definition agent.hh:74
const Position & position() const
Return a const reference of the current position of the agent.
Definition agent.hh:91
typename Traits::State State
The type of the state.
Definition agent.hh:63
Agent(const IndexType id, const State initial_state, const Position &initial_pos)
Construct an agent.
Definition agent.hh:82
typename Space::SpaceVec Position
The type of the position vector.
Definition agent.hh:66
const Position & position() const
Return the current position of the agent.
Definition agent.hh:159
void set_pos(const Position &pos)
Set the position buffer of the (synchronously updated) agent.
Definition agent.hh:191
typename Traits::State State
The type of the state.
Definition agent.hh:127
Position _pos
The current position of the agent.
Definition agent.hh:138
const Position & position_new() const
Return the position buffer of the agent.
Definition agent.hh:164
Position _pos_new
The position buffer for the synchronous position update.
Definition agent.hh:141
Agent(const IndexType id, const State &initial_state, const Position &initial_pos)
Construct an agent.
Definition agent.hh:149
typename Space::SpaceVec Position
The type of the position vector.
Definition agent.hh:130
void update()
Update the position and the state.
Definition agent.hh:172
An agent is a slightly specialized state container.
Definition agent.hh:47
The agent manager manages the agents living in a model.
Definition agent_manager.hh:31
An entity is a slightly specialized state container.
Definition entity.hh:83
Traits Traits
The traits of this entity.
Definition entity.hh:90
Update
Update modes when applying rules.
Definition state.hh:20
std::size_t IndexType
Type for indices, i.e. values used for container indexing, agent IDs, ...
Definition types.hh:40
Definition parallel.hh:235
The entity traits struct gathers types to be used for specializing an entity.
Definition entity.hh:49
Default struct for EntityTraits; use this one if there are no custom links.
Definition entity.hh:23
The Space bundles properties about the physical space a model resides in.
Definition space.hh:27
SpaceVecType< dim > SpaceVec
The type for vectors relating to physical space.
Definition space.hh:33