Commit 0f2d1e6c authored by pitiot's avatar pitiot
Browse files

TODO check getbelongingCEll

parent ac470ab7
......@@ -52,9 +52,9 @@ public:
VEC3 front;
//difference entre 2 listes utilisé pour update
// std::list<Dart> * res_diff;
std::set<std::pair<float, Agent*> > agentNeighbors_ ;
std::set<std::pair<float, Obstacle*> > obstacleNeighbors_ ;
std::set<std::pair<float, Obstacle*> > movingObstNeighbors_;
// std::set<std::pair<float, Agent*> > agentNeighbors_ ;
// std::set<std::pair<float, Obstacle*> > obstacleNeighbors_ ;
// std::set<std::pair<float, Obstacle*> > movingObstNeighbors_;
float rot;
VEC3 finalGoal;
......
......@@ -274,7 +274,7 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
}
}
std::cout << "ERROR : pos not in map" << std::endl ;
// std::cout << "ERROR : pos not in map for getBelongingCell" << std::endl ;
return map.begin() ;
}
#endif
......
......@@ -71,7 +71,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, V
{
assert(pos.size() > 2);
movingObstNeighbors_.reserve(maxNeighbors_);
// movingObstNeighbors_.reserve(maxNeighbors_);
rot = rota;
VEC3 sum = 0;
......
......@@ -107,18 +107,21 @@ void Simulator::doStep()
#endif
for (unsigned int i = 0 ; i < agents_.size() ; ++i)
{
agents_[i]->updateObstacleNeighbors() ;
if (agents_[i]->alive)
{
agents_[i]->updateObstacleNeighbors() ;
#ifndef SPATIAL_HASHING
envMap_.map.setCurrentLevel(envMap_.map.getMaxLevel()) ;
envMap_.map.setCurrentLevel(envMap_.map.getMaxLevel()) ;
#endif
agents_[i]->updateAgentNeighbors() ;
agents_[i]->updateAgentNeighbors() ;
#ifndef SPATIAL_HASHING
envMap_.map.setCurrentLevel(0) ;
envMap_.map.setCurrentLevel(0) ;
#endif
agents_[i]->computePrefVelocity() ;
agents_[i]->computeNewVelocity() ;
agents_[i]->computePrefVelocity() ;
agents_[i]->computeNewVelocity() ;
}
}
#ifdef SPATIAL_HASHING
......@@ -186,7 +189,9 @@ void Simulator::addAgent(const VEC3& start, const std::vector<VEC3>& goal)
agents_.push_back(a) ;
envMap_.addAgentInGrid(a) ;
#else
Dart dCell = envMap_.getBelongingCell(start) ;
// if (dCell==envMap_.map.begin()) CGoGNout<<"pbagents"<<CGoGNendl;
agents_.push_back(new Agent(this, start, dCell)) ;
#endif
......@@ -226,7 +231,7 @@ void Simulator::setupCircleScenario(unsigned int nbAgents)
for (unsigned int i = 0 ; i < movingObstacles_.size() ; ++i)
{
movingObstacles_[i]->updateFixedObstNeighbors() ;
// movingObstacles_[i]->updateFixedObstNeighbors() ;
movingObstacles_[i]->computePrefVelocity() ;
movingObstacles_[i]->update() ;
}
......
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