MindEvaluation.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef MINDEVALUATION_H
  2. #define MINDEVALUATION_H
  3. #include <QObject>
  4. #include "CMind.h"
  5. #include "dbService/ClassSet.h"
  6. struct MindNodeItem
  7. {
  8. QString parent; // 节点名
  9. QString name;
  10. double value;
  11. double score;
  12. bool operator==(const MindNodeItem &rhs) { return parent == rhs.parent && name == rhs.name; }
  13. };
  14. class MindEvaluation : public QObject
  15. {
  16. Q_OBJECT
  17. public:
  18. enum AggregationType
  19. {
  20. NoMerge, // 数据集结
  21. Merge // 矩阵集结
  22. };
  23. /**
  24. * @brief MindEvaluation
  25. * @param mind 脑图管理类
  26. * @param expertId 专家id
  27. * @param tableType 表属于哪种
  28. * @param mindMatrix 是否专家打分
  29. * @param parent
  30. */
  31. MindEvaluation(CMind *mind, int expertId, const QString &tableType, int mindMatrix, QObject *parent = nullptr);
  32. MindEvaluation(CMind *mind, AggregationType atype, const QString &tableType, int mindMatrix,
  33. QObject *parent = nullptr);
  34. ~MindEvaluation();
  35. void updateSeqNodes();
  36. void computeWeights();
  37. QList<MindNodeItem> mindNodeWeights;
  38. private:
  39. void init();
  40. void computeSingleWeights(); // 单专家
  41. void computeNoMergeWeights(); // 数据集结
  42. void computeMergeWeights(); // 矩阵集结
  43. void computeOneEntry(const QList<NodeMatrixInfo *> &nmInfos, QList<MindNodeItem> &mindNodeItem); // 计算单个实例
  44. private:
  45. CMind *m_mind;
  46. int m_expertId;
  47. QString m_tableType;
  48. int m_mindMatrix;
  49. QList<QList<SeqNode>> m_seqNodes;
  50. AggregationType m_aggregationType;
  51. bool m_isAggregationOp; // 是否做集结操作
  52. };
  53. #endif // MINDEVALUATION_H