#include <growthcurvetransform.h>
Inherits ITransform.
|
void | configure (DynamicObject config, const flint::ILandUnitController &landUnitController, datarepository::DataRepository &dataRepository) override |
|
void | controllerChanged (const flint::ILandUnitController &controller) override |
|
const DynamicVar & | value () const override |
|
|
const std::string | buildSql (const DynamicObject &classifierSet) const |
|
const std::string | buildDebuggingInfo (const DynamicObject &classifierSet) const |
|
|
const flint::ILandUnitController * | _landUnitController |
|
datarepository::DataRepository * | _dataRepository |
|
std::shared_ptr< datarepository::IProviderRelationalInterface > | _provider |
|
const flint::IVariable * | _csetVar |
|
DynamicVar | _value |
|
Poco::ThreadLocal< Poco::LRUCache< std::string, DynamicVar > > | _cache |
|
const std::string | _baseSql |
|
const std::string | _matchSql = "WHEN c.name LIKE '%1%' AND cv.value LIKE '%2%' THEN 4 " |
|
◆ buildDebuggingInfo()
const std::string buildDebuggingInfo |
( |
const DynamicObject & |
classifierSet | ) |
const |
|
private |
Return all the classifier names and values in parameter classifierSet, in the format classifierName : classifierValue, separated by a ","
- Parameters
-
classifierSet | const DynamicObject& |
- Returns
- string
◆ buildSql()
const std::string buildSql |
( |
const DynamicObject & |
classifierSet | ) |
const |
|
private |
Replace the placeholder values in SQL queries GrowthCurveTransform._baseSql, GrowthCurveTransform._matchSql
Create variables classifierNames, a vector of strings and classifierValuesSql, a string
For each classifier in parameter classifierSet, append classifier.first to classifierNames, concatenate classifierValuesSql with the SQL query GrowthCurveTransform._matchSql, placeholder values clasifier.first and classifier.second (gives the classifier value) Assign a variable classifierNamesSql the join vector classifierNames, separated by ","
Return the SQL query GrowthCurveTransform._baseSql with placeholders classifierNamesSql and classifierValuesSql
- Parameters
-
classifierSet | const DynamicObject& |
- Returns
- string
◆ configure()
void configure |
( |
DynamicObject |
config, |
|
|
const flint::ILandUnitController & |
landUnitController, |
|
|
datarepository::DataRepository & |
dataRepository |
|
) |
| |
|
override |
◆ controllerChanged()
void controllerChanged |
( |
const flint::ILandUnitController & |
controller | ) |
|
|
override |
◆ value()
const DynamicVar & value |
( |
| ) |
const |
|
override |
◆ _baseSql
const std::string _baseSql |
|
private |
Initial value:= R"(
SELECT growth_curve_id
FROM (
SELECT
gccv.growth_curve_id AS growth_curve_id,
SUM(CASE
WHEN c.name IN (%1%) THEN
CASE
WHEN cv.value LIKE '?' THEN 1
%2%
ELSE -1000
END
ELSE -1000
END
) AS score
FROM growth_curve_classifier_value gccv
INNER JOIN classifier_value cv
ON gccv.classifier_value_id = cv.id
INNER JOIN classifier c
ON cv.classifier_id = c.id
GROUP BY gccv.growth_curve_id
) AS growth_curve_ranking
WHERE score > 0
ORDER BY score DESC
LIMIT 1
)"
◆ _cache
Poco::ThreadLocal<Poco::LRUCache<std::string, DynamicVar> > _cache |
|
mutableprivate |
◆ _csetVar
const flint::IVariable* _csetVar |
|
mutableprivate |
◆ _dataRepository
datarepository::DataRepository* _dataRepository |
|
private |
◆ _landUnitController
const flint::ILandUnitController* _landUnitController |
|
private |
◆ _matchSql
const std::string _matchSql = "WHEN c.name LIKE '%1%' AND cv.value LIKE '%2%' THEN 4 " |
|
private |
◆ _provider
std::shared_ptr<datarepository::IProviderRelationalInterface> _provider |
|
private |
◆ _value
The documentation for this class was generated from the following files: