// Include file for A-star search algorithm

// These are global parameters that constrain the search

#define MAXNODES  30000

// These are useful enumerations
#define OPEN 1
#define NEW 0
#define CLOSED 2

typedef struct {
  int  id;
  int  depth;
  int  state;   // {OPEN, NEW, CLOSED}
  double g;
  double h;
  double f;
  void *parent;
  void *child;
  void *next;
  void *prev;
  void *nodeInfo;
} Node;

typedef Node *NodePtr;

typedef struct {
  Node *child;
  void *next;
} ChildNode;

typedef ChildNode *ChildPtr;


// function prototypes
Node *AStarSearch(Node *root, 
				  double (*gcalc)(Node *), 
				  double (*hcalc)(Node *), 
				  int (*goalNode)(Node *), 
				  Node *(*children)(Node *),
				  void (*freeNode)(Node *),
				  int (*nodeEqual)(Node *, Node *),
				  void (*printNode)(Node *),
		                  void (*graphNode)(Node *, char));


