39 lines
970 B
C++

#ifndef GRAPH_H
#define GRAPH_H
#include<iostream>
#include <vector>
class GraphEdge;
class GraphNode
{
std::vector<GraphNode*> m_neighbours;
int m_testvalue; //temp variable
float m_priority;
public:
GraphNode();
GraphNode(std::vector<GraphNode*>);
std::vector<GraphNode*> getNeighbours();
void addNeighbours(GraphNode*);
int getNbNeighbours();
virtual float cost(GraphNode*){
std::cout << "WARNING : You're using the default cost function. For better result, redefine the cost function in GraphNode." << std::endl;
return 1;
}
virtual float heuristic(GraphNode*){
std::cout << "WARNING : You're using the default heuristic function. For better result, redefine the heuristic function in GraphNode." << std::endl;
return 0;
}
void setValue(int);
int getValue();
void setPriority(float);
float getPriority();
void print(std::string prefix);
};
#endif // GRAPH_H