fpmas 1.6
Public Member Functions | List of all members
fpmas::api::model::RandomAgent Class Referenceabstract

#include <model.h>

Inheritance diagram for fpmas::api::model::RandomAgent:
Inheritance graph
[legend]

Public Member Functions

virtual api::random::Generator< std::FPMAS_AGENT_RNG::result_type > & rd ()=0
 
virtual void seed (std::FPMAS_AGENT_RNG::result_type seed)=0
 

Detailed Description

Interface from which Agents can inherit to embed their own random number generator.

The type of random number generator used is determined at compile time by the FPMAS_AGENT_RNG parameter.

Member Function Documentation

◆ rd()

virtual api::random::Generator< std::FPMAS_AGENT_RNG::result_type > & fpmas::api::model::RandomAgent::rd ( )
pure virtual

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

Implemented in fpmas::model::GridCellBase< GridCellType, Derived >, fpmas::model::GridCellBase< GridCell >, and fpmas::model::GridAgent< AgentType, GridCellType, Derived >.

◆ seed()

virtual void fpmas::api::model::RandomAgent::seed ( std::FPMAS_AGENT_RNG::result_type  seed)
pure virtual

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.

Implemented in fpmas::model::GridAgent< AgentType, GridCellType, Derived >.


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