Commit 83bbf8e1 authored by Mohcine Chraibi's avatar Mohcine Chraibi

remove debug messages from smokesensor

parent d9e94080
Pipeline #6496 failed with stages
in 4 minutes and 46 seconds
......@@ -104,17 +104,17 @@ void SmokeSensor::execute(const Pedestrian * pedestrian, CognitiveMap& cognitive
item->GetCrossing()->GetCentre(),
pedestrian->GetGlobalTime()).GetKnotValue(pedestrian->GetPos()._x,
pedestrian->GetPos()._y);
if(SmokeFactor > 2){
// if(SmokeFactor > 2){
std::cout << "\n =================================== \n";
std::cout << "Ped: " << pedestrian->GetID() << ", at (" << pedestrian->GetPos()._x << ", " << pedestrian->GetPos()._y << ")" << std::endl;
std::cout << "\tElevation: " << pedestrian->GetElevation() << std::endl;
std::cout << "\titem->GetCrossing()->GetCentre(): " << item->GetCrossing()->GetCentre()._x << ", " << item->GetCrossing()->GetCentre()._y << std::endl;
std::cout << "\t Time: " << pedestrian->GetGlobalTime() << std::endl;
std::cout << "\tKnotValue: " << _FMStorage->GetFDSMesh(pedestrian->GetElevation(), item->GetCrossing()->GetCentre(), pedestrian->GetGlobalTime()).GetKnotValue(pedestrian->GetPos()._x, pedestrian->GetPos()._y) << std::endl;
std::cout << "SmokeFactor: " << SmokeFactor << std::endl;
std::cout << "Risktolerance: " << RiskTolerance << std::endl;
}
// std::cout << "\n =================================== \n";
// std::cout << "Ped: " << pedestrian->GetID() << ", at (" << pedestrian->GetPos()._x << ", " << pedestrian->GetPos()._y << ")" << std::endl;
// std::cout << "\tElevation: " << pedestrian->GetElevation() << std::endl;
// std::cout << "\titem->GetCrossing()->GetCentre(): " << item->GetCrossing()->GetCentre()._x << ", " << item->GetCrossing()->GetCentre()._y << std::endl;
// std::cout << "\t Time: " << pedestrian->GetGlobalTime() << std::endl;
// std::cout << "\tKnotValue: " << _FMStorage->GetFDSMesh(pedestrian->GetElevation(), item->GetCrossing()->GetCentre(), pedestrian->GetGlobalTime()).GetKnotValue(pedestrian->GetPos()._x, pedestrian->GetPos()._y) << std::endl;
// std::cout << "SmokeFactor: " << SmokeFactor << std::endl;
// std::cout << "Risktolerance: " << RiskTolerance << std::endl;
// }
weight = 1 + (1-RiskTolerance) * SmokeFactor ;
}
/// Set Edge Weight
......
......@@ -202,12 +202,12 @@ void FDSMesh::SetKnotValuesFromFile(const std::string &filename)
auto c_header = Header.data<double>();
auto c_matrix = smoke_factor_grid_norm.data<double>();
for (int i=0; i< Header.num_vals ; i++)
std::cout << "Header i: " << i << ": " << c_header[i] << std::endl;
// for (int i=0; i< Header.num_vals ; i++)
// std::cout << "Header i: " << i << ": " << c_header[i] << std::endl;
// keep these for loops for debugging purpose
for (int j=0; j< smoke_factor_grid_norm.num_vals; j++)
std::cout << "Matrix j: "<< c_matrix[j] << std::endl;
// for (int j=0; j< smoke_factor_grid_norm.num_vals; j++)
// std::cout << "Matrix j: "<< c_matrix[j] << std::endl;
/// read header
double cellsize = c_header[0];
......@@ -216,19 +216,19 @@ void FDSMesh::SetKnotValuesFromFile(const std::string &filename)
double ymin = c_header[3];
double ymax = c_header[4];
std::cout << "xmin=" << xmin << " , xmax=" << xmax << " , ymin=" << ymin << ", ymax=" << ymax << " , dx=" << cellsize << std::endl;
//std::cout << "xmin=" << xmin << " , xmax=" << xmax << " , ymin=" << ymin << ", ymax=" << ymax << " , dx=" << cellsize << std::endl;
SetUpMesh(xmin,ymin,xmax,ymax,cellsize);
//Read matrix
int ncol = smoke_factor_grid_norm.shape[1];
int nrow = smoke_factor_grid_norm.shape[0];
unsigned int ncol = smoke_factor_grid_norm.shape[1];
unsigned int nrow = smoke_factor_grid_norm.shape[0];
for (unsigned int i=0; i< nrow; i++)
for (unsigned int j=0; j< ncol; j++) {
double tmp_value = c_matrix[i*ncol+j];
if(std::isnan(tmp_value) || std::isinf(tmp_value))
tmp_value = 1.0;
std::cout << "i = " << i << " j = " << j << ": " << tmp_value << std::endl;
//std::cout << "i = " << i << " j = " << j << ": " << tmp_value << std::endl;
_matrix[i][j].SetValue(tmp_value); //TODO: implement =operator
}
pFile.close();
......
......@@ -171,12 +171,12 @@ void FDSMeshStorage::CreateTimeList()
if (_doorlist.size() > 0) { // Smoke sensor active
check_str = _filepath + _quantitylist[0] + "/" +
_doorlist[0] + "/t_" + std::to_string(elem) + ".npz";
std::cout << "1: " << check_str << std::endl;
//std::cout << "1: " << check_str << std::endl;
}
else if (_doorlist.size() == 0) { // Smoke sensor not active
check_str = _filepath + _quantitylist[0] + "/Z_" +
std::to_string(_elevationlist[0]) + "/t_" + std::to_string(elem) + ".npz";
std::cout << "2: " << check_str << std::endl;
//std::cout << "2: " << check_str << std::endl;
}
if (fs::exists(check_str) == false )
......@@ -185,7 +185,7 @@ void FDSMeshStorage::CreateTimeList()
std::cout << "Not found: " << check_str << std::endl;
exit(EXIT_FAILURE);
}
std::cout << "LEAVING \n" ;
//std::cout << "LEAVING \n" ;
}
}
......@@ -197,19 +197,15 @@ void FDSMeshStorage::CreateFDSMeshes()
if (_doorlist.size() > 0) { // Smoke sensor active
for (auto &h:_quantitylist) //list of quantities
{
std::cout << "H: " << h << std::endl;
for (auto &j:_doorlist) //list of doors
{
std::cout << "door: " << j << std::endl;
{
//std::cout << "door " << j << std::endl;
for (auto &k:_timelist) //list of times
{
std::cout << "time: " << k << std::endl;
std::string str = h + "/" + j + "/t_"+std::to_string(k);
std::cout << _filepath + str + ".npz" << std::endl;
//std::cout << _filepath + str + ".npz" << std::endl;
FDSMesh mesh(_filepath + str + ".npz");
//std::string str = "t_"+std::to_string(i);
_fMContainer.insert(std::make_pair(str, mesh));
......
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