added new data-structures
added new test-cases added flexible dijkstra calculation added debugging log modified: plotting, grid-generation, grid-importance, refactoring
This commit is contained in:
@@ -13,22 +13,24 @@ template<int, typename> class Grid;
|
||||
* to store additional information for each node besides
|
||||
* the user's requested data-structure
|
||||
*/
|
||||
class GridNode {
|
||||
struct GridNode {
|
||||
|
||||
private:
|
||||
|
||||
template<int, typename> friend class Grid;
|
||||
|
||||
/** INTERNAL: array-index */
|
||||
int _idx = -1;
|
||||
int _idx;
|
||||
|
||||
/** INTERNAL: number of neighbors */
|
||||
int _numNeighbors = 0;
|
||||
int _numNeighbors;
|
||||
|
||||
/** INTERNAL: store neighbors (via index) */
|
||||
int _neighbors[12] = {};
|
||||
int _neighbors[10];
|
||||
|
||||
public:
|
||||
|
||||
GridNode() {;}
|
||||
GridNode() : _idx(-1), _numNeighbors(0), _neighbors() {;}
|
||||
|
||||
/** get the node's index within its grid */
|
||||
int getIdx() const {return _idx;}
|
||||
@@ -36,10 +38,10 @@ public:
|
||||
/** get the number of neighbors for this node */
|
||||
int getNumNeighbors() const {return _numNeighbors;}
|
||||
|
||||
/** get the n-th neighbor for this node */
|
||||
template <int gridSize_cm, typename T> inline T& getNeighbor(const int nth, const Grid<gridSize_cm, T>& grid) const {
|
||||
return grid.getNeighbor(_idx, nth);
|
||||
}
|
||||
// /** get the n-th neighbor for this node */
|
||||
// template <int gridSize_cm, typename T> inline T& getNeighbor(const int nth, const Grid<gridSize_cm, T>& grid) const {
|
||||
// return grid.getNeighbor(_idx, nth);
|
||||
// }
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user