added new sanity-check assertions

fixed issue with angles [bad interface]
- adjusted other parts accordingly
- added corresponding test-cases
started working on absolute heading
This commit is contained in:
2017-03-31 11:47:29 +02:00
parent 2fdaa795b2
commit 8930be1e2c
10 changed files with 168 additions and 19 deletions

View File

@@ -104,9 +104,19 @@ public:
//if (cnt != 0) {probability /= cnt;} else {probability = 1.0;}
probability = 1.0;
//probability = (maxEdgeProb.isValid()) ? (maxEdgeProb.get()) : (1.0); // dist_m might be zero -> no edges -> no maximum
probability *= curNode->getWalkImportance();// < 0.4f ? (0.1) : (1.0); // "kill" particles that walk near walls (most probably trapped ones)
// add the walk importance to the probabiliy [each node has a to-be-walked-probability depending on its distance to walls, etc...]
const float walkImportance = curNode->getWalkImportance();
Assert::isNotNaN(walkImportance, "grid-node's walk-importance is NaN. Did you forget to calculate the importance values after building the grid?");
Assert::isBetween(walkImportance, 0.0f, 2.5f, "grid-node's walk-importance is out of range. Did you forget to calculate the importance values after building the grid?");
probability *= walkImportance;// < 0.4f ? (0.1) : (1.0); // "kill" particles that walk near walls (most probably trapped ones)
//probability = std::pow(probability, 5);
// sanity check
Assert::isNotNaN(probability, "detected NaN grid-walk probability");
// update after
updateAfter(currentState, *startNode, *curNode);