INF2004-Project v0.1
 
Loading...
Searching...
No Matches
maze_grid_cell Struct Reference

This struct contains the node information. More...

#include <maze.h>

Collaboration diagram for maze_grid_cell:
[legend]

Data Fields

maze_point_t coordinates
 X and Y coordinates of the node.
 
uint32_t f
 F-value of the node. F = G + H.
 
uint32_t g
 
uint32_t h
 
bool is_visited
 Indicates if the node has been visited before.
 
struct maze_grid_cellp_came_from
 
struct maze_grid_cellp_next [4]
 

Detailed Description

This struct contains the node information.

Note
Ensure that the initialisation of the struct sets all pointers to NULL. Otherwise, the program might have undefined behaviour.

Field Documentation

◆ g

uint32_t g

G-value of the node. G = cost to move from the starting node to the current node.

◆ h

uint32_t h

H-value of the node. H = estimated cost to move from the current node to the end node aka heuristic.

◆ p_came_from

struct maze_grid_cell* p_came_from

Pointer to the node that the current node came from for the A* algorithm.

◆ p_next

struct maze_grid_cell* p_next[4]

Pointers to the next nodes. This is indexed by the direction enum.


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