fpmas 1.6
Public Member Functions | List of all members
fpmas::model::CompareNeighbors< AgentType, Compare > Class Template Reference

#include <model.h>

Public Member Functions

 CompareNeighbors (const Compare &compare)
 
bool operator() (const Neighbor< AgentType > &n1, const Neighbor< AgentType > &n2) const
 

Detailed Description

template<typename AgentType, typename Compare = std::less<AgentType>>
class fpmas::model::CompareNeighbors< AgentType, Compare >

Default Neighbor comparison function object.

Template Parameters
AgentTypeType of neighbor agents
Comparea comparator that can compare two AgentType instance. The comparator must defined a method with the following signature:
bool operator()(const AgentType&, const AgentType&) const;
bool operator()(const Neighbor< AgentType > &n1, const Neighbor< AgentType > &n2) const
Definition: model.h:159
By default, AgentTypes are compared using the operator<, that can be user defined.

Constructor & Destructor Documentation

◆ CompareNeighbors()

template<typename AgentType , typename Compare = std::less<AgentType>>
fpmas::model::CompareNeighbors< AgentType, Compare >::CompareNeighbors ( const Compare &  compare)
inline

Compares agents using the specified function object.

Member Function Documentation

◆ operator()()

template<typename AgentType , typename Compare = std::less<AgentType>>
bool fpmas::model::CompareNeighbors< AgentType, Compare >::operator() ( const Neighbor< AgentType > &  n1,
const Neighbor< AgentType > &  n2 
) const
inline

Compares neighbors' agents using the a Compare instance.


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