Main Page
Namespaces
Classes
Files
File List
File Members
libism
ISM
combinatorial_trainer
HeightChecker.cpp
Go to the documentation of this file.
1
18
#include "
HeightChecker.hpp
"
19
#include "sstream"
20
#include "
utility/LogHelper.hpp
"
21
22
namespace
ISM
{
23
24
bool
HeightChecker::isTreeValid
(
TreePtr
tree)
25
{
26
if
(tree->getHeight() >
mMaxHeight
)
27
{
28
LogHelper::logMessage
(
"Rejected tree because its height ("
+ std::to_string(tree->getHeight())
29
+
") is greater than the max height ("
+ std::to_string(
mMaxHeight
) +
")\n"
,
30
LOG_INFO
,
LOG_COLOR_TREE_VALDIATOR_COLOR
);
31
return
false
;
32
}
33
LogHelper::logMessage
(
"Tree is valid \n"
,
LOG_INFO
,
LOG_COLOR_TREE_VALDIATOR_COLOR
);
34
return
true
;
35
}
36
37
std::string
HeightChecker::getDescription
()
38
{
39
std::stringstream s;
40
s <<
"TreeValidator is HeightChecker.cpp : "
<< std::endl
41
<<
"- Checking if tree height is <= "
<<
mMaxHeight
42
<<
" and if tree is connected"
<< std::endl;
43
return
s.str();
44
}
45
}
46
HeightChecker.hpp
LogHelper.hpp
ISM::LogHelper::logMessage
static void logMessage(const std::string &message, LogLevel logLevel=LOG_INFO, const char *logColor=LOG_COLOR_DEFAULT)
Definition:
LogHelper.cpp:96
ISM::HeightChecker::isTreeValid
bool isTreeValid(TreePtr tree)
Definition:
HeightChecker.cpp:24
ISM::TreeValidator::LOG_COLOR_TREE_VALDIATOR_COLOR
const char * LOG_COLOR_TREE_VALDIATOR_COLOR
Definition:
TreeValidator.hpp:31
ISM::TreePtr
boost::shared_ptr< Tree > TreePtr
Definition:
typedef.hpp:46
ISM::HeightChecker::mMaxHeight
unsigned mMaxHeight
Definition:
HeightChecker.hpp:30
ISM
this namespace contains all generally usable classes.
Definition:
AcceptanceFunction.hpp:22
ISM::LOG_INFO
Definition:
LogHelper.hpp:35
ISM::HeightChecker::getDescription
virtual std::string getDescription()
Definition:
HeightChecker.cpp:37
asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:40