Public Member Functions | List of all members
ime::AdjacencyList Class Reference

Construct a list of neighbours for each accessible node/cell in a grid. More...

#include <AdjacencyList.h>

Public Member Functions

void generateFrom (const Grid2D &grid)
 Generate adjacency list from a grid. More...
 
const std::vector< Index > & getNeighbours (const Index &index) const
 Get the neighbours of a node at a certain position in the grid. More...
 

Detailed Description

Construct a list of neighbours for each accessible node/cell in a grid.

An accessible node is one that does not contain an obstacle and it is not a solid tile

Definition at line 42 of file AdjacencyList.h.

Member Function Documentation

◆ generateFrom()

void ime::AdjacencyList::generateFrom ( const Grid2D grid)

Generate adjacency list from a grid.

Parameters
gridgrid to generate adjacency list for

This function will generate a list of neighbouring tiles for each node/tile in the grid. This functions assumes that the grid nodes are bidirectional

◆ getNeighbours()

const std::vector< Index > & ime::AdjacencyList::getNeighbours ( const Index index) const

Get the neighbours of a node at a certain position in the grid.

Parameters
indexLocation of the tile to get the neighbours of
Returns
The tiles neighbours or an empty vector if the index is invalid

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