Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit 52c29bed authored by Arash HABIBI's avatar Arash HABIBI
Browse files

nickel

parent f866d7ba
......@@ -229,7 +229,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxMovingObstacles_ || distSq < maxDistMovingObst)
&& distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst)
......@@ -267,7 +267,7 @@ void Agent::updateObstacleNeighbors()
if ((movingObstacleNeighbors_.size() < maxNeighbors_ || distSq < maxDistMovingObst)
&&distSq < rangeSq_)
{
if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
// if (Geom::testOrientation2D(part_.getPosition(), (*it)->p1, (*it)->p2) == Geom::RIGHT)
{
if (distSq > maxDistMovingObst) maxDistMovingObst = distSq ;
......@@ -600,7 +600,12 @@ void Agent::computeNewVelocity()
VEC3 norm;
double obst_stiffness = 100.0; // agent-obstacle interaction stiffness
int obst_power = 1 ; // the power to which elevate the agent-obstacle distance
double obst_radius_infl = 20.;
double obst_radius_infl;
if(sim_->config==0)
obst_radius_infl = 100.; // scenario 0
else
obst_radius_infl = 40.; // scenario 1 et 3
float force_value;
int nobst=0;
......@@ -628,13 +633,11 @@ void Agent::computeNewVelocity()
force_value = obst_stiffness*collision_softening_factor*(rest_sum_of_dists - sum_of_dists);
VEC3 v_obst = p2 - p1;
VEC3 normal = VEC3(v_obst[1],-v_obst[0],0);
// cerr << "p1=" << p1 << " p2=" << p2 << " normal = " << normal << endl;
// Ajouter une composante tangentielle
normal += v_obst * ((d1-d2)/(5*sum_of_dists));
// Le facteur 3 est là seulement pour diminuer l'influence de la composante tangentielle
// Le facteur 5 est là seulement pour diminuer l'influence de la composante tangentielle
normal.normalize();
forces += force_value * normal;
// cerr << "--------------- limace -------------" << agentNo << "------" << force_value << endl;
}
}
}
......@@ -720,7 +723,7 @@ void Agent::computeNewVelocity()
double ag_power = 1; // the power to which elevate the agent-agent distance
rand = 2.0*drand48()-1.0; // compris entre -1 et 1
double radius_var = 0.8;
double radius_var = 0.5;
double ag_phys_radius_coef = 4.0*(1 + rand*radius_var); // valeurs uniformement réparties entre min et max
unsigned int nbA = 0 ;
......@@ -750,7 +753,8 @@ void Agent::computeNewVelocity()
if(dist < combinedRadius)
{
collision_softening_factor = pow(1-dist/combinedRadius,ag_power);
// collision_softening_factor = pow(1-dist/combinedRadius,ag_power);
collision_softening_factor = 1;
float force_value = - ag_stiffness*collision_softening_factor*(combinedRadius-dist)
- ag_damping * (dist - previous_dist) / sim_->timeStep_;
......
......@@ -115,7 +115,8 @@ void Simulator::doStep()
#endif
movingObstacles_[i]->update() ;
movingObstacles_[i]->updateMesh() ;
// commente par Arash
// movingObstacles_[i]->updateMesh() ;
}
for (unsigned int i = 0 ; i < agents_.size() ; ++i)
......@@ -283,7 +284,7 @@ void Simulator::setupCircleScenario(unsigned int nbAgents , unsigned int nbObsta
}
vPos.clear();
// Un obstacle sur deux va vers le haut
vPos.push_back(start+xSide-ySide);
vPos.push_back(start+xSide+ySide);
vPos.push_back(start-xSide+ySide);
......@@ -589,8 +590,8 @@ void Simulator::setupScenario(unsigned int nbMaxAgent, bool pedWay)
TraversorF<PFP::MAP> tF(envMap_.map);
Dart d = tF.begin() ;
unsigned int nbx = 2 ;
unsigned int nby = 2 ;
unsigned int nbx = 4 ;
unsigned int nby = 4 ;
unsigned int bMax = nbx * nby > 0 ? nbMaxAgent / (nbx * nby) : nbMaxAgent ;
......
......@@ -545,11 +545,11 @@ void SocialAgents::cb_redraw()
moShader->disableVertexAttribs();
}
for (std::vector<MovingMesh*>::iterator it = simulator.movingMeshes_.begin() ; it != simulator.movingMeshes_.end() ; ++it)
// Commente par Arash
/*for (std::vector<MovingMesh*>::iterator it = simulator.movingMeshes_.begin() ; it != simulator.movingMeshes_.end() ; ++it)
{
(*it)->draw();
}
}*/
glColor3f(1.0f, 1.0f, 1.0f) ;
for (std::vector<MovingObstacle*>::iterator it = simulator.movingObstacles_.begin() ; it != simulator.movingObstacles_.end() ; ++it)
......
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