Commit 6f3c4bf1 authored by carlos's avatar carlos

disable ellipse stretching in Krausz Model

parent b99301f2
......@@ -501,7 +501,6 @@ bool IniFileParser::ParseKrauszModel(TiXmlElement* xKrausz, TiXmlElement* xMainN
_config->GetDistEffMaxWall(), _config->GetIntPWidthPed(),
_config->GetIntPWidthWall(), _config->GetMaxFPed(),
_config->GetMaxFWall())));
return true;
}
......@@ -994,6 +993,11 @@ void IniFileParser::ParseAgentParameters(TiXmlElement* operativModel, TiXmlNode*
_config->SetDistEffMaxPed(max_Eb+agentParameters->GetT()*agentParameters->GetV0());
_config->SetDistEffMaxWall(_config->GetDistEffMaxPed());
}
if (_model == 5) // Krausz
{
_config->DoEllipseStretch(false);
}
}
}
}
......
......@@ -87,6 +87,9 @@ public:
_distEffMaxPed = 2;
_distEffMaxWall = 2;
// ----------------
_do_stretch = true;
_use_circles = false;
_hostname = "localhost";
_trajectoriesFile = "trajectories.xml";
_errorLogFile = "log.txt";
......@@ -248,6 +251,11 @@ 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; };
......@@ -303,6 +311,8 @@ 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;
......@@ -323,4 +333,6 @@ private:
};
#endif //JPSCORE_CONFIGURATION_H
......@@ -114,6 +114,12 @@ void AgentsParameters::InitT(double mean, double stdv)
_T = std::normal_distribution<double>(mean,stdv);
}
void AgentsParameters::SetStretch(bool stretch)
{
_do_stretch = stretch;
}
double AgentsParameters::GetV0()
{
......@@ -151,10 +157,12 @@ double AgentsParameters::GetV0IdleEscalatorDownStairs()
return _V0IdleEscalatorDownStairs(_generator);
}
double AgentsParameters::GetBmax()
{
return _Bmax(_generator);
if (_do_stretch)
return _Bmax(_generator);
else
return _last_B;
}
double AgentsParameters::GetBmin()
......@@ -181,6 +189,11 @@ double AgentsParameters::GetT()
{
return _T(_generator);
}
bool AgentsParameters::StretchEnabled()
{
return _do_stretch;
}
std::string AgentsParameters::writeParameter()
{
std::string s;
......
......@@ -147,6 +147,8 @@ public:
*/
void InitT(double mean, double stv);
void SetStretch(bool stretch);
/**
* @return a random number following the distribution
......@@ -193,6 +195,7 @@ public:
*/
double GetBmin();
/**
* @return a random number following the distribution
*/
......@@ -213,6 +216,14 @@ public:
*/
double GetT();
/**
* @return whether Ellipse stretching is enabled
*/
bool StretchEnabled()
{
return _do_stretch;
}
/**
* return a summary of the parameters
*/
......@@ -231,6 +242,8 @@ private:
std::normal_distribution<double> _V0IdleEscalatorDownStairs;
std::normal_distribution<double> _Bmax;
std::normal_distribution<double> _Bmin;
bool _do_stretch = false;
double _last_B;
std::normal_distribution<double> _Atau;
std::normal_distribution<double> _Amin;
std::normal_distribution<double> _Tau;
......
......@@ -124,6 +124,11 @@ void JEllipse::SetV0(double v0)
_vel0 = v0;
}
void JEllipse::DoStretch(bool stretch)
{
_do_stretch = stretch;
}
/*************************************************************
Getter-Funktionen
************************************************************/
......@@ -192,6 +197,11 @@ double JEllipse::GetEA() const
return _Amin + _vel.Norm() * _Av;
}
bool JEllipse::DoesStretch()
{
return _do_stretch;
}
// ellipse semi-axis in the orthogonal direction of the velocity
double JEllipse::GetEB() const
{
......
......@@ -45,6 +45,7 @@ private:
double _Bmin; // pBmax - V *[(pBmax - pBmin) / V0]
double _Bmax;
double _vel0; // desired speed
bool _do_stretch; //Kraus-Model
......@@ -82,6 +83,7 @@ public:
double GetMaxEA()const;
double GetMaxEB()const;
double GetArea()const;
bool DoesStretch
// Effective distance between two ellipses
......
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