minor changes to grid walking

This commit is contained in:
k-a-z-u
2017-12-13 16:37:51 +01:00
parent 1114331fd2
commit d48b0b8fd4
7 changed files with 41 additions and 24 deletions

View File

@@ -121,7 +121,7 @@ namespace GW3 {
if (grid.hasNodeFor(gp)) {
res.position = p3; // update position
//res.heading; // keep as-is
res.probability *= getP(p3); // keep as-is
res.probability *= 1;//getP(p3); // keep as-is
return res; // done
} else {
@@ -157,7 +157,7 @@ namespace GW3 {
}
res.heading = Heading(start.xy(), end.xy());
res.probability *= getP(end);
res.probability *= 0.1;//getP(end);
res.position = end;
return res;
@@ -237,7 +237,7 @@ namespace GW3 {
int numVisitedNodes = 0;
#define MODE 3
#define MODE 2
#if (MODE == 1)
@@ -249,9 +249,10 @@ namespace GW3 {
for (const Node* dstNode : nodes) {
const Point3 nodeCenter = Helper::gpToP3(*dstNode);
const float walkDist_m = nodeCenter.getDistance(start);//*1.05;
double p = 1.0;
for (const WalkEvaluator<Node>* eval : evals) {
const double p1 = eval->getProbability(start, nodeCenter, params);
const double p1 = eval->getProbability(start, nodeCenter, walkDist_m, params);
p *= p1;
}
if (p > bestNodeP) {
@@ -284,10 +285,11 @@ namespace GW3 {
// destination = nodeCenter + offset (within the node's bbox, (x,y) only! keep z as-is)
const Point3 end(nodeCenter.x + ox, nodeCenter.y + oy, nodeCenter.z);
const float walkDist_m = end.getDistance(start);//*1.05;
double p = 1;
for (const WalkEvaluator<Node>* eval : evals) {
const double p1 = eval->getProbability(start, end, params);
const double p1 = eval->getProbability(start, end, walkDist_m, params);
p *= p1;
}