17template<
typename TCoordinate,
typename TEdge>
29 typename edge_type::weight_type
m_unit;
34 explicit WeightedSquareGrid8(TCoordinate height, TCoordinate width,
typename edge_type::weight_type unit = 1);
38 typename edge_type::weight_type
getUnit()
const;
40 void setUnit(
typename edge_type::weight_type unit);
74 std::string
name()
const override;
82template<
typename TCoordinate,
typename TEdge>
85 typename TEdge::weight_type unit)
86 :
SquareGrid<TCoordinate, TEdge>(height, width), m_unit(unit) {
91template<
typename TCoordinate,
typename TEdge>
96template<
typename TCoordinate,
typename TEdge>
98 if (unit > 0) m_unit = unit;
103template<
typename TCoordinate,
typename TEdge>
107 return TEdge(a, b, M_SQRT2 * m_unit);
110 return TEdge(a, b, m_unit);
115template<
typename TCoordinate,
typename TEdge>
122template<
typename TCoordinate,
typename TEdge>
124 return "WeightedSquareGrid8";
141template<
typename TCoordinate,
typename TEdge>
151 grid.addObstacle(std::move(obstacle));
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
static ext::pair< DefaultCoordinateType, DefaultCoordinateType > normalizeObstacle(ext::pair< TCoordinate, TCoordinate > &&obstacle)
Definition: Normalize.hpp:82
static bool sqaureGridDirectionIsDiagonal(grid::SquareGridDirections direction)
Definition: GridFunction.cpp:40
static grid::SquareGridDirections squareGridDirection(const ext::pair< TCoordinate, TCoordinate > &a, const ext::pair< TCoordinate, TCoordinate > &b)
Definition: GridFunction.hpp:56
TCoordinate coordinate_type
Definition: GridInterface.hpp:23
TEdge edge_type
Definition: GridInterface.hpp:24
Definition: SquareGrid.hpp:29
TCoordinate getHeight() const
Definition: SquareGrid.hpp:155
TCoordinate getWidth() const
Definition: SquareGrid.hpp:160
TCoordinate m_height
Definition: SquareGrid.hpp:41
TCoordinate m_width
Definition: SquareGrid.hpp:42
ext::set< node_type > m_obstacles
Definition: SquareGrid.hpp:43
const ext::set< node_type > & getObstacleList() const &
Definition: SquareGrid.hpp:142
Definition: WeightedSquareGrid8.hpp:18
bool isValidDirection(direction_type direction) const override
Definition: WeightedSquareGrid8.hpp:116
SquareGridDirections direction_type
Definition: WeightedSquareGrid8.hpp:25
WeightedSquareGrid8(TCoordinate height, TCoordinate width, typename edge_type::weight_type unit=1)
Definition: WeightedSquareGrid8.hpp:83
bool operator==(const WeightedSquareGrid8 &other) const
Definition: WeightedSquareGrid8.hpp:51
ext::pair< TCoordinate, TCoordinate > node_type
Definition: WeightedSquareGrid8.hpp:24
void setUnit(typename edge_type::weight_type unit)
Definition: WeightedSquareGrid8.hpp:97
edge_type::weight_type m_unit
Definition: WeightedSquareGrid8.hpp:29
edge_type::weight_type getUnit() const
Definition: WeightedSquareGrid8.hpp:92
auto operator<=>(const WeightedSquareGrid8 &other) const
Definition: WeightedSquareGrid8.hpp:47
std::string name() const override
Definition: WeightedSquareGrid8.hpp:123
TEdge createEdge(const node_type &a, const node_type &b) const override
Definition: WeightedSquareGrid8.hpp:104
int i
Definition: AllEpsilonClosure.h:118
Definition: normalize.hpp:10
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
Definition: GridDirection.hpp:12
const ext::set< SquareGridDirections > SQUARE_GRID_DIRECTIONS
Definition: GridDirection.hpp:28
SquareGridDirections
Definition: GridDirection.hpp:16
static grid::WeightedSquareGrid8 eval(grid::WeightedSquareGrid8< TCoordinate, TEdge > &&value)
Definition: WeightedSquareGrid8.hpp:143
Definition: normalize.hpp:13