00001 /* Copyright Robin Schirrmeister and Simon Skilevic 00002 * Lecture Efficient Route Planning Summer Semester 2011 00003 * Uni Freiburg 00004 * Class for Heuristics usable in dijkstra shortest path algorithm 00005 */ 00006 00007 #ifndef ROUTEPLANNINGV2_HEURISTICS_H_ 00008 #define ROUTEPLANNINGV2_HEURISTICS_H_ 00009 #include <stdio.h> 00010 #include "./NodeExpanded.h" 00011 class DistanceHeuristic 00012 { 00013 public: 00014 DistanceHeuristic() {} 00015 virtual ~DistanceHeuristic() {} 00016 virtual double approximateDistance(NodeExpanded* node1, NodeExpanded* node2) 00017 {return 0.0;} 00018 }; 00019 00020 class NoHeuristic: public DistanceHeuristic 00021 { 00022 public: 00023 NoHeuristic() {} 00024 inline double approximateDistance (NodeExpanded* node1, NodeExpanded* node2) { return 0.0;} 00025 }; 00026 00027 class StraightLineHeuristic : public DistanceHeuristic 00028 { 00029 public: 00030 StraightLineHeuristic() {} 00031 double approximateDistance(NodeExpanded* node1, NodeExpanded* node2) 00032 { return node1->straightLineDistanceTo(*node2);} 00033 }; 00034 #endif // ROUTEPLANNINGV2_HEURISTICS_H_ 00035