cajun::graph_search_t< ID_T > Class Template Reference

#include <graph_search.H>

List of all members.

Classes

class  node_containter_t
class  search_node_t
 Search node to keep track of graph's nodes. More...

Public Member Functions

 graph_search_t (graph_t< ID_T > *graph_)
void print_graph ()
 Print the nodes visited by the graph search.
bool search_graph (typename graph_t< ID_T >::vertex_t *start_gn, typename graph_t< ID_T >::vertex_t *end_gn, std::deque< ID_T > &path_)
 Finds the path from 'start_id' to 'end_id' in the graph and returns the path in 'path_' variable.
void clear_all_nodes ()
 Delete the memory allocated to record search nodes, and clears the m_all_nodes vector.

Private Member Functions

search_node_tget_search_node (typename graph_t< ID_T >::vertex_t *node_)
bool update_cost (search_node_t *node_src_, search_node_t *node_dest_, typename graph_t< ID_T >::edge_t *edge_)
 updates the cost of the edge between node_src and node_dest nodes
void extract_path (std::deque< ID_T > &path_, search_node_t *last_node_)
 Extracts the path from given 'last_node' to first node of graph search, by following the 'prev_s_node' variable of each node which stores the pointer to parent node which contributed to the cost of present node.
void add_to_cont_list (search_node_t *node, std::deque< node_containter_t > &node_cont_list)
 Search if 'node' is already in the node_cont_list, if not adds it to it.

Private Attributes

graph_t< ID_T > * m_graph
std::vector< search_node_t * > m_all_nodes

template<typename ID_T>
class cajun::graph_search_t< ID_T >


Constructor & Destructor Documentation

template<typename ID_T>
cajun::graph_search_t< ID_T >::graph_search_t ( graph_t< ID_T > *  graph_  )  [inline]

Member Function Documentation

template<typename ID_T>
void cajun::graph_search_t< ID_T >::add_to_cont_list ( search_node_t node,
std::deque< node_containter_t > &  node_cont_list 
) [inline, private]

Search if 'node' is already in the node_cont_list, if not adds it to it.

Referenced by cajun::graph_search_t< rp_containter_t >::search_graph().

template<typename ID_T>
void cajun::graph_search_t< ID_T >::clear_all_nodes (  )  [inline]

Delete the memory allocated to record search nodes, and clears the m_all_nodes vector.

Referenced by cajun::graph_search_t< rp_containter_t >::search_graph().

template<typename ID_T>
void cajun::graph_search_t< ID_T >::extract_path ( std::deque< ID_T > &  path_,
search_node_t last_node_ 
) [inline, private]

Extracts the path from given 'last_node' to first node of graph search, by following the 'prev_s_node' variable of each node which stores the pointer to parent node which contributed to the cost of present node.

Referenced by cajun::graph_search_t< rp_containter_t >::search_graph().

template<typename ID_T>
search_node_t* cajun::graph_search_t< ID_T >::get_search_node ( typename graph_t< ID_T >::vertex_t *  node_  )  [inline, private]
template<typename ID_T>
void cajun::graph_search_t< ID_T >::print_graph (  )  [inline]

Print the nodes visited by the graph search.

Referenced by cajun::graph_search_t< rp_containter_t >::search_graph().

template<typename ID_T>
bool cajun::graph_search_t< ID_T >::search_graph ( typename graph_t< ID_T >::vertex_t *  start_gn,
typename graph_t< ID_T >::vertex_t *  end_gn,
std::deque< ID_T > &  path_ 
) [inline]

Finds the path from 'start_id' to 'end_id' in the graph and returns the path in 'path_' variable.

template<typename ID_T>
bool cajun::graph_search_t< ID_T >::update_cost ( search_node_t node_src_,
search_node_t node_dest_,
typename graph_t< ID_T >::edge_t *  edge_ 
) [inline, private]

updates the cost of the edge between node_src and node_dest nodes

Referenced by cajun::graph_search_t< rp_containter_t >::search_graph().


Member Data Documentation

template<typename ID_T>
std::vector<search_node_t *> cajun::graph_search_t< ID_T >::m_all_nodes [private]
template<typename ID_T>
graph_t<ID_T>* cajun::graph_search_t< ID_T >::m_graph [private]

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

Generated on Fri Apr 9 10:45:15 2010 for UCPlanner by  doxygen 1.6.1