fpmas 1.6
Public Types | List of all members
fpmas::model::GridRangeConfig< DistanceType, PerimeterType > Struct Template Reference

#include <grid.h>

Public Types

typedef DistanceType Distance
 
typedef PerimeterType Perimeter
 

Detailed Description

template<typename DistanceType, typename PerimeterType>
struct fpmas::model::GridRangeConfig< DistanceType, PerimeterType >

Generic static Grid range configuration interface.

Member Typedef Documentation

◆ Distance

template<typename DistanceType , typename PerimeterType >
typedef DistanceType fpmas::model::GridRangeConfig< DistanceType, PerimeterType >::Distance

Function object used to check if a DiscretePoint is contained into this range, depending on the considered origin.

More precisely, the object must provide a method with the following signature:

DiscreteCoordinate operator()(const DiscretePoint& origin, const DiscretePoint& point_to_check);
long DiscreteCoordinate
Definition: grid.h:15

This object is notably used by the GridRange::contains() method to compute ranges.

Two classical types of neighborhoods notably use the following distances:

See VonNeumannRange and MooreRange for more details.

◆ Perimeter

template<typename DistanceType , typename PerimeterType >
typedef PerimeterType fpmas::model::GridRangeConfig< DistanceType, PerimeterType >::Perimeter

Function object that, considering the GridConfig, returns the point corresponding to the maximum radius of this Range shape, considering the shape is centered on (0, 0).

The final radius can be computed as follow:

class Example : public api::model::Range {
std::size_t radius(api::model::GridCell*) const override {
typename GridConfig::Distance grid_distance;
typename RangeType::Perimeter perimeter;
return grid_distance({0, 0}, perimeter(*this));
}
};
DistanceType Distance
Definition: grid.h:533

This default template does not implement any perimeter, since such a property highly depends on specified GridConfig. Instead,


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