Commit fb58bf75 authored by qiancheng xu's avatar qiancheng xu

Clean up useless code in GCVMMODEL

parent 635c80d9
Pipeline #22008 passed with stages
in 23 minutes and 35 seconds
......@@ -1997,7 +1997,19 @@ bool IniFileParser::ParseGCVMModel(TiXmlElement* xGCVM, TiXmlElement* xMainNode)
_config->SetTd(atof(Td.c_str()));
}
Log->Write("INFO: \ttime_parameters Ts=%0.2f, Td=%0.2f", _config->GetTs(), _config->GetTd());
if (xModelPara->FirstChild("GCVM")) {
if (!xModelPara->FirstChildElement("GCVM")->Attribute("using"))
_config->SetGCVMUsing(0);
else {
string GCVMUsing = xModelPara->FirstChildElement("GCVM")->Attribute("using");
_config->SetGCVMUsing(atoi(GCVMUsing.c_str()));
}
_config->GetGCVMUsing() == 1 ?
Log->Write("INFO:\tUsing GCVM model") :
Log->Write("INFO:\tUsing CVM model");
}
}
//Parsing the agent parameters
......@@ -2005,7 +2017,7 @@ bool IniFileParser::ParseGCVMModel(TiXmlElement* xGCVM, TiXmlElement* xMainNode)
ParseAgentParameters(xGCVM, xAgentDistri);
_config->SetModel(std::shared_ptr<OperationalModel>(new GCVMModel(_exit_strategy, _config->GetaPed(),
_config->GetDPed(), _config->GetaWall(),
_config->GetDWall(), _config->GetTs(), _config->GetTd())));
_config->GetDWall(), _config->GetTs(), _config->GetTd(), _config->GetGCVMUsing())));
return true;
}
......
This diff is collapsed.
......@@ -70,6 +70,8 @@ private:
double _Ts;
double _Td;
int _GCVMUsing=1;
double OptimalSpeed(Pedestrian* ped, double spacing) const;
/**
......@@ -90,7 +92,7 @@ private:
*
* @return Point
*/
my_pair GetSpacing(Pedestrian* ped1, Pedestrian* ped2, Point ei, double k_deltaT, int periodic) const;
my_pair GetSpacing(Pedestrian* ped1, Pedestrian* ped2, Point ei, int periodic) const;
/**
* Repulsive force between two pedestrians ped1 and ped2
* @param ped1 Pointer to Pedestrian: First pedestrian
......@@ -108,7 +110,7 @@ private:
*
* @return Point
*/
Point ForceRepRoom(Pedestrian* ped, SubRoom* subroom, Point e0, Point pdesire) const;
Point ForceRepRoom(Pedestrian* ped, SubRoom* subroom, Point e0) const;
/**
* Repulsive force between pedestrian <ped> and wall <l>
*
......@@ -117,14 +119,14 @@ private:
*
* @return Point
*/
Point ForceRepWall(Pedestrian* ped, const Line& l, const Point& centroid, bool inside, Point e0, Point pdesire) const;
Point ForceRepWall(Pedestrian* ped, const Line& l, const Point& centroid, bool inside, Point e0) const;
double GetSpacingRoom(Pedestrian* ped, SubRoom* subroom, Point ei) const;
double GetSpacingWall(Pedestrian* ped, const Line& l, Point ei) const;
public:
GCVMModel(std::shared_ptr<DirectionStrategy> dir, double aped, double Dped,
double awall, double Dwall, double Ts, double Td);
double awall, double Dwall, double Ts, double Td, int GCVM);
virtual ~GCVMModel(void);
......@@ -179,6 +181,8 @@ public:
* @param periodic: used in some utests for periodic scenarios (very specific)
*/
virtual void ComputeNextTimeStep(double current, double deltaT, Building* building, int periodic);
int GetGCVMU() const;
};
......
......@@ -231,29 +231,6 @@ double JEllipse::GetEB() const
double x = (_vel0 <= 0.001) ? 0 : (_Bmax - _Bmin) / _vel0;
return _Bmax - _vel.Norm() * x;
*/
/*
if (_vel.Norm() <= 0.10)
{
return 0.23;
}
if (_vel.Norm() <= 0.25)
{
return 0.17;
}
if (_vel.Norm() <= 0.3)
{
return 0.16;
}
if (_vel.Norm() <= 0.8)
{
return 0.15;
}
if (_vel.Norm() <= 1.0)
{
return 0.23;
}
return 0.35;
*/
// new function for b
double vmid = 0.10;
double n = 50;
......
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