#include <tiling.h>
Inheritance diagram for PathFind::Tiling:
Nodes can be blocked. Edge costs are uniform.
Definition at line 139 of file tiling.h.
Public Types | |
enum | Type { HEX, OCTILE, OCTILE_UNICOST, TILE } |
Public Member Functions | |
Tiling (Type type, int rows, int columns) | |
Tiling (const Tiling &tiling, int horizOrigin, int vertOrigin, int width, int height) | |
Tiling (LineReader &reader) | |
Construct tiling from a file. | |
void | clearObstacles () |
int | getHeuristic (int start, int target) const |
int | getMaxCost () const |
int | getMinCost () const |
int | getNodeId (int row, int column) const |
int | getNumberNodes () const |
void | getSuccessors (int nodeId, int lastNodeId, vector< Successor > &result) const |
Generate successor nodes for the search. | |
bool | isValidNodeId (int nodeId) const |
void | printFormatted (ostream &o) const |
void | printFormatted (ostream &o, int start, int target) const |
void | printFormatted (ostream &o, const vector< int > &path) const |
void | printLabels (ostream &o, const vector< char > &labels) const |
Print formatted map with char labels. | |
void | printPathAndLabels (ostream &o, const vector< int > &path, const vector< char > &labels) const |
void | setObstacles (float obstaclePercentage, bool avoidDiag=false) |
int | getWidth () const |
int | getHeight () const |
TilingNodeInfo & | getNodeInfo (int nodeId) const |
Type | getType () const |
Private Types | |
typedef Graph< TilingNodeInfo, TilingEdgeInfo >::Edge | TilingEdge |
typedef Graph< TilingNodeInfo, TilingEdgeInfo > | TilingGraph |
typedef Graph< TilingNodeInfo, TilingEdgeInfo >::Node | TilingNode |
Private Member Functions | |
void | addOutEdge (int nodeId, int row, int col, int cost) |
bool | conflictDiag (int row, int col, int roff, int coff) |
void | createEdges () |
void | createNodes () |
vector< char > | getCharVector () const |
void | init (Type type, int rows, int columns) |
void | printFormatted (ostream &o, const vector< char > &chars) const |
bool | pruneNode (int targetNodeId, int lastNodeId) const |
void | readObstacles (LineReader &reader) |
Read obstacles from a file. | |
Static Private Member Functions | |
int | getMaxEdges (Type type) |
Private Attributes | |
int | m_columns |
int | m_maxEdges |
int | m_rows |
Type | m_type |
TilingGraph | m_graph |
|
|
|
|
|
Definition at line 234 of file tiling.h. Referenced by getSuccessors(), and pruneNode(). |
|
Definition at line 143 of file tiling.h. Referenced by Tiling(). |
|
Definition at line 41 of file tiling.cpp. References init(). |
|
Definition at line 46 of file tiling.cpp. References getNodeId(), getNodeInfo(), getType(), init(), PathFind::TilingNodeInfo::isObstacle(), m_graph, and PathFind::TilingNodeInfo::setObstacle(). |
|
Construct tiling from a file.
Definition at line 69 of file tiling.cpp. References PathFind::LineReader::createError(), HEX, init(), OCTILE, OCTILE_UNICOST, PathFind::LineReader::readLine(), readObstacles(), TILE, and Type. |
|
Definition at line 133 of file tiling.cpp. References getNodeId(), m_columns, m_graph, and m_rows. Referenced by createEdges(). |
|
Definition at line 140 of file tiling.cpp. References getNumberNodes(), m_graph, and PathFind::TilingNodeInfo::setObstacle(). Referenced by setObstacles(). |
|
Definition at line 488 of file tiling.cpp. References getNodeId(), m_columns, m_graph, and m_rows. Referenced by setObstacles(). |
|
Definition at line 150 of file tiling.cpp. References addOutEdge(), PathFind::COST_ONE, PathFind::COST_SQRT2, getNodeId(), HEX, m_columns, m_rows, m_type, OCTILE, OCTILE_UNICOST, and TILE. Referenced by init(). |
|
Definition at line 194 of file tiling.cpp. References getNodeId(), m_columns, m_graph, and m_rows. Referenced by init(). |
|
Definition at line 204 of file tiling.cpp. References getNumberNodes(), and m_graph. Referenced by printFormatted(), printLabels(), and printPathAndLabels(). |
|
Definition at line 214 of file tiling.h. References m_rows. |
|
Implements PathFind::Environment. Definition at line 219 of file tiling.cpp. References PathFind::COST_ONE, PathFind::COST_SQRT2, HEX, m_columns, m_type, OCTILE, OCTILE_UNICOST, and TILE. |
|
Implements PathFind::Environment. Definition at line 269 of file tiling.cpp. References PathFind::COST_ONE, PathFind::COST_SQRT2, m_type, and OCTILE. |
|
Definition at line 276 of file tiling.cpp. References HEX, OCTILE, OCTILE_UNICOST, and TILE. Referenced by init(). |
|
Implements PathFind::Environment. Definition at line 292 of file tiling.cpp. References PathFind::COST_ONE. |
|
Definition at line 179 of file tiling.h. References m_columns, and m_rows. Referenced by addOutEdge(), conflictDiag(), createEdges(), createNodes(), printFormatted(), readObstacles(), and Tiling(). |
|
Definition at line 219 of file tiling.h. References m_graph. Referenced by Tiling(). |
|
Implements PathFind::Environment. Definition at line 297 of file tiling.cpp. References m_columns, and m_rows. Referenced by clearObstacles(), getCharVector(), isValidNodeId(), printLabels(), printPathAndLabels(), and setObstacles(). |
|
Generate successor nodes for the search.
Implements PathFind::Environment. Definition at line 302 of file tiling.cpp. References HEX, PathFind::TilingNodeInfo::isObstacle(), isValidNodeId(), m_graph, m_maxEdges, m_type, OCTILE, OCTILE_UNICOST, pruneNode(), TILE, and TilingNode. |
|
Definition at line 224 of file tiling.h. References m_type. Referenced by Tiling(). |
|
Definition at line 209 of file tiling.h. References m_columns. |
|
Definition at line 347 of file tiling.cpp. References createEdges(), createNodes(), getMaxEdges(), m_columns, m_graph, m_maxEdges, m_rows, and m_type. Referenced by Tiling(). |
|
Implements PathFind::Environment. Definition at line 358 of file tiling.cpp. References getNumberNodes(). Referenced by getSuccessors(). |
|
Definition at line 368 of file tiling.cpp. References getNodeId(), m_columns, and m_rows. |
|
Definition at line 389 of file tiling.cpp. References getCharVector(), and printFormatted(). |
|
Definition at line 381 of file tiling.cpp. References getCharVector(), and printFormatted(). |
|
Definition at line 363 of file tiling.cpp. References getCharVector(). Referenced by printFormatted(), printLabels(), and printPathAndLabels(). |
|
Print formatted map with char labels. Space characters are not printed on the map. Definition at line 403 of file tiling.cpp. References getCharVector(), getNumberNodes(), and printFormatted(). |
|
Definition at line 416 of file tiling.cpp. References getCharVector(), getNumberNodes(), and printFormatted(). |
|
Definition at line 442 of file tiling.cpp. References m_graph, m_type, TILE, and TilingNode. Referenced by getSuccessors(). |
|
Read obstacles from a file.
Definition at line 459 of file tiling.cpp. References PathFind::LineReader::createError(), getNodeId(), PathFind::TilingNodeInfo::isObstacle(), m_columns, m_graph, m_rows, PathFind::LineReader::readLine(), and PathFind::TilingNodeInfo::setObstacle(). Referenced by Tiling(). |
|
Definition at line 510 of file tiling.cpp. References clearObstacles(), conflictDiag(), PathFind::TilingNodeInfo::getColumn(), getNumberNodes(), PathFind::TilingNodeInfo::getRow(), PathFind::TilingNodeInfo::isObstacle(), m_graph, and PathFind::TilingNodeInfo::setObstacle(). |
|
Definition at line 237 of file tiling.h. Referenced by addOutEdge(), conflictDiag(), createEdges(), createNodes(), getHeuristic(), getNodeId(), getNumberNodes(), getWidth(), init(), printFormatted(), and readObstacles(). |
|
Definition at line 245 of file tiling.h. Referenced by addOutEdge(), clearObstacles(), conflictDiag(), createNodes(), getCharVector(), getNodeInfo(), getSuccessors(), init(), pruneNode(), readObstacles(), setObstacles(), and Tiling(). |
|
Definition at line 239 of file tiling.h. Referenced by getSuccessors(), and init(). |
|
Definition at line 241 of file tiling.h. Referenced by addOutEdge(), conflictDiag(), createEdges(), createNodes(), getHeight(), getNodeId(), getNumberNodes(), init(), printFormatted(), and readObstacles(). |
|
Definition at line 243 of file tiling.h. Referenced by createEdges(), getHeuristic(), getMaxCost(), getSuccessors(), getType(), init(), and pruneNode(). |