pathqueue.c File Reference

#include "pathqueue.h"

Include dependency graph for pathqueue.c:

Go to the source code of this file.

Functions

Queue functions
This functions implements a queue needed by other functions.

int queueIsEmpty (NodeQueue *q)
void pushNode (NodeQueue *q, int x, int y)
void pushNodeLast (NodeQueue *q, int x, int y)
int popNode (NodeQueue *q, Node *n)
void printQueue (NodeQueue *q)
NodeQueuenewQueue (void)
int delQueue (NodeQueue *q)
int isInQueue (NodeQueue *q, int x, int y)
void drainQueue (NodeQueue *q)


Detailed Description

Functions used to manage a queue used by A* Algorithm.
Author:
Jose Maria Martin Laguna <jmmartin@etud.insa-toulouse.fr>

Definition in file pathqueue.c.


Function Documentation

int delQueue ( NodeQueue q  ) 

Free queue memory

Parameters:
q Queue
Returns:
1 if memory was succesfully free 0 if the queue is not empty

Definition at line 133 of file pathqueue.c.

Referenced by aAlgorithm().

Here is the caller graph for this function:

void drainQueue ( NodeQueue q  ) 

Free memory allocated in the queue

Parameters:
q Queue

Definition at line 162 of file pathqueue.c.

Referenced by aAlgorithm().

Here is the caller graph for this function:

int isInQueue ( NodeQueue q,
int  x,
int  y 
)

Finds out if the node (X,Y) is in the queue

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell
Returns:
1 if (X,Y) was founded, 0 otherwise

Definition at line 147 of file pathqueue.c.

Referenced by aAlgorithm(), and calculateMapHeuristic().

Here is the caller graph for this function:

NodeQueue* newQueue ( void   ) 

Init queue values

Parameters:
q Queue

Definition at line 121 of file pathqueue.c.

Referenced by aAlgorithm(), and calculateMapHeuristic().

Here is the caller graph for this function:

int popNode ( NodeQueue q,
Node n 
)

Pop the first node of the queue

Parameters:
q Queue
n Pointer to a node
Returns:
1 if node was succesfully poped 0 if the queue is empty

Definition at line 88 of file pathqueue.c.

Referenced by aAlgorithm(), calculateMapHeuristic(), and drainQueue().

Here is the caller graph for this function:

void printQueue ( NodeQueue q  ) 

Print the queue

Parameters:
q Queue
Note:
Used only for debug

Definition at line 106 of file pathqueue.c.

void pushNode ( NodeQueue q,
int  x,
int  y 
)

Push a node into the queue in a FIFO mode

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell

Definition at line 34 of file pathqueue.c.

Referenced by calculateMapHeuristic().

Here is the caller graph for this function:

void pushNodeLast ( NodeQueue q,
int  x,
int  y 
)

Push a node into the queue in a LIFO mode

Parameters:
q Queue
x Coordonate X of a cell
y Coordonate Y of a cell

Definition at line 61 of file pathqueue.c.

Referenced by aAlgorithm().

Here is the caller graph for this function:

int queueIsEmpty ( NodeQueue q  ) 

Tests if a queue is empty

Parameters:
q A queue
Returns:
1 if the queue is empty, 0 otherwise

Definition at line 23 of file pathqueue.c.

Referenced by aAlgorithm(), calculateMapHeuristic(), delQueue(), popNode(), pushNode(), pushNodeInOrder(), and pushNodeLast().

Here is the caller graph for this function:


Generated on Thu Sep 13 11:28:29 2007 for DCE-Eurobot by  doxygen 1.5.3