Commit 13f0a3ea authored by Arne Graf's avatar Arne Graf

Merge branch 'issue269_with_ben' into develop

parents dcfb1c4f a827aea0
Pipeline #9252 failed with stages
in 6 minutes and 8 seconds
......@@ -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;
......
......@@ -314,14 +314,13 @@ Point VelocityModel::e0(Pedestrian* ped, Room* room) const
desired_direction = lastE0;
ped->SetLastE0(lastE0); //keep old vector (revert set operation done 9 lines above)
}
}
else if (dist > J_EPS_GOAL) {
desired_direction = ped->GetV0(target);
} else if (dist > J_EPS_GOAL) {
desired_direction = ped->GetV0(target);
} else {
ped->SetSmoothTurning();
desired_direction = ped->GetV0();
}
return desired_direction;
}
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
......@@ -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 = {};
......
This diff is collapsed.
......@@ -109,8 +109,8 @@ public:
double getCostToDestination(const int destID, const Point& position);
double getDistanceBetweenDoors(const int door1_ID, const int door2_ID);
RectGrid* getGrid();
virtual void getDirectionToUID(int destID, const long int key, Point& direction, int mode);
void getDirectionToUID(int destID, const long int key, Point& direction);
virtual void getDirectionToUID(int destID, long int key, Point& direction, int mode);
void getDirectionToUID(int destID, long int key, Point& direction);
virtual void getDirectionToUID(int destID, const Point& pos, Point& direction, int mode);
void getDirectionToUID(int destID, const Point& pos, Point& direction);
double getDistance2WallAt(const Point& pos);
......@@ -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