RepastHPC  2.3.1
Public Member Functions | List of all members
repast::Moore2DGridQuery< T > Class Template Reference

Neighborhood query that gathers neighbors in a Moore (N, S, E, W, NE, etc.) neighborhood. More...

#include <Moore2DGridQuery.h>

Inheritance diagram for repast::Moore2DGridQuery< T >:
repast::Grid2DQuery< T >

Public Member Functions

 Moore2DGridQuery (const Grid< T, int > *grid)
 Creates Moore2DGridQuery that will query the specified Grid.
 
virtual void query (const Point< int > &center, int range, bool includeCenter, std::vector< T * > &out) const
 Queries the Grid for the Moore neighbors surrounding the center point within a specified range. More...
 
- Public Member Functions inherited from repast::Grid2DQuery< T >
 Grid2DQuery (const Grid< T, int > *grid)
 Creates Grid2DQuery that will query the specified Grid.
 

Additional Inherited Members

- Protected Attributes inherited from repast::Grid2DQuery< T >
const Grid< T, int > * _grid
 
int minMax [2][2]
 

Detailed Description

template<typename T>
class repast::Moore2DGridQuery< T >

Neighborhood query that gathers neighbors in a Moore (N, S, E, W, NE, etc.) neighborhood.

Template Parameters
Tthe type of agents in the Grid

Member Function Documentation

◆ query()

template<typename T >
void repast::Moore2DGridQuery< T >::query ( const Point< int > &  center,
int  range,
bool  includeCenter,
std::vector< T * > &  out 
) const
virtual

Queries the Grid for the Moore neighbors surrounding the center point within a specified range.

Parameters
centerthe center of the neighborhood
rangethe range of the neighborhood out from the center
includeCenterwhether or not to include any agents at the center
[out]theneighboring agents will be returned in this vector

Implements repast::Grid2DQuery< T >.


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