#ifndef CONSISTENCYCHECK_H #define CONSISTENCYCHECK_H #include #include /** * @brief 专家输入数据校验, AHP,废弃 */ class ConsistencyCheck { public: /** * @brief 构造函数 * @param 输入节点信息 * @param 输入节点列表,必须满足n^2 * @example: * QStringList ll = { "展开时间", "撤收时间", "携行重量", "操作人数", "防护能力", "保密能力" }; * QVector nn = { 1, 1.0 / 3.0, 1.0 / 5.0, 1.0 / 3.0, 1.0 / 5.0, 1.0 / 3.0, 3, 1, * 1.0 / 3.0, 3, 1.0/ 5.0, 1.0 / 3.0, 5, 3, 1, 5, 3, 3, 3, 1.0 / 3.0, * 1.0 / 5.0, 1, 1.0 / 7.0, 1.0 / 3.0, 5, 5, 1.0 / 3.0, 7, 1, 3, 3, * 3,1.0 / 3.0, 3, 1.0 / 3.0, 1 }; * ConsistencyCheck cc(ll, nn); * qDebug() << cc.consitst(); */ ConsistencyCheck(const QStringList &nodes, const QVector &nxnValus); const QVector &getSqartnValues() const { return m_sqartnValues; } const QVector &getWeights() const { return m_weights; } const QVector &getAverageWeights() const { return m_averageWeights; } const QStringList &getNodes() const { return m_nodes; } qreal CI() const { return m_CI; } qreal CR() const { return m_CR; } /** * @brief 一致性判断 */ bool consitst() const { return true; // return m_CR < thd; } private: const qreal RI[10] = { 0, 0, 0.58, 0.90, 1.12, 1.24, 1.32, 1.41, 1.45, 1.49 }; const qreal thd = 0.1; void calc(const QVector &nxnValus); QStringList m_nodes; QVector m_sqartnValues; QVector m_weights; QVector m_averageWeights; qreal m_CI; qreal m_CR; }; #endif // CONSISTENCYCHECK_H