Commit 476a343a authored by tobias schroedter's avatar tobias schroedter

Added some debug information

parent 36d7aea7
......@@ -578,21 +578,20 @@ double Simulation::RunBody(double maxSimTime)
#endif
// here open transition that should be closed
for (auto& itr: _building->GetAllTransitions())
{
Transition* Trans = itr.second;
if(Trans->isTemporaryClosed())
{
Trans->UpdateClosingTime( _deltaT);
if(Trans->GetClosingTime() <= _deltaT)
{
Trans->changeTemporaryState();
Log-> Write("INFO:\tReset state of door %d, Time=%.2f", Trans->GetID(), Pedestrian::GetGlobalTime());
}
}
}
// TODO fix, opens door everytime...
// for (auto& itr: _building->GetAllTransitions())
// {
// Transition* Trans = itr.second;
// if(Trans->IsTempClose())
// {
// Trans->UpdateClosingTime( _deltaT);
// if(Trans->GetClosingTime() <= _deltaT)
// {
// Trans->changeTemporaryState();
// Log-> Write("INFO:\tReset state of door %d, Time=%.2f", Trans->GetID(), Pedestrian::GetGlobalTime());
// }
// }
// }
}// while time
return t;
}
......
......@@ -370,6 +370,9 @@ bool Building::InitGeometry()
for (auto& transItr : _transitions){
Transition* trans = transItr.second;
std::cout << trans->GetID() << " is open " << trans->IsOpen() << std::endl;
std::cout << trans->GetID() << " is close " << trans->IsClose() << std::endl;
std::cout << trans->GetID() << " is temp_close " << trans->IsTempClose() << std::endl;
}
return true;
}
......
......@@ -337,4 +337,25 @@ DoorState Crossing::GetState() const
void Crossing::SetState(DoorState _state)
{
Crossing::_state = _state;
}
\ No newline at end of file
}
std::string Crossing::toString() const
{
std::stringstream tmp;
// tmp << _point1.toString() << "--" << _point2.toString();
tmp << this->GetPoint1().toString() << "--" << this->GetPoint2().toString();
switch (_state){
case DoorState::OPEN:
tmp << " open";
break;
case DoorState::CLOSE:
tmp << " close";
break;
case DoorState::TEMP_CLOSE:
tmp << " temp_close";
break;
}
return tmp.str();
}
......@@ -226,6 +226,7 @@ public:
void SetState(DoorState _state);
std::string toString() const;
};
#endif /* _CROSSING_H */
\ No newline at end of file
......@@ -277,7 +277,7 @@ public:
/**
* @return a nice formated string describing the line
*/
std::string toString() const;
virtual std::string toString() const;
/**
* @return the angle between two lines
......
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