]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Parameterize maximum iterations
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 31 May 2022 10:39:50 +0000 (12:39 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 31 May 2022 10:46:57 +0000 (12:46 +0200)
incl/rrts.hh
src/rrtext17.cc
src/rrtext18.cc

index 603c0a8cc58a7168a8479fc14b04387977226619..74077df208fb3c0030424e13a8986988c1954a26 100644 (file)
@@ -73,6 +73,7 @@ protected:
        BicycleCar bc_;
        RRTGoal goal_;
        unsigned int icnt_ = 0;
+       unsigned int _imax = 1000;
        Ter ter_;
        std::default_random_engine gen_;
        std::vector<RRTNode> nodes_;
index 61e692c41dfbc343bc5369b7cfb643ddc2d30a58..9512f2084be60616f9f92f8f232cb2fbe9783650 100644 (file)
@@ -11,7 +11,7 @@ namespace rrts {
 bool
 RRTExt17::should_finish() const
 {
-       return this->goal_.p() != nullptr || this->icnt_ > 1000;
+       return this->goal_.p() != nullptr || this->icnt_ > this->_imax;
 }
 
 } // namespace rrts
index 940e396a53be7471823c5065ccc2a0e3e8df89f6..aef1ab9279b145c0ef7b9aeef8a735537e96b3fe 100644 (file)
@@ -11,7 +11,7 @@ namespace rrts {
 bool
 RRTExt18::should_finish() const
 {
-       return this->icnt_ > 1000;
+       return this->icnt_ > this->_imax;
 }
 
 } // namespace rrts