]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Move dijkstra node methods to header file
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:54:51 +0000 (14:54 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:54:51 +0000 (14:54 +0100)
rrts/incl/rrtext.hh
rrts/src/rrtext13.cc

index 7de62a6197c85667a2778d30c7be65835454f5ab..c4ed0380d7795085d7c01b9858348c9c372288d5 100644 (file)
@@ -127,16 +127,29 @@ private:
                unsigned int i = 0;
                bool v = false;
                double d = 0.0;
-               bool vi();
-               DijkstraNode(RRTNode* n);
+               bool vi()
+               {
+                       if (this->v) {
+                               return true;
+                       }
+                       this->v = true;
+                       return false;
+               }
+               DijkstraNode(RRTNode* n) : node(n) {}
        };
        class DijkstraNodeComparator {
        public:
-               int operator() (DijkstraNode const& n1, DijkstraNode const& n2);
+               int operator() (DijkstraNode const& n1, DijkstraNode const& n2)
+               {
+                       return n1.node->cc() > n2.node->cc();
+               }
        };
        class DijkstraNodeBackwardComparator {
        public:
-               int operator() (DijkstraNode const& n1, DijkstraNode const& n2);
+               int operator() (DijkstraNode const& n1, DijkstraNode const& n2)
+               {
+                       return n1.d > n2.d;
+               }
        };
        std::vector<RRTNode*> opath_;
        double ogoal_cc_ = 0.0;
index 7e1006c5122773969690f64e5d32321c60f611e9..d506e0b5e6712c12304b1305237c26da90314f50 100644 (file)
 
 namespace rrts {
 
-RRTExt13::DijkstraNode::DijkstraNode(RRTNode* n) : node(n)
-{
-}
-
-bool
-RRTExt13::DijkstraNode::vi()
-{
-       if (this->v) {
-               return true;
-       }
-       this->v = true;
-       return false;
-}
-
-int
-RRTExt13::DijkstraNodeComparator::operator() (DijkstraNode const& n1,
-               DijkstraNode const& n2)
-{
-       return n1.node->cc() > n2.node->cc();
-}
-
-int
-RRTExt13::DijkstraNodeBackwardComparator::operator() (DijkstraNode const& n1,
-               DijkstraNode const& n2)
-{
-       return n1.d > n2.d;
-}
-
 void
 RRTExt13::interesting_forward()
 {