#include <Neighborhood.h>
Public Member Functions | |
Neighborhood (int size=1) | |
The constructor. | |
Neighborhood (const Neighborhood &n) | |
The copy-constructor:. | |
Neighborhood & | operator= (const Neighborhood &n) |
Overwrite the = operator to avoid problems when you forget initialize whit the constructor. | |
~Neighborhood () | |
the destructor | |
std::vector< std::vector< int > > | getNeighborhood () |
Return the container of positions of the neighbors (neighborsPositions). | |
int | getSize () |
What size is the diameter of the Neighborhood? | |
void | setSize (int s) |
Change the size of the diameter of the Neighborhood. | |
virtual void | calculateNeighborhood (const std::vector< int > position) |
Public Attributes | |
std::vector< std::vector< int > > | neighborsPositions |
std::vector< int > | neighborCoordinates |
int | size |
This class represents the "form" of the neighborhood for some center cell, the specific edges of a vertex. This class specify the desired form for the neighborhood, then the topology class specify if this form can be created, and how. This mix and the derived correlation's are performed in the map class.
virtual void Neighborhood::calculateNeighborhood | ( | const std::vector< int > | position | ) | [inline, virtual] |
This is the main method in the class. In this method, the container of neighbor positions, is fill with the vector positions of the neighbors, the positions of the vertex with an edge to the vertex represented by the input vector (the vertex position).
std::vector<int> Neighborhood::neighborCoordinates |
This vector will be used for create a neighbor position and push in to the container (neighborsPositions).
std::vector< std::vector<int> > Neighborhood::neighborsPositions |
This is the container of neighbor's positions vectors the edges positions set, for some center cell, some vertex.
The size variable represents how far we are gonna take neighbors. For example if we take size = 1, in the tower neighborhood (1 dimension) you have: 0X0 and if we have size = 2 we have: 00X00 The x is the center cell, and the 0's are the neighbors