SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
NewCoveringStatistics.h
Go to the documentation of this file.
1 /**
2  * @file NewCoveringStatistics.h
3  * @author Philip Kroll <Philip.Kroll@rwth-aachen.de>
4  *
5  * @version 21.01.2022
6  * Created on 21.01.2022
7  */
8 
9 #pragma once
10 
11 #include <chrono>
13 #ifdef SMTRAT_DEVOPTION_Statistics
15 
16 namespace smtrat {
17 class NewCoveringStatistics : public Statistics {
18 private:
19  std::size_t mTotalCalls = 0;
20  bool isIncremental = false;
21  bool isBacktracking = false;
22  std::size_t mIncrementalOnlyCalls = 0;
23  std::size_t mBacktrackingOnlyCalls = 0;
24  std::size_t mIncrementalAndBacktrackingCalls = 0;
25  std::size_t mDimension = 0;
26  std::string mVariableOrderingType = "";
27  std::string mCoveringHeuristicType = "";
28  std::string mOperatorType = "";
29  std::string mSamplingAlgorithm = "";
30  std::string mIsSampleOutsideAlgorithm = "";
31  carl::statistics::Timer mTimerComputeCovering;
32  carl::statistics::Timer mTimerConstructDerivation;
33 
34 public:
35  void collect() {
36  Statistics::addKeyValuePair("total_calls", mTotalCalls);
37  Statistics::addKeyValuePair("incremental_only_calls", mIncrementalOnlyCalls);
38  Statistics::addKeyValuePair("backtracking_only_calls", mBacktrackingOnlyCalls);
39  Statistics::addKeyValuePair("incremental_and_backtracking_calls", mIncrementalAndBacktrackingCalls);
40  Statistics::addKeyValuePair("dimension", mDimension);
41  Statistics::addKeyValuePair("time_compute_covering", mTimerComputeCovering);
42  Statistics::addKeyValuePair("time_construct_derivation", mTimerConstructDerivation);
43  Statistics::addKeyValuePair("variable_ordering_type", mVariableOrderingType);
44  Statistics::addKeyValuePair("covering_heuristic_type", mCoveringHeuristicType);
45  Statistics::addKeyValuePair("operator_type", mOperatorType);
46  Statistics::addKeyValuePair("sampling_algorithm", mSamplingAlgorithm);
47  Statistics::addKeyValuePair("is_sample_outside_algorithm", mIsSampleOutsideAlgorithm);
48  Statistics::addKeyValuePair("is_incremental", isIncremental);
49  Statistics::addKeyValuePair("is_backtracking", isBacktracking);
50  }
51  void called() {
52  mTotalCalls++;
53  }
54 
55  void calledIncrementalOnly() {
56  mIncrementalOnlyCalls++;
57  }
58  void calledBacktrackingOnly() {
59  mBacktrackingOnlyCalls++;
60  }
61  void calledIncrementalAndBacktracking() {
62  mIncrementalAndBacktrackingCalls++;
63  }
64 
65  void setDimension(std::size_t dimension) {
66  mDimension = dimension;
67  }
68 
69  auto& timeForComputeCovering() {
70  return mTimerComputeCovering;
71  }
72 
73  auto& timeForConstructDerivation() {
74  return mTimerConstructDerivation;
75  }
76 
77  void setVariableOrderingType(const std::string& variableOrderingType) {
78  mVariableOrderingType = variableOrderingType;
79  }
80 
81  void setCoveringHeuristicType(const std::string& coveringHeuristicType) {
82  mCoveringHeuristicType = coveringHeuristicType;
83  }
84 
85  void setOperatorType(const std::string& operatorType) {
86  mOperatorType = operatorType;
87  }
88 
89  void setSamplingAlgorithm(const std::string& samplingAlgorithm) {
90  mSamplingAlgorithm = samplingAlgorithm;
91  }
92 
93  void setIsSampleOutsideAlgorithm(const std::string& isSampleOutsideAlgorithm) {
94  mIsSampleOutsideAlgorithm = isSampleOutsideAlgorithm;
95  }
96 
97  void setIncremental(bool incremental) {
98  isIncremental = incremental;
99  }
100 
101  void setBacktracking(bool backtracking) {
102  isBacktracking = backtracking;
103  }
104 };
105 
106 static auto& getStatistics() {
107  SMTRAT_STATISTICS_INIT_STATIC(NewCoveringStatistics, stats, "NewCoveringModule");
108  return stats;
109 }
110 
111 } // namespace smtrat
112 
113 #endif
Class to create the formulas for axioms.
carl::statistics::Statistics Statistics
Definition: Statistics.h:7
#define SMTRAT_STATISTICS_INIT_STATIC(class, variable, name)
Definition: Statistics.h:22