Commit 8139b85c authored by Arne Graf's avatar Arne Graf

finalized FF with transition vector; enabled _targetWithinSubroom mechanic; fixed bresenham inacc

parent 703d4514
Pipeline #9178 failed with stages
in 13 seconds
......@@ -30,7 +30,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
message(STATUS "Compiling with Intel settings")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -w")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -w -tcheck")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Og -w -tcheck")
elseif ()
endif ()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${warnings}")
......@@ -463,6 +463,7 @@ set(header_files
tinyxml/tinystr.h
general/ArgumentParser.h
general/Configuration.h
general/Macros.h
general/randomnumbergenerator.h
......
......@@ -1485,6 +1485,7 @@ bool IniFileParser::ParseStrategyNodeToObject(const TiXmlNode& strategyNode)
Log->Write("ERROR: \tExit Strategy 7 is not supported any longer. Please refer to www.jupedsim.org");
Log->Write("WARNING: \tChanging Exit-Strategy to #9 (Floorfields with targets within subroom)");
pExitStrategy = 9;
_exit_strat_number = 9;
_exit_strategy = std::shared_ptr<DirectionStrategy>(new DirectionSubLocalFloorfield());
break;
case 8:
......@@ -1511,6 +1512,7 @@ bool IniFileParser::ParseStrategyNodeToObject(const TiXmlNode& strategyNode)
return false;
}
Log->Write("INFO: \texit_crossing_strategy < %d >", pExitStrategy);
_config->set_exit_strat(_exit_strat_number);
}
return true;
}
......
......@@ -118,6 +118,7 @@ public:
//ff router
_has_specific_goals = false;
_write_VTK_files = false;
_exit_strat = 9;
//for random numbers
_rdGenerator=RandomNumberGenerator();
......@@ -272,6 +273,10 @@ public:
bool get_write_VTK_files() const {return _write_VTK_files;}
void set_exit_strat(int e_strat) {_exit_strat = e_strat;}
int get_exit_strat() const {return _exit_strat;}
const std::string& GetHostname() const { return _hostname; };
void SetHostname(std::string hostname) { _hostname = hostname; };
......@@ -383,6 +388,8 @@ private:
bool _has_specific_goals;
bool _write_VTK_files;
int _exit_strat;
std::string _hostname;
std::string _trajectoriesFile;
std::string _errorLogFile;
......
......@@ -308,19 +308,18 @@ Point VelocityModel::e0(Pedestrian* ped, Room* room) const
if ( (dynamic_cast<DirectionFloorfield*>(_direction.get())) ||
(dynamic_cast<DirectionLocalFloorfield*>(_direction.get())) ||
(dynamic_cast<DirectionSubLocalFloorfield*>(_direction.get())) ) {
if (dist > 50*J_EPS_GOAL) {
if (dist > 5*J_EPS_GOAL) {
desired_direction = target - pos; //ped->GetV0(target);
} else {
desired_direction = lastE0;
ped->SetLastE0(lastE0); //keep old vector (revert set operation done 9 lines above)
}
}
else if (dist > J_EPS_GOAL) {
} else if (dist > J_EPS_GOAL) {
desired_direction = ped->GetV0(target);
} else {
ped->SetSmoothTurning();
desired_direction = ped->GetV0();
}
}
return desired_direction;
}
......
......@@ -354,9 +354,9 @@ Point DirectionLocalFloorfield::GetTarget(Room* room, Pedestrian* ped) const
}
#endif
floorfield->getDirectionToUID(ped->GetExitIndex(), ped->GetPos(), p);
if (floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos()) < 1.0) {
p = p * floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos());
}
// if (floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos()) < 1.0) {
// p = p * floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos());
// }
return (p + ped->GetPos());
#if DEBUG
......@@ -443,9 +443,9 @@ Point DirectionSubLocalFloorfield::GetTarget(Room* room, Pedestrian* ped) const
}
#endif
floorfield->getDirectionToUID(ped->GetExitIndex(), ped->GetPos(),p);
if (floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos()) < 1.0){
p = p * floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos());
}
// if (floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos()) < 1.0){
// p = p * floorfield->getCostToDestination(ped->GetExitIndex(), ped->GetPos());
// }
return (p + ped->GetPos());
#if DEBUG
......
This diff is collapsed.
......@@ -123,6 +123,7 @@ public:
void markSubroom(const Point& insidePoint, SubRoom* const value);
void createReduWallSpeed(double* reduWallSpeed);
void createPedSpeed(Pedestrian* const * pedsArg, int nsize, int modechoice, double radius);
void finalizeTargetLine(const int uid, const Line& tempTargetLine, Point* newArrayPt, Point& passvector);
void drawLinesOnGrid(std::map<int, Line>& doors, int *const grid);
template <typename T>
......
......@@ -64,6 +64,7 @@ FFRouter::FFRouter(int id, RoutingStrategy s, bool hasSpecificGoals, Configurati
_hasSpecificGoals = hasSpecificGoals;
_globalFF = nullptr;
_targetWithinSubroom = true; //depending on exit_strat 8 => false, depending on exit_strat 9 => true;
_targetWithinSubroom = (_config->get_exit_strat() == 9);
if (s == ROUTING_FF_QUICKEST) {
_mode = quickest;
_recalc_interval = _config->get_recalc_interval();
......
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