fpmas 1.6
Public Types | Public Member Functions | List of all members
fpmas::model::GridCellBase< GridCellType, Derived > Class Template Reference

#include <grid.h>

Inheritance diagram for fpmas::model::GridCellBase< GridCellType, Derived >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::GridCellBase< GridCellType, Derived >:
Collaboration graph
[legend]

Public Types

typedef GridCellBase< GridCellType, Derived > JsonBase
 
- Public Types inherited from fpmas::model::detail::AgentBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > >
typedef GridCellType FinalAgentType
 

Public Member Functions

 GridCellBase ()
 
 GridCellBase (DiscretePoint location)
 
DiscretePoint location () const override
 
random::FPMAS_AGENT_RNGrd () override
 
void seed (random::FPMAS_AGENT_RNG::result_type seed) override
 
- Public Member Functions inherited from fpmas::model::CellBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > >
 CellBase ()=default
 
 CellBase (const CellBase &)=default
 
 CellBase (CellBase &&)=default
 
CellBaseoperator= (const CellBase &)=default
 
CellBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > > & operator= (CellBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > > &&)
 
std::vector< api::model::Cell * > successors () override
 
void handleNewLocation () override
 
void handleMove () override
 
void handlePerceive () override
 
void updatePerceptions (api::model::AgentGroup &group) override
 
void init () override
 
- Public Member Functions inherited from fpmas::model::detail::AgentBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > >
 AgentBase ()=default
 
 AgentBase (const AgentBase &agent)=default
 
 AgentBase (AgentBase &&)=default
 
AgentBaseoperator= (const AgentBase &agent)=default
 
AgentBaseoperator= (AgentBase &&)
 
GroupId groupId () const override
 
std::vector< GroupId > groupIds () const override
 
void setGroupId (api::model::GroupId id) override
 
void addGroupId (api::model::GroupId id) override
 
void removeGroupId (api::model::GroupId id) override
 
api::model::AgentGroupgroup () override
 
const api::model::AgentGroupgroup () const override
 
std::vector< const api::model::AgentGroup * > groups () const override
 
std::vector< api::model::AgentGroup * > groups () override
 
void setGroup (api::model::AgentGroup *group) override
 
void addGroup (api::model::AgentGroup *group) override
 
void removeGroup (api::model::AgentGroup *group) override
 
void setGroupPos (api::model::GroupId gid, std::list< api::model::Agent * >::iterator pos) override
 
std::list< api::model::Agent * >::iterator getGroupPos (api::model::GroupId gid) const override
 
api::model::TypeId typeId () const override
 
api::model::Agentcopy () const override
 
void copyAssign (api::model::Agent *agent) override
 
void moveAssign (api::model::Agent *agent) override
 
api::model::AgentNodenode () override
 
const api::model::AgentNodenode () const override
 
void setNode (api::model::AgentNode *node) override
 
api::model::Modelmodel () override
 
const api::model::Modelmodel () const override
 
void setModel (api::model::Model *model) override
 
api::model::AgentTasktask () override
 
const api::model::AgentTasktask () const override
 
api::model::AgentTasktask (api::model::GroupId id) override
 
const api::model::AgentTasktask (api::model::GroupId id) const override
 
void setTask (api::model::AgentTask *task) override
 
void setTask (api::model::GroupId id, api::model::AgentTask *task) override
 
const std::unordered_map< api::model::GroupId, api::model::AgentTask * > & tasks () override
 
virtual void act () override
 
Neighbors< NeighborAgentType > outNeighbors () const
 
Neighbors< NeighborAgentType > outNeighbors (api::graph::LayerId layer) const
 
Neighbors< NeighborAgentType > inNeighbors () const
 
Neighbors< NeighborAgentType > inNeighbors (api::graph::LayerId layer) const
 
virtual DiscretePoint location () const =0
 
virtual std::vector< Cell * > successors ()=0
 
- Public Member Functions inherited from fpmas::api::model::Agent
virtual GroupId groupId () const =0
 
virtual std::vector< GroupIdgroupIds () const =0
 
virtual void setGroupId (GroupId id)=0
 
virtual void addGroupId (GroupId id)=0
 
virtual void removeGroupId (GroupId id)=0
 
virtual AgentGroupgroup ()=0
 
virtual const AgentGroupgroup () const =0
 
virtual std::vector< AgentGroup * > groups ()=0
 
virtual std::vector< const AgentGroup * > groups () const =0
 
virtual void setGroup (AgentGroup *group)=0
 
virtual void addGroup (AgentGroup *group)=0
 
virtual void removeGroup (AgentGroup *group)=0
 
virtual void setGroupPos (api::model::GroupId gid, std::list< Agent * >::iterator pos)=0
 
virtual std::list< Agent * >::iterator getGroupPos (api::model::GroupId gid) const =0
 
virtual TypeId typeId () const =0
 
virtual Agentcopy () const =0
 
virtual void copyAssign (Agent *agent)=0
 
virtual void moveAssign (Agent *agent)=0
 
virtual AgentNodenode ()=0
 
virtual const AgentNodenode () const =0
 
virtual void setNode (AgentNode *node)=0
 
virtual Modelmodel ()=0
 
virtual const Modelmodel () const =0
 
virtual void setModel (Model *model)=0
 
virtual AgentTasktask ()=0
 
virtual const AgentTasktask () const =0
 
virtual void setTask (AgentTask *task)=0
 
virtual AgentTasktask (GroupId id)=0
 
virtual const AgentTasktask (GroupId id) const =0
 
virtual void setTask (GroupId id, AgentTask *task)=0
 
virtual const std::unordered_map< GroupId, AgentTask * > & tasks ()=0
 
virtual void act ()=0
 
virtual void init ()=0
 
virtual void handleNewLocation ()=0
 
virtual void handleMove ()=0
 
virtual void handlePerceive ()=0
 
virtual void updatePerceptions (AgentGroup &group)=0
 
- Public Member Functions inherited from fpmas::api::model::RandomAgent
virtual api::random::Generator< std::FPMAS_AGENT_RNG::result_type > & rd ()=0
 
virtual void seed (std::FPMAS_AGENT_RNG::result_type seed)=0
 

Additional Inherited Members

- Static Public Attributes inherited from fpmas::model::detail::AgentBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > >
static const api::model::TypeId TYPE_ID
 
- Protected Attributes inherited from fpmas::model::CellBase< api::model::GridCell, GridCellType, GridCellBase< GridCellType, GridCellType > >
std::set< DistributedIdno_move_flags
 
std::set< DistributedIdmove_flags
 
std::set< DistributedIdperception_flags
 

Detailed Description

template<typename GridCellType, typename Derived = GridCellType>
class fpmas::model::GridCellBase< GridCellType, Derived >

api::model::GridCell implementation.

Template Parameters
GridCellTypedynamic GridCellBase type (i.e. the most derived type from this GridCellBase)
Deriveddirect derived class, or at least the next class in the serialization chain

Member Typedef Documentation

◆ JsonBase

template<typename GridCellType , typename Derived = GridCellType>
typedef GridCellBase<GridCellType, Derived> fpmas::model::GridCellBase< GridCellType, Derived >::JsonBase

Type that must be registered to enable Json serialization.

Constructor & Destructor Documentation

◆ GridCellBase() [1/2]

template<typename GridCellType , typename Derived = GridCellType>
fpmas::model::GridCellBase< GridCellType, Derived >::GridCellBase ( )
inline

Default GridCellBase constructor.

◆ GridCellBase() [2/2]

template<typename GridCellType , typename Derived = GridCellType>
fpmas::model::GridCellBase< GridCellType, Derived >::GridCellBase ( DiscretePoint  location)
inline

GridCellBase constructor.

Parameters
locationgrid cell coordinates

Member Function Documentation

◆ location()

template<typename GridCellType , typename Derived = GridCellType>
DiscretePoint fpmas::model::GridCellBase< GridCellType, Derived >::location ( ) const
inlineoverridevirtual

Returns the GridCell location.

Returns
grid cell location

Implements fpmas::api::model::GridCell.

◆ rd()

template<typename GridCellType , typename Derived = GridCellType>
random::FPMAS_AGENT_RNG & fpmas::model::GridCellBase< GridCellType, Derived >::rd ( )
inlineoverridevirtual

Returns a reference to the sequential random number bound to this agent.

The implementation should ensure that each agent produces an indenpendent random number sequence.

This can be perfomed:

  • Bounding a sequential generator to all agents, and seed() them independently.
  • Using a global DistributedGenerator

Implements fpmas::api::model::RandomAgent.

◆ seed()

template<typename GridCellType , typename Derived = GridCellType>
void fpmas::model::GridCellBase< GridCellType, Derived >::seed ( random::FPMAS_AGENT_RNG::result_type  seed)
inlineoverride

Seeds the generator bound to this agent.

Note
The generator is seeded from this agent, even if it is shared by several agents, for example in the case of a DistributedGenerator.

The documentation for this class was generated from the following file: