Debian Codegraph @

Source/Reasoner/Answerer/CCacheAnswersWeightedUsageCostItem.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_REASONER_ANSWERER_CCACHEANSWERSWEIGHTEDUSAGECOSTITEM_H
22 #define KONCLUDE_REASONER_ANSWERER_CCACHEANSWERSWEIGHTEDUSAGECOSTITEM_H
23
24 // Libraries includes
25 #include <QTime>
26
27 // Namespace includes
28 #include "AnswererSettings.h"
29
30 // Other includes
31
32 // Logger includes
33 #include "Logger/CLogger.h"
34
35 #include "Utilities/UtilitiesSettings.h"
36
37
38 namespace Konclude {
39
40 using namespace Utilities;
41
42 namespace Reasoner {
43
44 namespace Answerer {
45
46
47 /*!
48 *
49 * \class CCacheAnswersWeightedUsageCostItem
50 * \author Andreas Steigmiller
51 * \version 0.1
52 * \brief TODO
53 *
54 */
55 class CCacheAnswersWeightedUsageCostItem {
56 // public methods
57 public:
58 //! Constructor
59 CCacheAnswersWeightedUsageCostItem();
60 ~CCacheAnswersWeightedUsageCostItem();
61
62 virtual bool clearComputation();
63
64 virtual bool startComputationCostMearsuring();
65 virtual bool stopComputationCostMearsuring();
66
67
68 cint64 getQueryUsageCount();
69 CCacheAnswersWeightedUsageCostItem* incQueryUsageCount(cint64 count = 1);
70 CCacheAnswersWeightedUsageCostItem* decQueryUsageCount(cint64 count = 1);
71 CCacheAnswersWeightedUsageCostItem* setQueryUsageCount(cint64 count);
72
73
74 double getCacheWeightedUsageFactor();
75 CCacheAnswersWeightedUsageCostItem* setCacheWeightedUsageFactor(double factor);
76 CCacheAnswersWeightedUsageCostItem* incCacheWeightedUsageFactor(double factor);
77
78 double getLastCacheInstalledCostWeightedUsage();
79 CCacheAnswersWeightedUsageCostItem* setLastCacheInstalledCostWeightedUsage(double usageWeightedCost);
80
81 bool isCacheUpdateQueued();
82 CCacheAnswersWeightedUsageCostItem* setCacheUpdateQueued(bool queued);
83
84 double getComputationCost();
85
86 bool isComputationCostMeasuring();
87
88 // protected methods
89 protected:
90
91 // protected variables
92 protected:
93 double mLastCacheInstalledCostWeightedUsage;
94
95 QTime* mTimeCostMeasurementTimer;
96
97 bool mCacheUpdateQueued;
98
99 cint64 mQueryUsageCount;
100 cint64 mTotalQueryUsageCount;
101 double mCacheWeightedUsageFactor;
102
103 double mComputationCost;
104 double mPrevComputationCost;
105
106
107 // private methods
108 private:
109
110 // private variables
111 private:
112
113 };
114
115 }; // end namespace Answerer
116
117 }; // end namespace Reasoner
118
119 }; // end namespace Konclude
120
121 #endif // KONCLUDE_REASONER_ANSWERER_CCACHEANSWERSWEIGHTEDUSAGECOSTITEM_H