PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
GridAdjacency< Moves > Class Template Reference

the moves from a cell of a GridMap and their costs, on the GridGraph of ADS More...

#include <PBeFS/astar/structures/ads/GridAdjacency.h>

Public Types

using cost_type = std::conditional_t< Moves == 4 , int , double >
 the cost of a move: an integer with 4 moves, a real with 8

Public Member Functions

 GridAdjacency (const GridMap &map)
 constructor, copying the costs of the cells of the map
template<class F>
void for_each (std::uint32_t s, int x, int y, F &&f) const
 calls f( t , x' , y' , c ) for each free cell t = ( x' , y' ) next to the free cell s = ( x , y ), c being the cost of the move

Detailed Description

template<int Moves>
class PBeFS_di_unipi_it::GridAdjacency< Moves >

the moves from a cell of a GridMap and their costs, on the GridGraph of ADS

The interface is that of the GridAdjacency of Grid.h, and so are the moves and their costs (MoveCost::LEFT, with \( \sqrt{2} \) to a corner); the cells are visited in increasing order of index. The row of the cell s = ( x , y ) starts at s - x, so a neighbour t is in the row above, in the same one or in the row below by comparing t with that start, and its column follows with no division.

Member Typedef Documentation

◆ cost_type

template<int Moves>
using cost_type = std::conditional_t< Moves == 4 , int , double >

the cost of a move: an integer with 4 moves, a real with 8

Constructor & Destructor Documentation

◆ GridAdjacency()

template<int Moves>
GridAdjacency ( const GridMap & map)
inlineexplicit

constructor, copying the costs of the cells of the map

Member Function Documentation

◆ for_each()

template<int Moves>
template<class F>
void for_each ( std::uint32_t s,
int x,
int y,
F && f ) const
inline

calls f( t , x' , y' , c ) for each free cell t = ( x' , y' ) next to the free cell s = ( x , y ), c being the cost of the move


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