Commit f5663c3c authored by Arne Graf's avatar Arne Graf

Merge branch 'develop' into escalator

parents c58f05d5 311f63fa
Pipeline #9332 failed with stages
in 4 minutes and 13 seconds
...@@ -6,8 +6,8 @@ before_script: ...@@ -6,8 +6,8 @@ before_script:
- nproc=`grep -c '^processor' /proc/cpuinfo` - nproc=`grep -c '^processor' /proc/cpuinfo`
- echo "nproc = $nproc" - echo "nproc = $nproc"
- export LD_LIBRARY_PATH=$HOME/boost_1_61_0/stage/lib/:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH=$HOME/boost_1_61_0/stage/lib/:$LD_LIBRARY_PATH
#========== Pipeline ================== #========== Pipeline ==================
stages: stages:
- configure - configure
...@@ -46,7 +46,7 @@ make-linux: ...@@ -46,7 +46,7 @@ make-linux:
- lib - lib
- lib/Debug - lib/Debug
- bin - bin
stage: compile stage: compile
tags: tags:
- linux - linux
...@@ -54,13 +54,14 @@ make-linux: ...@@ -54,13 +54,14 @@ make-linux:
- cd build - cd build
- make -j$nproc - make -j$nproc
- echo "compile | ${CI_PROJECT_DIR}" - echo "compile | ${CI_PROJECT_DIR}"
tags:
- linux
#============== unit_test ============ #============== unit_test ============
test: test:
dependencies: dependencies:
- make-linux - make-linux
stage: unit_test stage: unit_test
script: script:
- cd build - cd build
- ctest -R Boost - ctest -R Boost
...@@ -75,7 +76,7 @@ verification: ...@@ -75,7 +76,7 @@ verification:
script: script:
- cd build - cd build
- ctest -R juelich - ctest -R juelich
only: only:
- develop - develop
tags: tags:
- linux - linux
...@@ -90,7 +91,7 @@ verification: ...@@ -90,7 +91,7 @@ verification:
# script: # script:
# - cd build # - cd build
# - ctest -R rimea # - ctest -R rimea
# only: # only:
# - develop # - develop
# tags: # tags:
# - linux # - linux
...@@ -105,7 +106,7 @@ verification: ...@@ -105,7 +106,7 @@ verification:
# script: # script:
# - cd build # - cd build
# - ctest -R validation # - ctest -R validation
# only: # only:
# - develop # - develop
# tags: # tags:
# - linux # - linux
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "math/GompertzModel.h" #include "math/GompertzModel.h"
#include "math/GradientModel.h" #include "math/GradientModel.h"
#include "pedestrian/AgentsQueue.h" #include "pedestrian/AgentsQueue.h"
#include "pedestrian/AgentsSourcesManager.h"
#ifdef _OPENMP #ifdef _OPENMP
#else #else
...@@ -61,6 +61,7 @@ Simulation::Simulation(Configuration* args) ...@@ -61,6 +61,7 @@ Simulation::Simulation(Configuration* args)
_fps = 1; _fps = 1;
_em = nullptr; _em = nullptr;
_gotSources = false; _gotSources = false;
_maxSimTime = 100;
// _config = args; // _config = args;
} }
...@@ -201,6 +202,7 @@ bool Simulation::InitArgs() ...@@ -201,6 +202,7 @@ bool Simulation::InitArgs()
sprintf(tmp, "\tt_max: %f\n", _config->GetTmax()); sprintf(tmp, "\tt_max: %f\n", _config->GetTmax());
s.append(tmp); s.append(tmp);
_deltaT = _config->Getdt(); _deltaT = _config->Getdt();
_maxSimTime = _config->GetTmax();
sprintf(tmp, "\tdt: %f\n", _deltaT); sprintf(tmp, "\tdt: %f\n", _deltaT);
_periodic = _config->IsPeriodic(); _periodic = _config->IsPeriodic();
sprintf(tmp, "\t periodic: %d\n", _periodic); sprintf(tmp, "\t periodic: %d\n", _periodic);
...@@ -214,10 +216,11 @@ bool Simulation::InitArgs() ...@@ -214,10 +216,11 @@ bool Simulation::InitArgs()
_routingEngine = _config->GetRoutingEngine(); _routingEngine = _config->GetRoutingEngine();
auto distributor = std::unique_ptr<PedDistributor>(new PedDistributor(_config)); auto distributor = std::unique_ptr<PedDistributor>(new PedDistributor(_config));
// IMPORTANT: do not change the order in the following.. // IMPORTANT: do not change the order in the following..
_building = std::unique_ptr<Building>(new Building(_config, *distributor)); _building = std::shared_ptr<Building>(new Building(_config, *distributor));
// Initialize the agents sources that have been collected in the pedestrians distributor // Initialize the agents sources that have been collected in the pedestrians distributor
_agentSrcManager.SetBuilding(_building.get()); _agentSrcManager.SetBuilding(_building.get());
_agentSrcManager.SetMaxSimTime(GetMaxSimTime());
_gotSources = (bool) distributor->GetAgentsSources().size(); // did we have any sources? false if no sources _gotSources = (bool) distributor->GetAgentsSources().size(); // did we have any sources? false if no sources
for (const auto& src: distributor->GetAgentsSources()) { for (const auto& src: distributor->GetAgentsSources()) {
_agentSrcManager.AddSource(src); _agentSrcManager.AddSource(src);
...@@ -529,12 +532,31 @@ void Simulation::RunFooter() ...@@ -529,12 +532,31 @@ void Simulation::RunFooter()
void Simulation::ProcessAgentsQueue() void Simulation::ProcessAgentsQueue()
{ {
/* std::cout << "Call Simulation::ProcessAgentsQueue() at: " << Pedestrian::GetGlobalTime() << std::endl; */
/* std::cout << KRED << " SIMULATION building " << _building << " size " << _building->GetAllPedestrians().size() << "\n" << RESET; */
/* for(auto pp: _building->GetAllPedestrians()) */
/* std::cout<< KBLU << "BUL: Simulation: " << pp->GetPos()._x << ", " << pp->GetPos()._y << RESET << std::endl; */
//incoming pedestrians //incoming pedestrians
vector<Pedestrian*> peds; vector<Pedestrian*> peds;
// std::cout << ">>> peds " << peds.size() << RESET<< std::endl;
AgentsQueueIn::GetandClear(peds); AgentsQueueIn::GetandClear(peds);
//std::cout << "SIMULATION BEFORE BOOL = " << _agentSrcManager.IsBuildingUpdated() << " peds size " << peds.size() << "\n" ;
//_agentSrcManager.SetBuildingUpdated(true);
/* std::cout << "SIMULATION AFTER BOOL = " << _agentSrcManager.IsBuildingUpdated() << "\n" ; */
for (auto&& ped: peds) { for (auto&& ped: peds) {
/* std::cout << "Add to building : " << ped->GetPos()._x << ", " << ped->GetPos()._y << " t: "<< Pedestrian::GetGlobalTime() << std::endl; */
_building->AddPedestrian(ped); _building->AddPedestrian(ped);
} }
// for(auto pp: _building->GetAllPedestrians())
// std::cout<< KBLU << "BUL: Simulation: " << pp->GetPos()._x << ", " << pp->GetPos()._y << " t: "<< Pedestrian::GetGlobalTime() <<RESET << std::endl;
/* std::cout << "LEAVE Simulation::ProcessAgentsQueue() with " << " size " << _building->GetAllPedestrians().size() << "\n" << RESET; */
} }
void Simulation::UpdateDoorticks() const { void Simulation::UpdateDoorticks() const {
...@@ -619,3 +641,7 @@ Building* Simulation::GetBuilding() ...@@ -619,3 +641,7 @@ Building* Simulation::GetBuilding()
{ {
return _building.get(); return _building.get();
} }
int Simulation::GetMaxSimTime() const{
return _maxSimTime;
}
...@@ -67,7 +67,7 @@ private: ...@@ -67,7 +67,7 @@ private:
///seed using for the random number generator ///seed using for the random number generator
unsigned int _seed; unsigned int _seed;
/// building object /// building object
std::unique_ptr<Building> _building; std::shared_ptr<Building> _building;
/// Force model to use /// Force model to use
std::shared_ptr<OperationalModel> _operationalModel; std::shared_ptr<OperationalModel> _operationalModel;
/// Manage all route choices algorithms /// Manage all route choices algorithms
...@@ -85,6 +85,8 @@ private: ...@@ -85,6 +85,8 @@ private:
/// hybrid simulation manager /// hybrid simulation manager
//HybridSimulationManager //HybridSimulationManager
int _periodic; int _periodic;
int _maxSimTime;
bool _gotSources; // is true if we got some sources. Otherwise, false. bool _gotSources; // is true if we got some sources. Otherwise, false.
// bool _printPB; // print progressbar // bool _printPB; // print progressbar
public: public:
...@@ -182,6 +184,8 @@ public: ...@@ -182,6 +184,8 @@ public:
* *
*/ */
void UpdateDoorticks() const; void UpdateDoorticks() const;
int GetMaxSimTime() const;
}; };
......
...@@ -841,7 +841,7 @@ void Building::AddPedestrian(Pedestrian* ped) ...@@ -841,7 +841,7 @@ void Building::AddPedestrian(Pedestrian* ped)
for (unsigned int p = 0; p<_allPedestians.size(); p++) { for (unsigned int p = 0; p<_allPedestians.size(); p++) {
Pedestrian* ped1 = _allPedestians[p]; Pedestrian* ped1 = _allPedestians[p];
if (ped->GetID()==ped1->GetID()) { if (ped->GetID()==ped1->GetID()) {
cout << "Pedestrian already in the room ??? " << ped->GetID() << endl; cout << "Pedestrian " << ped->GetID() << " already in the room." << endl;
return; return;
} }
} }
...@@ -1047,5 +1047,3 @@ Transition* Building::GetTransitionByUID(int uid) const ...@@ -1047,5 +1047,3 @@ Transition* Building::GetTransitionByUID(int uid) const
//} //}
#endif // _SIMULATOR #endif // _SIMULATOR
...@@ -49,7 +49,7 @@ int main(int argc, char** argv) ...@@ -49,7 +49,7 @@ int main(int argc, char** argv)
Configuration* configuration = new Configuration(); Configuration* configuration = new Configuration();
// Parsing the arguments // Parsing the arguments
bool status = false; bool status = false;
{ {
//ArgumentParser* p = new ArgumentParser(configuration); //Memory Leak //ArgumentParser* p = new ArgumentParser(configuration); //Memory Leak
std::unique_ptr<ArgumentParser> p(new ArgumentParser(configuration)); std::unique_ptr<ArgumentParser> p(new ArgumentParser(configuration));
status = p->ParseArgs(argc, argv); status = p->ParseArgs(argc, argv);
...@@ -86,8 +86,12 @@ int main(int argc, char** argv) ...@@ -86,8 +86,12 @@ int main(int argc, char** argv)
//Start the thread for managing the sources of agents if any //Start the thread for managing the sources of agents if any
//std::thread t1(sim.GetAgentSrcManager()); //std::thread t1(sim.GetAgentSrcManager());
double simMaxTime = configuration->GetTmax(); double simMaxTime = configuration->GetTmax();
std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());//@todo pass simMaxTime to Run std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());
//main thread for the simulation while(!sim.GetAgentSrcManager().IsRunning())
{
// std::cout << "waiting...\n";
}
//main thread for the simulation
evacTime = sim.RunStandardSimulation(simMaxTime); evacTime = sim.RunStandardSimulation(simMaxTime);
//Join the main thread //Join the main thread
t1.join(); t1.join();
...@@ -111,7 +115,6 @@ int main(int argc, char** argv) ...@@ -111,7 +115,6 @@ int main(int argc, char** argv)
} }
double execTime = difftime(endtime, starttime); double execTime = difftime(endtime, starttime);
std::stringstream summary; std::stringstream summary;
summary << std::setprecision(2) << std::fixed; summary << std::setprecision(2) << std::fixed;
summary << "\nExec Time [s] : " << execTime << std::endl; summary << "\nExec Time [s] : " << execTime << std::endl;
......
...@@ -242,7 +242,7 @@ void VelocityModel::ComputeNextTimeStep(double current, double deltaT, Building* ...@@ -242,7 +242,7 @@ void VelocityModel::ComputeNextTimeStep(double current, double deltaT, Building*
//double winkel = spacings[0].second; //double winkel = spacings[0].second;
//Point tmp; //Point tmp;
Point speed = direction.Normalized() *OptimalSpeed(ped, spacing); Point speed = direction.Normalized() *OptimalSpeed(ped, spacing);
result_acc.push_back(speed); result_acc.push_back(speed);
spacings.clear(); //clear for ped p spacings.clear(); //clear for ped p
...@@ -369,7 +369,8 @@ my_pair VelocityModel::GetSpacing(Pedestrian* ped1, Pedestrian* ped2, Point ei, ...@@ -369,7 +369,8 @@ my_pair VelocityModel::GetSpacing(Pedestrian* ped1, Pedestrian* ped2, Point ei,
//printf("ERROR: \tin VelocityModel::forcePedPed() ep12 can not be calculated!!!\n"); //printf("ERROR: \tin VelocityModel::forcePedPed() ep12 can not be calculated!!!\n");
Log->Write("WARNING: \tin VelocityModel::GetSPacing() ep12 can not be calculated!!!\n"); Log->Write("WARNING: \tin VelocityModel::GetSPacing() ep12 can not be calculated!!!\n");
Log->Write("\t\t Pedestrians are too near to each other (%f).", Distance); Log->Write("\t\t Pedestrians are too near to each other (%f).", Distance);
exit(EXIT_FAILURE); my_pair(FLT_MAX, ped2->GetID());
exit(EXIT_FAILURE); //TODO
} }
double condition1 = ei.ScalarProduct(ep12); // < e_i , e_ij > should be positive double condition1 = ei.ScalarProduct(ep12); // < e_i , e_ij > should be positive
...@@ -410,7 +411,9 @@ Point VelocityModel::ForceRepPed(Pedestrian* ped1, Pedestrian* ped2, int periodi ...@@ -410,7 +411,9 @@ Point VelocityModel::ForceRepPed(Pedestrian* ped1, Pedestrian* ped2, int periodi
Log->Write("\t\t Maybe the value of <a> in force_ped should be increased. Going to exit.\n"); Log->Write("\t\t Maybe the value of <a> in force_ped should be increased. Going to exit.\n");
printf("ped1 %d ped2 %d\n", ped1->GetID(), ped2->GetID()); printf("ped1 %d ped2 %d\n", ped1->GetID(), ped2->GetID());
printf("ped1 at (%f, %f), ped2 at (%f, %f)\n", ped1->GetPos()._x, ped1->GetPos()._y, ped2->GetPos()._x, ped2->GetPos()._y); printf("ped1 at (%f, %f), ped2 at (%f, %f)\n", ped1->GetPos()._x, ped1->GetPos()._y, ped2->GetPos()._x, ped2->GetPos()._y);
exit(EXIT_FAILURE); exit(EXIT_FAILURE); //TODO: quick and dirty fix for issue #158
// (sometimes sources create peds on the same location)
} }
Point ei = ped1->GetV().Normalized(); Point ei = ped1->GetV().Normalized();
if(ped1->GetV().NormSquare()<0.01){ if(ped1->GetV().NormSquare()<0.01){
......
This diff is collapsed.
...@@ -84,6 +84,7 @@ public: ...@@ -84,6 +84,7 @@ public:
* Set the building object * Set the building object
*/ */
void SetBuilding(Building* building); void SetBuilding(Building* building);
void SetRunning(bool running);
/** /**
* @return true if all agents have been generated * @return true if all agents have been generated
...@@ -91,6 +92,14 @@ public: ...@@ -91,6 +92,14 @@ public:
*/ */
bool IsCompleted() const; bool IsCompleted() const;
/**
* @return true if the building is updated
*
*/
bool IsBuildingUpdated() const;
void SetBuildingUpdated(bool update);
/** /**
* Return a pointer to the building object * Return a pointer to the building object
*/ */
...@@ -111,10 +120,13 @@ public: ...@@ -111,10 +120,13 @@ public:
/** /**
* Return the total number of agents that will be generated. * Return the total number of agents that will be generated.
* used by visualisation to allocate space * used by visualisation to allocate space
*
*/ */
long GetMaxAgentNumber() const; long GetMaxAgentNumber() const;
int GetMaxSimTime() const;
void SetMaxSimTime(int t);
bool IsRunning() const;
private: private:
/** /**
...@@ -165,11 +177,16 @@ private: ...@@ -165,11 +177,16 @@ private:
std::vector<std::shared_ptr<AgentsSource> > _sources; std::vector<std::shared_ptr<AgentsSource> > _sources;
///to control the trigger of the events ///to control the trigger of the events
long int _lastUpdateTime = 0; long int _lastUpdateTime = 0;
int maxSimTime = 0;
/// building object /// building object
Building* _building=nullptr; Building* _building=nullptr;
/// whether all agents have been dispatched /// whether all agents have been dispatched
static bool _isCompleted; static bool _isCompleted;
//std::atomic<bool>_isCompleted=false; //std::atomic<bool>_isCompleted=false;
// std::atomic<bool>_buildingUpdated=false;
bool _buildingUpdated;
bool _isRunning = false;
}; };
#endif /* AGENTSSOURCESMANAGER_H_ */ #endif /* AGENTSSOURCESMANAGER_H_ */
...@@ -198,7 +198,9 @@ void Pedestrian::SetID(int i) ...@@ -198,7 +198,9 @@ void Pedestrian::SetID(int i)
_id = i; _id = i;
if(i<=0) if(i<=0)
{ {
cout<<"invalid ID"<<i<<endl;exit(0); cerr<<">> Invalid pedestrians ID " << i<< endl;
cerr<<">> Pedestrian ID should be > 0. Exit." << endl;
exit(0);
} }
} }
...@@ -597,7 +599,7 @@ double Pedestrian::GetV0Norm() const ...@@ -597,7 +599,7 @@ double Pedestrian::GetV0Norm() const
// // getc(stdin); // // getc(stdin);
walking_speed =(1-f*g)*_ellipse.GetV0() + f*g*speed_down; walking_speed =(1-f*g)*_ellipse.GetV0() + f*g*speed_down;
// printf("%f DOWN max_e=%f, z=%f, f=%f, v0=%f, v0d=%f, ret=%f\n", _globalTime, maxSubElevation, ped_elevation, f, _ellipse.GetV0(), _V0DownStairs, (1-f*g)*_ellipse.GetV0() + f*g*speed_down); // printf("%f DOWN max_e=%f, z=%f, f=%f, v0=%f, v0d=%f, ret=%f\n", _globalTime, maxSubElevation, ped_elevation, f, _ellipse.GetV0(), _V0DownStairs, (1-f*g)*_ellipse.GetV0() + f*g*speed_down);
} }
...@@ -630,7 +632,7 @@ double Pedestrian::GetV0Norm() const ...@@ -630,7 +632,7 @@ double Pedestrian::GetV0Norm() const
walking_speed = (1-f*g)*_ellipse.GetV0() + f*g*speed_up; walking_speed = (1-f*g)*_ellipse.GetV0() + f*g*speed_up;
} }
} }
//IF execution of WalkingInSmoke depending on JPSfire section in INI file //IF execution of WalkingInSmoke depending on JPSfire section in INI file
if(_WalkingSpeed && _WalkingSpeed->ReduceWalkingSpeed()) { if(_WalkingSpeed && _WalkingSpeed->ReduceWalkingSpeed()) {
...@@ -641,7 +643,7 @@ double Pedestrian::GetV0Norm() const ...@@ -641,7 +643,7 @@ double Pedestrian::GetV0Norm() const
//WHERE should the call to that routine be placed properly? //WHERE should the call to that routine be placed properly?
//only executed every 3 seconds //only executed every 3 seconds
// fprintf(stderr, "%f\n", walking_speed); // fprintf(stderr, "%f\n", walking_speed);
return walking_speed; return walking_speed;
// orthogonal projection on the stair // orthogonal projection on the stair
//return _ellipse.GetV0()*_building->GetRoom(_roomID)->GetSubRoom(_subRoomID)->GetCosAngleWithHorizontal(); //return _ellipse.GetV0()*_building->GetRoom(_roomID)->GetSubRoom(_subRoomID)->GetCosAngleWithHorizontal();
...@@ -1225,6 +1227,3 @@ bool Pedestrian::Relocate(std::function<void(const Pedestrian&)> flowupdater) { ...@@ -1225,6 +1227,3 @@ bool Pedestrian::Relocate(std::function<void(const Pedestrian&)> flowupdater) {
} }
return status; return status;
} }
This diff is collapsed.
...@@ -30,67 +30,67 @@ class Point; ...@@ -30,67 +30,67 @@ class Point;
// TODO: bool IsSpace(SubRoom* subroom, Point& pt,Point& v1); // TODO: bool IsSpace(SubRoom* subroom, Point& pt,Point& v1);
/** /**
* Calculates if a point (which is inside the subroom) is far enough from the walls, transitions, crossings ( > radius of a person) * Calculates if a point (which is inside the subroom) is far enough from the walls, transitions, crossings ( > radius of a person)
* @param subroom * @param subroom
* @param pt * @param pt
*/ */
bool IsEnoughInSubroom( SubRoom* subroom, Point& pt, double radius ); bool IsEnoughInSubroom( SubRoom* subroom, Point& pt, double radius );
/** /**
* Position incoming pedestrian using voronoi from boost library * Position incoming pedestrian using voronoi from boost library
* @param src * @param src
* @param peds * @param peds
*/ */
bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>& peds, Building* _building); bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>& peds, Building* _building, std::vector<Pedestrian*>& peds_queue);
/** /**
* Position incoming pedestrian on the vertex with the greatest distance * Position incoming pedestrian on the vertex with the greatest distance
* @param discrete_positions, positions of existing pedestrians + fake pedestrians (but multiplied with the factor) * @param discrete_positions, positions of existing pedestrians + fake pedestrians (but multiplied with the factor)
* @param vd * @param vd
* @param subroom * @param subroom
* @param max_it, after calling the function this will be the iterator of the best vertex * @param max_it, after calling the function this will be the iterator of the best vertex
* @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex * @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex
* @param radius, radius of a person * @param radius, radius of a person
*/ */
void VoronoiBestVertexMax(const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, void VoronoiBestVertexMax(const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd,
SubRoom* subroom, double factor, voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, SubRoom* subroom, double factor, voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis,
double radius); double radius);
/** /**
* Position incoming pedestrian on the vertex with greater probability for greater distances * Position incoming pedestrian on the vertex with greater probability for greater distances
* @param discrete_positions * @param discrete_positions
* @param vd * @param vd
* @param subroom * @param subroom
* @param max_it, after calling the function this will be the iterator of the best vertex * @param max_it, after calling the function this will be the iterator of the best vertex
* @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex * @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex
* @param radius, radius of a person * @param radius, radius of a person
*/ */
void VoronoiBestVertexRandMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor, void VoronoiBestVertexRandMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius); voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius);
void VoronoiBestVertexGreedy (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor, void VoronoiBestVertexGreedy (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius); voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius);
void plotVoronoi(const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor); void plotVoronoi(const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor);
/** /**
* Position incoming pedestrian on a random vertex * Position incoming pedestrian on a random vertex
* @param discrete_positions * @param discrete_positions
* @param vd * @param vd
* @param subroom * @param subroom
* @param max_it, after calling the function this will be the iterator of the best vertex * @param max_it, after calling the function this will be the iterator of the best vertex
* @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex * @param max_dis, after calling the function this will be the (distance*factor)^2 where distance is the distance to the chosen vertex
* @param radius, radius of a person * @param radius, radius of a person
*/ */
void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor, void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius ); voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis, double radius );
/** /**
* Gives a person the mean velocity of his voronoi-neighbours * Gives a person the mean velocity of his voronoi-neighbours
* @param vd * @param vd
* @param chosen_it * @param chosen_it
* @param velocities_vector * @param velocities_vector
*/ */
void VoronoiAdjustVelocityNeighbour(voronoi_diagram<double>::const_vertex_iterator& chosen_it, Pedestrian* ped, void VoronoiAdjustVelocityNeighbour(voronoi_diagram<double>::const_vertex_iterator& chosen_it, Pedestrian* ped,
const std::vector<Point>& velocities_vector, const std::vector<int>& goal_vector); const std::vector<Point>& velocities_vector, const std::vector<int>& goal_vector);
......
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