std::uniform_real_distribution<double> udx_;
std::uniform_real_distribution<double> udy_;
std::uniform_real_distribution<double> udh_;
+ std::uniform_int_distribution<unsigned int> udi_;
virtual RRTNode *nn(RRTNode &t);
virtual std::vector<RRTNode *> nv(RRTNode &t);
void steer(RRTNode &f, RRTNode &t);
h = this->udh_(this->gen_);
}
break;
+ case 3: {
+ this->udi_ = std::uniform_int_distribution<unsigned int>(
+ 0,
+ this->nodes().size() - 1
+ );
+ auto ind = this->udi_(this->gen_);
+ auto n = this->nodes()[ind];
+ x = n.x();
+ y = n.y();
+ h = n.h();
+ break;
+ }
default: // normal
x = this->ndx_(this->gen_);
y = this->ndy_(this->gen_);
case 2: // uniform circle
this->set_sample_uniform_circle();
break;
+ case 3: // uniform index of node in nodes
+ this->set_sample_uniform_circle();
+ break;
default: // normal
this->set_sample_normal(x1, x2, y1, y2, h1, h2);
}