DataEvaluator.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef DATAEVALUATOR_H
  2. #define DATAEVALUATOR_H
  3. #include <QObject>
  4. #include "SchemePlanManager.h"
  5. class NodeMatrixInfo;
  6. class DataEvaluator : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. enum GatherType
  11. {
  12. Result, // 结果集结
  13. Matrix // 矩阵集结
  14. };
  15. explicit DataEvaluator(QObject *parent = nullptr);
  16. void setProcess(SchemePlanManager::SchemeProcessInfo process);
  17. SchemePlanManager::SchemeProcessInfo process() const;
  18. void setGatherType(GatherType type);
  19. GatherType gatherType() const;
  20. bool evaluate();
  21. private:
  22. /// 运行算法
  23. bool evaluateWeightFromExpert(); // 权重分析,专家数据
  24. bool evaluateWeightFromMeasure(); // 权重分析,实测数据
  25. bool evaluateTech(); // 技术重要度评估, 指标得分
  26. bool evaluateScheme(); // 方案优选评估
  27. bool evaluateEfficiencyMEA(); // 效能评估, 物元分析法
  28. bool evaluateEfficiencyGCE(); // 效能评估, 灰色聚类法
  29. /// 准备数据
  30. bool getNodeData(QMap<QString, QMap<QString, NodeMatrixInfo *>> &nodeData) const;
  31. /// 获取算法
  32. bool getAlgorithm(SchemePlanManager::Algorithm &algorithm) const;
  33. /// 获取专家配置
  34. bool getUserConfig(QMap<QString, double> &cfg) const;
  35. /// 获取指标权重
  36. bool getWeightData(QMap<QString, double> &weightData) const;
  37. /// 获取方案数据
  38. /// int key: 方案 id
  39. /// QString key: 指标名称
  40. /// double value: 指标权重
  41. bool getSchemeData(QMap<int, QMap<QString, double>> &schemeData, QMap<int, QString> &schemeNames) const;
  42. /// 使用横坐标和纵坐标构造索引
  43. QString nodeDataKey(NodeMatrixInfo *data) const;
  44. private:
  45. SchemePlanManager::SchemeProcessInfo m_process;
  46. GatherType m_gatherType = Result;
  47. };
  48. #endif // DATAEVALUATOR_H