Commit 887b15e8 authored by carlos's avatar carlos

disable ellipse stretching in Krausz Model

parent 6f3c4bf1
......@@ -996,7 +996,7 @@ void IniFileParser::ParseAgentParameters(TiXmlElement* operativModel, TiXmlNode*
if (_model == 5) // Krausz
{
_config->DoEllipseStretch(false);
agentParameters->DoStretch(false);
}
}
}
......
......@@ -87,8 +87,6 @@ public:
_distEffMaxPed = 2;
_distEffMaxWall = 2;
// ----------------
_do_stretch = true;
_use_circles = false;
_hostname = "localhost";
_trajectoriesFile = "trajectories.xml";
......@@ -251,11 +249,6 @@ public:
void AddAgentsParameters(std::shared_ptr<AgentsParameters> agentsParameters,
int id) { _agentsParameters[id] = agentsParameters; };
void DoEllipseStretch(bool stretch) { _do_stretch = stretch; }
void UseCircles(bool circles) { _use_circles = circles; }
#ifdef _JPS_AS_A_SERVICE
const bool GetRunAsService() const { return _runAsService; };
......@@ -311,8 +304,6 @@ private:
double _maxFWall;
double _distEffMaxPed;
double _distEffMaxWall;
bool _do_stretch; //Krausz Model
bool _use_circles; //Velocity Model
std::string _hostname;
std::string _trajectoriesFile;
std::string _errorLogFile;
......
......@@ -114,7 +114,7 @@ void AgentsParameters::InitT(double mean, double stdv)
_T = std::normal_distribution<double>(mean,stdv);
}
void AgentsParameters::SetStretch(bool stretch)
void AgentsParameters::DoStretch(bool stretch)
{
_do_stretch = stretch;
}
......@@ -159,10 +159,7 @@ double AgentsParameters::GetV0IdleEscalatorDownStairs()
double AgentsParameters::GetBmax()
{
if (_do_stretch)
return _Bmax(_generator);
else
return _last_B;
return _Bmax(_generator);
}
double AgentsParameters::GetBmin()
......
......@@ -147,7 +147,7 @@ public:
*/
void InitT(double mean, double stv);
void SetStretch(bool stretch);
void DoStretch(bool stretch);
/**
......
......@@ -66,6 +66,7 @@ JEllipse::JEllipse(const JEllipse& orig)
_Av = orig.GetAv();
_Bmin = orig.GetBmin(); // Semi-axis in direction of shoulders: pBmax - V *[(pBmax - pBmin) / V0]
_Bmax = orig.GetBmax();
_do_stretch = orig.DoesStretch();
_vel0 = orig.GetV0(); // desired speed
}
......@@ -214,9 +215,13 @@ double JEllipse::GetEB() const
// printf("v=%f, b=%f\n", v, t);
// getc(stdin);
//return (v<v_min)? 0.5*b_shoulder: 0.5*(b_shoulder + a * exp(b*v));
double x = (_vel0 <= 0.001) ? 0 : (_Bmax - _Bmin) / _vel0;
if (_do_stretch)
{
double x = (_vel0 <= 0.001) ? 0 : (_Bmax - _Bmin) / _vel0;
return _Bmax - _vel.Norm() * x;
} else {
return _Bmin;
}
// double b_shoulder = _Bmin; /// width of shoulder. todo: find out empricial value
// double v_min = 0.001;
// double a = 0.49;
......@@ -235,9 +240,7 @@ double JEllipse::GetEB() const
// x = (_Bmax - _Bmin) / _vel0;
//else
// x = 0;
return _Bmax - _vel.Norm() * x;
}
......
......@@ -65,6 +65,7 @@ public:
void SetBmin(double b_min);
void SetBmax(double b_max);
void SetV0(double v0);
void DoStretch(bool stretch);
const Point& GetV() const;
......@@ -83,7 +84,7 @@ public:
double GetMaxEA()const;
double GetMaxEB()const;
double GetArea()const;
bool DoesStretch
bool DoesStretch() const;
// Effective distance between two ellipses
......
......@@ -224,6 +224,7 @@ Pedestrian* StartDistribution::GenerateAgent(Building* building, int* pid, vecto
E.SetAmin(_groupParameters->GetAmin());
E.SetBmax(_groupParameters->GetBmax());
E.SetBmin(_groupParameters->GetBmin());
E.DoStretch(_groupParameters->StretchEnabled());
ped->SetEllipse(E);
ped->SetTau(_groupParameters->GetTau());
ped->SetV0Norm(_groupParameters->GetV0(),
......
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