fpmas-metamodel 1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MetaModel< BaseModel, AgentType > Class Template Referenceabstract

#include <metamodel.h>

Inheritance diagram for MetaModel< BaseModel, AgentType >:
Inheritance graph
[legend]
Collaboration diagram for MetaModel< BaseModel, AgentType >:
Collaboration graph
[legend]

Public Member Functions

 MetaModel (std::string name, ModelConfig config, fpmas::api::scheduler::Scheduler &scheduler, fpmas::api::runtime::Runtime &runtime, fpmas::api::model::LoadBalancing &lb_algorithm, fpmas::scheduler::TimeStep lb_period)
 
MetaModel< BaseModel, AgentType > * init () override
 
void run () override
 
std::string getName () const override
 
fpmas::api::model::Model & getModel () override
 
fpmas::api::model::AgentGroup & cellGroup () override
 
fpmas::api::model::AgentGroup & agentGroup () override
 
DotOutputgetDotOutput () override
 
virtual std::string getName () const =0
 
virtual fpmas::api::model::Model & getModel ()=0
 
virtual fpmas::api::model::AgentGroup & cellGroup ()=0
 
virtual fpmas::api::model::AgentGroup & agentGroup ()=0
 
virtual DotOutputgetDotOutput ()=0
 
virtual BasicMetaModelinit ()=0
 
virtual void run ()=0
 

Protected Member Functions

virtual void buildCells (const ModelConfig &config)=0
 
virtual void buildAgents (const ModelConfig &config)=0
 

Protected Attributes

BaseModel model
 

Detailed Description

template<typename BaseModel, typename AgentType>
class MetaModel< BaseModel, AgentType >

Generic MetaModel implementation, with features that are common for both MetaGraphModel and MetaGridModel. The MetaModel class cannot be used on its own.

Template Parameters
BaseModelThe concrete underlying spatial model type, such as SpatialModel<...> or GridModel<...>
AgentTypeThe concrete type of Spatial Agents, such as SpatialAgent<...> or GridAgent<...>

Constructor & Destructor Documentation

◆ MetaModel()

template<typename BaseModel , typename AgentType >
MetaModel< BaseModel, AgentType >::MetaModel ( std::string  name,
ModelConfig  config,
fpmas::api::scheduler::Scheduler &  scheduler,
fpmas::api::runtime::Runtime &  runtime,
fpmas::api::model::LoadBalancing &  lb_algorithm,
fpmas::scheduler::TimeStep  lb_period 
)

MetaModel constructor.

Parameters
nameName of the model
configModel configuration
schedulerScheduler on which agent execution, load balancing and outputs are planned
runtimeRuntime used to execute the MetaModel
lb_algorithmLoad balancing algorithm to apply to the MetaModel
lb_periodPeriod at which the load balancing algorithm should be applied, starting at time step 0

Member Function Documentation

◆ buildCells()

template<typename BaseModel , typename AgentType >
virtual void MetaModel< BaseModel, AgentType >::buildCells ( const ModelConfig config)
protectedpure virtual

Method used to build the Cell network.

Parameters
configModel configuration

Implemented in MetaGridModel< SyncMode >, and MetaGraphModel< SyncMode >.

◆ buildAgents()

template<typename BaseModel , typename AgentType >
virtual void MetaModel< BaseModel, AgentType >::buildAgents ( const ModelConfig config)
protectedpure virtual

Method used to build Spatial Agents and place them on the Cell network.

Parameters
configModel configuration

Implemented in MetaGridModel< SyncMode >, and MetaGraphModel< SyncMode >.

◆ init()

template<typename BaseModel , typename AgentType >
MetaModel< BaseModel, AgentType > * MetaModel< BaseModel, AgentType >::init ( )
overridevirtual

Initializes the Cell network and Spatial Agents.

Implements BasicMetaModel.

◆ run()

template<typename BaseModel , typename AgentType >
void MetaModel< BaseModel, AgentType >::run ( )
inlineoverridevirtual

Runs the MetaModel.

Implements BasicMetaModel.

◆ getName()

template<typename BaseModel , typename AgentType >
std::string MetaModel< BaseModel, AgentType >::getName ( ) const
inlineoverridevirtual

Name of the model.

Implements BasicMetaModel.

◆ getModel()

template<typename BaseModel , typename AgentType >
fpmas::api::model::Model & MetaModel< BaseModel, AgentType >::getModel ( )
inlineoverridevirtual

Generic model instance.

Implements BasicMetaModel.

◆ cellGroup()

template<typename BaseModel , typename AgentType >
fpmas::api::model::AgentGroup & MetaModel< BaseModel, AgentType >::cellGroup ( )
inlineoverridevirtual

Agent group containing the Cell network.

Implements BasicMetaModel.

◆ agentGroup()

template<typename BaseModel , typename AgentType >
fpmas::api::model::AgentGroup & MetaModel< BaseModel, AgentType >::agentGroup ( )
inlineoverridevirtual

Agent group containing Spatial Agents.

Implements BasicMetaModel.

◆ getDotOutput()

template<typename BaseModel , typename AgentType >
DotOutput & MetaModel< BaseModel, AgentType >::getDotOutput ( )
inlineoverridevirtual

Can be used to perform a model output in a DOT file.

Implements BasicMetaModel.

Member Data Documentation

◆ model

template<typename BaseModel , typename AgentType >
BaseModel MetaModel< BaseModel, AgentType >::model
protected

Spatial model instance.


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