|
fpmas-metamodel 1.0
|
#include <agent.h>


Public Member Functions | |
| MetaAgent () | |
| MetaAgent (const std::deque< DistributedId > &contacts) | |
| FPMAS_MOBILITY_RANGE (range) | |
| FPMAS_PERCEPTION_RANGE (range) | |
| void | create_relations_from_neighborhood () |
| void | create_relations_from_contacts () |
| void | handle_new_contacts () |
| void | move () |
| const fpmas::api::model::AgentNode * | agentNode () const override |
Public Member Functions inherited from MetaAgentBase | |
| bool | is_in_contacts (DistributedId id) |
| virtual const fpmas::api::model::AgentNode * | agentNode () const =0 |
| MetaAgentBase () | |
| MetaAgentBase (const std::deque< DistributedId > &contacts) | |
| const std::deque< DistributedId > & | contacts () const |
Additional Inherited Members | |
Static Public Attributes inherited from MetaAgentBase | |
| static std::size_t | max_contacts |
| static std::size_t | range_size |
| static float | contact_weight |
| static MovePolicy | move_policy |
Protected Member Functions inherited from MetaAgentBase | |
| std::deque< DistributedId > & | contacts () |
Generic MetaAgentBase implementation.
The create_relations_neighbors_group() and create_relations_from_contacts() are behaviors that can be used to make the graph of contacts evolve.
| AgentBase | implemented agent interface (fpmas::api::model::GridAgent<...,> or fpmas::api::model::SpatialAgent<...,>) |
| PerceptionRange | type of mobility and perception range, according to the model type |
|
inline |
MetaAgent default constructor.
|
inline |
MetaAgent constructor.
| contacts | Initial list of contacts |
| MetaAgent< AgentBase, PerceptionRange >::FPMAS_MOBILITY_RANGE | ( | range | ) |
FPMAS mobility range set up.
| MetaAgent< AgentBase, PerceptionRange >::FPMAS_PERCEPTION_RANGE | ( | range | ) |
FPMAS perception range set up.
| void MetaAgent< AgentBase, PerceptionRange >::create_relations_from_neighborhood |
Picks a random agent in the current perceptions and adds it to the contact list.
If the list was full, the oldest contact is removed.
| void MetaAgent< AgentBase, PerceptionRange >::create_relations_from_contacts |
Puts two random contacts in relation.
First, a random contact A is selected. Then, attempts to find a random contact B that is not already a contact of A.
If such a contact is found, a link from A to B is created on the NEW_CONTACT layer. Such links must then be handled from A thanks to the handle_new_contacts() method, after a synchronization has been performed (to ensure links migration).
| void MetaAgent< AgentBase, PerceptionRange >::handle_new_contacts |
Adds new contacts to the contact list from the NEW_CONTACT layer.
If the contact list is full, oldest contacts are removed to make enough space for new contacts.
| void MetaAgent< AgentBase, PerceptionRange >::move |
Moves to the next cell according to the current MovePolicy.
|
inlineoverridevirtual |
Returns a pointer to the node containing the agent.
Implements MetaAgentBase.