Commit 703d4514 authored by Arne Graf's avatar Arne Graf

UnivFF: never give costs of wallpoints (bresenham-inaccuracy); ff_router delta_h = .0625

parent b1345915
Pipeline #8994 failed with stages
in 13 seconds
......@@ -499,6 +499,7 @@ void DirectionSubLocalFloorfield::Init(Building* buildingArg, double stepsize,
_initDone = true;
//_locffviafm[0]->writeFF()
//write floorfields to file, one file per subroom //ar.graf: [SWITCH writevtk ON/OFF]
// for(unsigned int i = 0; i < subUIDs.size(); ++i) {
// std::vector<int> targets = {};
......
......@@ -1424,12 +1424,12 @@ double UnivFFviaFM::getCostToDestination(const int destID, const Point& position
// }
assert(_grid->includesPoint(position));
long int key = _grid->getKeyAtPoint(position);
if (_gridCode[key] == OUTSIDE) {
if ((_gridCode[key] == OUTSIDE) || (_gridCode[key] == WALL)) {
//bresenham line (treppenstruktur) at middle and calculated centre of line are on different gridpoints
//find a key that belongs domain (must be one left or right and second one below or above)
if (_gridCode[key+1] != OUTSIDE) {
if ((_gridCode[key+1] != OUTSIDE) && (_gridCode[key+1] != WALL)) {
key = key+1;
} else if (_gridCode[key-1] != OUTSIDE){
} else if ((_gridCode[key-1] != OUTSIDE) && (_gridCode[key-1] != WALL)){
key = key-1;
} else {
Log->Write("ERROR:\t In getCostToDestination(3 args)");
......@@ -1458,12 +1458,12 @@ double UnivFFviaFM::getCostToDestination(const int destID, const Point& position
double UnivFFviaFM::getCostToDestination(const int destID, const Point& position) {
assert(_grid->includesPoint(position));
long int key = _grid->getKeyAtPoint(position);
if (_gridCode[key] == OUTSIDE) {
if ((_gridCode[key] == OUTSIDE) || (_gridCode[key] == WALL)) {
//bresenham line (treppenstruktur) getKeyAtPoint yields gridpoint next to edge, although position is on edge
//find a key that belongs domain (must be one left or right and second one below or above)
if (_gridCode[key+1] != OUTSIDE) {
if ((_gridCode[key+1] != OUTSIDE) && (_gridCode[key+1] != WALL)) {
key = key+1;
} else if (_gridCode[key-1] != OUTSIDE){
} else if ((_gridCode[key-1] != OUTSIDE) && (_gridCode[key-1] != WALL)){
key = key-1;
} else {
Log->Write("ERROR:\t In getCostToDestination(2 args)");
......
......@@ -175,7 +175,7 @@ bool FFRouter::Init(Building* building)
auto pairRoomIt = allRooms.begin();
std::advance(pairRoomIt, i);
UnivFFviaFM *locffptr = nullptr;
locffptr = new UnivFFviaFM(pairRoomIt->second.get(), building, 0.125, 0.0, false);
locffptr = new UnivFFviaFM(pairRoomIt->second.get(), building, 0.0625, 0.0, false);
locffptr->setUser(DISTANCE_MEASUREMENTS_ONLY);
locffptr->setMode(CENTERPOINT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment