fpmas 1.6
Namespaces | Classes | Typedefs | Functions
fpmas::model Namespace Reference

Namespaces

namespace  detail
 

Classes

class  AcquireGuard
 
class  AgentNodeBuilder
 
class  AutoBreakpoint
 
class  Behavior
 
class  BehaviorWithArgs
 
class  CellBase
 
class  CellLoadBalancing
 
class  CellNetworkBuilder
 
class  ChebyshevDistance
 
class  CompareNeighbors
 
class  ConstrainedGridAgentMapping
 
class  DefaultBehavior
 
class  DefaultSpatialAgentFactory
 
class  DistributedAgentNodeBuilder
 
class  DistributedMoveAlgorithm
 
class  DynamicEndCondition
 
class  FastProcessMapping
 
struct  GraphCell
 
class  GraphCellBase
 
class  GraphRange
 
class  GridAgent
 
class  GridAgentBuilder
 
class  GridCell
 
class  GridCellBase
 
class  GridCellFactory
 
class  GridCellFactory< api::model::GridCell >
 
struct  GridConfig
 
class  GridDimensions
 
class  GridLoadBalancing
 
class  GridProcessMapping
 
class  GridRange
 
struct  GridRangeConfig
 
class  IdleBehavior
 
struct  LocationRange
 
class  LockGuard
 
class  ManhattanDistance
 
class  MooreGridBuilder
 
struct  MooreRangePerimeter
 
struct  MooreRangePerimeter< MooreGrid< CellType > >
 
struct  MooreRangePerimeter< VonNeumannGrid< CellType > >
 
class  MoveAgentGroup
 
class  Neighbor
 
class  Neighbors
 
struct  PointHash
 
struct  RandomGridAgentBuilder
 
class  RandomGridAgentMapping
 
struct  RandomMapping
 
struct  RandomNeighbors
 
class  ReachableCell
 
class  ReadGuard
 
class  SharedLockGuard
 
class  SpatialAgent
 
class  SpatialAgentBase
 
class  SpatialAgentBuilder
 
class  SpatialAgentBuilderBase
 
class  SpatialModel
 
class  StaticCellLoadBalancing
 
class  StaticEndCondition
 
class  StripProcessMapping
 
class  TreeProcessMapping
 
class  UniformAgentMapping
 
class  UniformGridAgentMapping
 
struct  VoidRange
 
class  VonNeumannGridBuilder
 
struct  VonNeumannRangePerimeter
 
struct  VonNeumannRangePerimeter< MooreGrid< CellType > >
 
struct  VonNeumannRangePerimeter< VonNeumannGrid< CellType > >
 

Typedefs

template<typename AgentType , typename TypeIdBase = AgentType>
using AgentBase = detail::AgentBase< api::model::Agent, AgentType, TypeIdBase >
 
typedef api::utils::Callback< AgentNode * > AgentNodeCallback
 
template<template< typename > class SyncMode>
using Model = detail::DefaultModel< SyncMode >
 
using DistributedUniformGraphBuilder = graph::DistributedUniformGraphBuilder< AgentPtr >
 
using DistributedClusteredGraphBuilder = graph::DistributedClusteredGraphBuilder< AgentPtr >
 
using RingGraphBuilder = graph::RingGraphBuilder< AgentPtr >
 
using SmallWorldGraphBuilder = graph::SmallWorldGraphBuilder< AgentPtr >
 
using ZoltanLoadBalancing = graph::ZoltanLoadBalancing< AgentPtr >
 
using ScheduledLoadBalancing = graph::ScheduledLoadBalancing< AgentPtr >
 
using RandomLoadBalancing = graph::RandomLoadBalancing< AgentPtr >
 
using StaticLoadBalancing = graph::StaticLoadBalancing< AgentPtr >
 
typedef io::Breakpoint< api::model::ModelBreakpoint
 
typedef random::Index< DiscretePointGridAgentIndex
 
template<template< typename > class SyncMode, typename CellType = model::GridCell, typename EndCondition = DynamicEndCondition<CellType>>
using GridModel = SpatialModel< SyncMode, CellType, EndCondition >
 
template<typename CellType = model::GridCell>
using MooreGrid = GridConfig< MooreGridBuilder< CellType >, ChebyshevDistance, CellType >
 
template<typename GridConfig >
using MooreRangeConfig = GridRangeConfig< ChebyshevDistance, MooreRangePerimeter< GridConfig > >
 
template<typename GridConfig >
using MooreRange = GridRange< GridConfig, MooreRangeConfig< GridConfig > >
 
template<typename CellType , typename TypeIdBase = CellType>
using Cell = CellBase< api::model::Cell, CellType, TypeIdBase >
 
template<typename CellType = model::GridCell>
using VonNeumannGrid = GridConfig< VonNeumannGridBuilder< CellType >, ManhattanDistance, CellType >
 
template<typename GridConfig >
using VonNeumannRangeConfig = GridRangeConfig< ManhattanDistance, VonNeumannRangePerimeter< GridConfig > >
 
template<typename GridConfig >
using VonNeumannRange = GridRange< GridConfig, VonNeumannRangeConfig< GridConfig > >
 

Functions

std::vector< api::graph::DistributedIdlocal_agent_ids (const api::model::AgentGroup &group)
 
bool is_agent_in_group (api::model::Agent *agent, api::model::GroupId group_id)
 
bool is_agent_in_group (api::model::Agent *agent, api::model::AgentGroup &group)
 
template<typename AgentType >
bool operator< (const Neighbor< AgentType > &n1, const Neighbor< AgentType > &n2)
 
template<typename CellType >
std::vector< api::graph::DistributedIdlocal_cell_ids (const api::model::SpatialModel< CellType > &model)
 

Detailed Description

fpmas::api::model implementations.

Typedef Documentation

◆ AgentBase

template<typename AgentType , typename TypeIdBase = AgentType>
using fpmas::model::AgentBase = typedef detail::AgentBase<api::model::Agent, AgentType, TypeIdBase>

Basic AgentBase that can be extended by the user to define an Agent.

Template Parameters
AgentTypefinal Agent type, that must inherit from the current AgentBase.
TypeIdBasetype used to define the type id of the current AgentBase implementation.

◆ AgentNodeCallback

Callback specialization that can be extended to define user callbacks.

◆ Model

template<template< typename > class SyncMode>
using fpmas::model::Model = typedef detail::DefaultModel<SyncMode>

FPMAS default Model.

◆ DistributedUniformGraphBuilder

graph::DistributedUniformGraphBuilder AgentPtr specialization.

◆ DistributedClusteredGraphBuilder

graph::DistributedClusteredGraphBuilder AgentPtr specialization.

◆ RingGraphBuilder

graph::RingGraphBuilder AgentPtr specialization.

◆ SmallWorldGraphBuilder

graph::SmallWorldGraphBuilder AgentPtr specialization.

◆ ZoltanLoadBalancing

graph::ZoltanLoadBalancing AgentPtr specialization.

◆ ScheduledLoadBalancing

graph::ScheduledLoadBalancing AgentPtr specialization.

◆ RandomLoadBalancing

graph::RandomLoadBalancing AgentPtr specialization.

◆ StaticLoadBalancing

graph::StaticLoadBalancing AgentPtr specialization.

◆ Breakpoint

Model fpmas::io::Breakpoint specialization.

◆ GridAgentIndex

An index mapping grid cell locations to agent indexes.

The count associated to each DiscretePoint represents the count of agents located at this location.

◆ GridModel

template<template< typename > class SyncMode, typename CellType = model::GridCell, typename EndCondition = DynamicEndCondition<CellType>>
using fpmas::model::GridModel = typedef SpatialModel<SyncMode, CellType, EndCondition>

Grid specialization of the SpatialModel.

◆ MooreGrid

template<typename CellType = model::GridCell>
using fpmas::model::MooreGrid = typedef GridConfig<MooreGridBuilder<CellType>, ChebyshevDistance, CellType>

Moore GridConfig specialization, that might be used where a GridConfig template parameter is required.

◆ MooreRangeConfig

Moore GridRangeConfig specialization, that might be used where a GridRangeConfig template parameter is required.

The explicit specialization of MooreRangePerimeter corresponding to GridConfig, i.e. MooreRangePerimeter<GridConfig> is automatically selected: the type is ill-formed if no such specialization exists.

◆ MooreRange

GridRange specialization defining variable size ranges with a Moore shape.

Formally a MooreRange range centered on p1 is constituted by any point of the Grid p such that ChebyshevDistance()(p1, p) <= range.getSize().

Notice the two following cases:

  • if size==0, only the current location is included in the range.
  • if size<0, the range is empty.
Note
The shape of the range is completely independent from the underlying shape of the grid, defined by GridConfig.
Template Parameters
GridConfiga type defining the current grid configuration (e.g.: MooreGrid, VonNeumannGrid)
See also
ChebyshevDistance
VonNeumannRange
GridConfig
VonNeumannGrid
MooreGrid

◆ Cell

template<typename CellType , typename TypeIdBase = CellType>
using fpmas::model::Cell = typedef CellBase<api::model::Cell, CellType, TypeIdBase>

Basic api::model::Cell implementation that can be extended by the user.

Such a Cell can be used to define a SpatialModel based on an arbitrary graph.

Template Parameters
CellTypefinal Cell type, that must inherit from the current Cell.
TypeIdBasetype used to define the type id of the current AgentBase implementation.

◆ VonNeumannGrid

template<typename CellType = model::GridCell>
using fpmas::model::VonNeumannGrid = typedef GridConfig<VonNeumannGridBuilder<CellType>, ManhattanDistance, CellType>

VonNeumann GridConfig specialization, that might be used where a GridConfig template parameter is required.

◆ VonNeumannRangeConfig

VonNeumann GridRangeConfig specialization, that might be used where a GridRangeConfig template parameter is required.

The explicit specialization of VonNeumannRangePerimeter corresponding to GridConfig, i.e. VonNeumannRangePerimeter<GridConfig> is automatically selected: the type is ill-formed if no such specialization exists.

◆ VonNeumannRange

GridRange specialization defining variable size ranges with a VonNeumann shape.

Formally a VonNeumannRange range centered on p1 is constituted by any point of the Grid p such that ManhattanDistance()(p1, p) <= range.getSize().

Notice the two following cases:

  • if size==0, only the current location is included in the range.
  • if size<0, the range is empty.
Note
The shape of the range is completely independent from the underlying shape of the grid, defined by GridConfig.
Template Parameters
GridConfiga type defining the current grid configuration (e.g.: MooreGrid, VonNeumannGrid)
See also
ManhattanDistance
MooreRange
GridConfig
VonNeumannGrid
MooreGrid

Function Documentation

◆ local_agent_ids()

std::vector< api::graph::DistributedId > fpmas::model::local_agent_ids ( const api::model::AgentGroup group)

Returns a vector containing the ids of LOCAL agents contained in the specified group.

Parameters
groupAgentGroup to consider
Returns
ids of LOCAL agents

◆ is_agent_in_group() [1/2]

bool fpmas::model::is_agent_in_group ( api::model::Agent agent,
api::model::GroupId  group_id 
)

Checks if agent is currently in the AgentGroup represented by group_id.

◆ is_agent_in_group() [2/2]

bool fpmas::model::is_agent_in_group ( api::model::Agent agent,
api::model::AgentGroup group 
)

Checks if agent is currently in group.

◆ operator<()

template<typename AgentType >
bool fpmas::model::operator< ( const Neighbor< AgentType > &  n1,
const Neighbor< AgentType > &  n2 
)

Default Neighbor comparison operator.

This can only compare agents using the operator<, contrary to the generic CompareNeighbors implementation.

However, this definition might be useful to use external sorting algorithm or any other method requiring a Neighbor comparison using the operator<.

Example
From a SpatialAgent behavior:
auto mobility_field = this->mobilityField();
std::sort(mobility_field.begin(), mobility_field.end());
This is just for the example purpose, mobility_field.sort() can be used directly to produce the same behavior.

◆ local_cell_ids()

template<typename CellType >
std::vector< api::graph::DistributedId > fpmas::model::local_cell_ids ( const api::model::SpatialModel< CellType > &  model)

Returns a vector containing the ids of LOCAL Cells in the specified model.

Parameters
modelSpatialModel to consider
Returns
ids of LOCAL Cells