Commit f0adcdd9 authored by Thomas's avatar Thomas
Browse files

correction add path

parent 8d93b635
......@@ -555,6 +555,7 @@ void installGuardRail(typename PFP::MAP& map,typename PFP::TVEC3& position, Cell
obstacleMark.mark(dIn);
buildingMark.mark(dIn);
buildingMark.mark(dExt);
buildingMark.mark(dIn);
railVert.mark(map.phi_1(dIn));
railVert.mark(map.phi1(dExt));
// obstacleMark.mark(map.phi_1(dIn));
......
......@@ -43,9 +43,9 @@ void EnvMap::init()
{
float sideSize = 70.0f;
unsigned int nbSquares = 40;
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::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
CityGenerator::generateMall<PFP>(map, position, obstacleMark, buildingMark, sideSize);
// CityGenerator::simplifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
map.init();
registerObstaclesInFaces();
for(unsigned int i = subdivisableFace.begin(); i < subdivisableFace.end(); subdivisableFace.next(i))
......
......@@ -5,8 +5,8 @@ Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.1f)
srand(10);
envMap_.init();
std::cout << "setup scenario" << std::endl;
importAgents("myAgents.pos");
// setupScenario(15000);
// importAgents("myAgents.pos");
setupScenario(15000);
addPathsToAgents();
for(unsigned int i = 0; i < agents_.size(); ++i)
{
......@@ -124,7 +124,9 @@ void Simulator::setupScenario(unsigned int nbMaxAgent)
void Simulator::addPathsToAgents()
{
unsigned int dartDistForPath=50;
//city
// unsigned int dartDistForPath=50;
unsigned int dartDistForPath=4;
for(unsigned int i = 0; i < agents_.size(); ++i)
{
agents_[i]->goals_.clear();
......@@ -133,9 +135,9 @@ void Simulator::addPathsToAgents()
Dart dStop = dStart;
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop) || j < dartDistForPath+rand()*20; ++j)
{
envMap_.map.next(dStop);
if(dStop == envMap_.map.end())
dStop = envMap_.map.begin();
envMap_.map.next(dStop);
}
std::vector<Dart> path = CGoGN::PathFinder::pathFindAStar<PFP>(envMap_.map, envMap_.position, dStart, dStop, envMap_.buildingMark);
......@@ -146,9 +148,9 @@ void Simulator::addPathsToAgents()
Dart dStop2 = dStop;
for(unsigned int j = 0; envMap_.buildingMark.isMarked(dStop2) || j < dartDistForPath+rand()*20; ++j)
{
envMap_.map.next(dStop2);
if(dStop2 == envMap_.map.end())
dStop2 = envMap_.map.begin();
envMap_.map.next(dStop2);
}
path = CGoGN::PathFinder::pathFindAStar<PFP>(envMap_.map, envMap_.position, dStop, dStop2, envMap_.buildingMark);
......
......@@ -247,7 +247,7 @@ void SocialAgents::animate()
std::ostringstream tmpNb;
tmpNb << std::setfill('0') << std::setw(4) << nbGenerated;
nbGenerated++;
oss << "./planSerre/exportSceneOle" << tmpNb.str() << ".pov";
oss << "./planMall/mallScene" << tmpNb.str() << ".pov";
std::string chaine = oss.str();
// VEC3 agPos = sim.agents_[0]->meanPos_;
// agPos[2] = agPos[1];
......
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