Commit 48e7d2d8 authored by Pierre Kraemer's avatar Pierre Kraemer

rien d'important..

parent af76ccee
......@@ -9,7 +9,7 @@
typedef CGoGN::Geom::Vec3f VEC3;
static const float RVO_EPSILON = 0.0001f;
static const float RVO_EPSILON = 0.00001f;
struct Line {
VEC3 point;
......
......@@ -101,9 +101,9 @@ void Agent::update()
velocity_[1] = newVelocity_[1];
VEC3 target = part_.m_position + (velocity_ * sim_->timeStep_);
meanSpeed_ *= 3.0f;
meanSpeed_ += velocity_;
meanSpeed_ /= 4.0f;
// meanSpeed_ *= 3.0f;
// meanSpeed_ += velocity_;
// meanSpeed_ /= 4.0f;
//
// meanPos_ *= 9.0f;
// meanPos_ += part_.m_position;
......
......@@ -171,13 +171,11 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void EnvMap::init()
{
float sideSize = 70.0f;
unsigned int nbSquares = 14;
// float sideSize = 420.0f;
// unsigned int nbSquares = 4;
unsigned int nbSquares = 6;
// CityGenerator::generateGrid<PFP>(map, position,nbSquares,nbSquares, sideSize, obstacleMark,buildingMark);
CityGenerator::generateGrid<PFP>(map, position,nbSquares,nbSquares, sideSize, obstacleMark,buildingMark);
// CityGenerator::generateCorridor<PFP>(map, position, obstacleMark, buildingMark, 50, nbSquares);
CityGenerator::generateCity<PFP>(map, position, obstacleMark, buildingMark, sideSize, nbSquares);
// 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::convexifyFreeSpace<PFP>(map, position, obstacleMark, buildingMark);
......@@ -621,12 +619,11 @@ void EnvMap::updateMap()
dd = map.phi1(dd);
} while(dd != old);
if(fLevel>1 && !coarsenMark.isMarked(old) && agentvect[old].size() < nbAgentsToSimplify / 4)
if(fLevel > 1 && !coarsenMark.isMarked(old) && agentvect[old].size() < nbAgentsToSimplify / 4)
{
coarsenMark.mark(old);
coarsenCandidate.push_back(map.faceOldestDart(old));
}
}
}
map.setCurrentLevel(cur) ;
......
......@@ -6,8 +6,8 @@ Simulator::Simulator() : globalTime_(0.0f), timeStep_(0.2f)
envMap_.init();
std::cout << "setup scenario" << std::endl;
// importAgents("myAgents.pos");
setupScenario(700);
// setupCircleScenario(1000);
// setupScenario(700);
setupCircleScenario(250);
// setupCityScenario(-1.0f*(24*(70/2.0f)-10),-1.0f*(24*(70.0f/2.0f)-10),167,5);
// addPathsToAgents();
......@@ -97,11 +97,11 @@ void Simulator::doStep()
globalTime_ += timeStep_;
if(int(globalTime_ / timeStep_) % 2000 == 0)
{
std::cout << "swap goals (globalTime -> " << globalTime_ << ")" << std::endl ;
swapAgentsGoals();
}
// if(int(globalTime_ / timeStep_) % 2000 == 0)
// {
// std::cout << "swap goals (globalTime -> " << globalTime_ << ")" << std::endl ;
// swapAgentsGoals();
// }
}
bool Simulator::reachedGoal()
......@@ -118,7 +118,7 @@ void Simulator::setupCircleScenario(unsigned int nbMaxAgent)
{
float pi = 3.14159265358979323846f;
float r = 800.0f;
float r = 200.0f;
for (int i = 0; i < nbMaxAgent; ++i) {
VEC3 posagent(std::cos(i * 2.0f * pi / float(nbMaxAgent))*r,std::sin(i * 2.0f * pi / float(nbMaxAgent))*r,0);
Dart dCell = envMap_.getBelongingCell(posagent);
......
......@@ -338,18 +338,18 @@ void SocialAgents::animate()
// std::cout << "t : " << sim.globalTime_ << std::endl;
// timeval startTime;
// gettimeofday(&startTime, NULL);
// timeval endTime;
// long seconds, nseconds;
timeval startTime;
gettimeofday(&startTime, NULL);
timeval endTime;
long seconds, nseconds;
sim.doStep();
// gettimeofday(&endTime, NULL);
// seconds = endTime.tv_sec - startTime.tv_sec;
// nseconds = endTime.tv_usec - startTime.tv_usec;
//
// elapsedTime += (seconds + nseconds/1000000.0) ;
gettimeofday(&endTime, NULL);
seconds = endTime.tv_sec - startTime.tv_sec;
nseconds = endTime.tv_usec - startTime.tv_usec;
elapsedTime += (seconds + nseconds/1000000.0) ;
// if(sim.globalTime_ - int(sim.globalTime_) == 0.0f && int(sim.globalTime_) % 1500 == 0)
// {
......@@ -357,11 +357,11 @@ void SocialAgents::animate()
// timer->stop();
// }
// if(sim.reachedGoal())
// {
// std::cout << "end " << elapsedTime << std::endl;
// timer->stop();
// }
if(sim.reachedGoal())
{
std::cout << "end " << elapsedTime << std::endl;
timer->stop();
}
if(render_anim)
{
......
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