Commit ac94ca7c authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

gestion coarsenCandidates

parent faef5f07
......@@ -54,7 +54,7 @@ void EnvMap::init()
unsigned int nbSquares = 15;
CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// CityGenerator::generateMall<PFP>(map, position, obstacleMark, buildingMark, sideSize);
CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
// CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
map.init();
registerObstaclesInFaces();
for(unsigned int i = subdivisableFace.begin(); i < subdivisableFace.end(); subdivisableFace.next(i))
......@@ -249,10 +249,6 @@ void EnvMap::updateMap()
for(std::vector<Dart>::iterator it = refineCandidate.begin(); it != refineCandidate.end(); ++it)
{
Dart d = (*it) ;
if(!map.isDartValid(d))
{
std::cout << "refine INVALID" << std::endl ;
}
refineMark.unmark(d);
if(agentvect[d].size() > nbAgentsToSubdivide)
......@@ -371,11 +367,6 @@ void EnvMap::updateMap()
for(std::vector<Dart>::iterator it = coarsenCandidate.begin(); it != coarsenCandidate.end(); ++it)
{
Dart d = (*it) ;
if(!map.isDartValid(d))
{
std::cout << "coarsen INVALID" << std::endl ;
continue ;
}
coarsenMark.unmark(d) ;
unsigned int fLevel = map.faceLevel(d) ;
......@@ -420,7 +411,10 @@ void EnvMap::updateMap()
while(start != coarsenCandidate.end())
{
if(map.getEmbedding(FACE_ORBIT, *start) == fEmb)
start = coarsenCandidate.erase(start) ;
{
*start = coarsenCandidate.back() ;
coarsenCandidate.pop_back() ;
}
else
++start ;
}
......@@ -457,7 +451,10 @@ void EnvMap::updateMap()
while(start != coarsenCandidate.end())
{
if(map.getEmbedding(FACE_ORBIT, *start) == fEmb)
start = coarsenCandidate.erase(start) ;
{
*start = coarsenCandidate.back() ;
coarsenCandidate.pop_back() ;
}
else
++start ;
}
......
......@@ -79,9 +79,9 @@ void Simulator::doStep()
globalTime_ += timeStep_;
if(globalTime_ - int(globalTime_) == 0.0f && int(globalTime_) % 500 == 0)
if(int(globalTime_ / timeStep_) % 1500 == 0)
{
std::cout << "swap goals" << std::endl ;
std::cout << "swap goals (globalTime -> " << globalTime_ << std::endl ;
swapAgentsGoals();
}
}
......
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