removed heading::rnd (not seedable)
fixed grid-walker issues when conducting multiple runs new helper methods for the interpolatorr
This commit is contained in:
@@ -39,20 +39,22 @@ public:
|
||||
gen.seed(1234);
|
||||
}
|
||||
|
||||
|
||||
Distribution::Normal<float> dHead = Distribution::Normal<float>(1, 0.01);
|
||||
Distribution::Normal<float> dWalk = Distribution::Normal<float>(1, 0.10);
|
||||
Distribution::Normal<float> sWalk = Distribution::Normal<float>(0, 0.10);
|
||||
|
||||
GridWalkState<T> getDestination(Grid<T>& grid, const GridWalkState<T>& start, float distance_m, float headChange_rad, Activity act) {
|
||||
|
||||
// proportional change of the heading
|
||||
static Distribution::Normal<float> dHead(1, 0.01);
|
||||
|
||||
|
||||
// proportional change of the to-be-walked distance
|
||||
static Distribution::Normal<float> dWalk(1, 0.10);
|
||||
//static Distribution::Normal<float> dWalk(1, 0.10);
|
||||
|
||||
distance_m = distance_m*dWalk.draw()*1.4; // TODO: why * X?
|
||||
headChange_rad = headChange_rad*dHead.draw();
|
||||
|
||||
static Distribution::Normal<float> sWalk(0, 0.10);
|
||||
//static Distribution::Normal<float> sWalk(0, 0.10);
|
||||
if (distance_m == 0) { distance_m = std::abs( sWalk.draw() ); }
|
||||
|
||||
return walk(grid, start, distance_m, headChange_rad);
|
||||
@@ -90,12 +92,14 @@ private:
|
||||
|
||||
}
|
||||
|
||||
Distribution::Uniform<float> dChange = Distribution::Uniform<float>(Angle::degToRad(0), +Angle::degToRad(359));
|
||||
|
||||
GridWalkState<T> walk(Grid<T>& grid, const GridWalkState<T>& start, const float distance_m, const float headChange_rad) {
|
||||
|
||||
// try-again distribution
|
||||
//static Distribution::Normal<float> dHead(0, Angle::degToRad(10));
|
||||
//static Distribution::Normal<float> dUpdate(0, Angle::degToRad(3));
|
||||
static Distribution::Uniform<float> dChange(Angle::degToRad(0), +Angle::degToRad(359));
|
||||
// static Distribution::Uniform<float> dChange(Angle::degToRad(0), +Angle::degToRad(359));
|
||||
|
||||
int retries = 5;
|
||||
float walked_m = 0;
|
||||
|
||||
Reference in New Issue
Block a user