Tester.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/shared_ptr.hpp>
21 
22 #include "ImplicitShapeModel.hpp"
23 #include "ObjectSetValidator.hpp"
24 #include "Evaluator.hpp"
25 
27 
28 namespace ISM
29 {
30 
31 using boost::filesystem::path;
32 
33 class Tester : public Evaluator
34 {
35  public:
36  Tester(ObjectSetValidatorPtr objectSetValidator,
37  PatternNameToObjectSet& validTestSetsPerPattern,
38  PatternNameToObjectSet& invalidTestSetsPerPattern, bool testForFalseNegatives = false) :
39  mObjectSetValidator(objectSetValidator),
40  mInvalidTestSetsPerPattern(invalidTestSetsPerPattern),
41  mValidTestSetsPerPattern(validTestSetsPerPattern),
42  mTestForFalseNegatives(testForFalseNegatives)
43  {}
44 
45  EvaluationResult evaluate(std::string patternName, const IsmPtr& ism);
46  std::string getDescription();
47 
48  private:
50 
53 
54  bool mTestForFalseNegatives = false;
55  unsigned int mNumTests;
56  unsigned int mNumTestsDone;
57 
58  double mEvaluationRuntime = 0;
59 
60  unsigned evaluateTestSets(const std::vector<ISM::ObjectSetPtr>& testSets, const std::string& patternName,
61  bool expectedValue);
62 
63 }; typedef boost::shared_ptr<Tester> TesterPtr;
64 
65 }
unsigned int mNumTestsDone
Definition: Tester.hpp:56
ISM::ObjectSetValidatorPtr mObjectSetValidator
Definition: Tester.hpp:49
PatternNameToObjectSet mInvalidTestSetsPerPattern
Definition: Tester.hpp:51
boost::shared_ptr< Tester > TesterPtr
Definition: Tester.hpp:63
Tester(ObjectSetValidatorPtr objectSetValidator, PatternNameToObjectSet &validTestSetsPerPattern, PatternNameToObjectSet &invalidTestSetsPerPattern, bool testForFalseNegatives=false)
Definition: Tester.hpp:36
EvaluationResult evaluate(std::string patternName, const IsmPtr &ism)
Definition: Tester.cpp:27
std::string patternName
std::map< std::string, std::vector< ObjectSetPtr > > PatternNameToObjectSet
Definition: typedef.hpp:68
std::string getDescription()
Definition: Tester.cpp:91
boost::shared_ptr< ObjectSetValidator > ObjectSetValidatorPtr
bool mTestForFalseNegatives
Definition: Tester.hpp:54
boost::shared_ptr< ImplicitShapeModel > IsmPtr
unsigned evaluateTestSets(const std::vector< ISM::ObjectSetPtr > &testSets, const std::string &patternName, bool expectedValue)
Definition: Tester.cpp:68
unsigned int mNumTests
Definition: Tester.hpp:55
double mEvaluationRuntime
Definition: Tester.hpp:58
this namespace contains all generally usable classes.
PatternNameToObjectSet mValidTestSetsPerPattern
Definition: Tester.hpp:52


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:41