12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef CONSISTENCYCHECK_H
- #define CONSISTENCYCHECK_H
- #include <QString>
- #include <QVector>
- /**
- * @brief 专家输入数据校验, AHP,废弃
- */
- class ConsistencyCheck
- {
- public:
- /**
- * @brief 构造函数
- * @param 输入节点信息
- * @param 输入节点列表,必须满足n^2
- * @example:
- * QStringList ll = { "展开时间", "撤收时间", "携行重量", "操作人数", "防护能力", "保密能力" };
- * QVector<qreal> 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<qreal> &nxnValus);
- const QVector<qreal> &getSqartnValues() const { return m_sqartnValues; }
- const QVector<qreal> &getWeights() const { return m_weights; }
- const QVector<qreal> &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<qreal> &nxnValus);
- QStringList m_nodes;
- QVector<qreal> m_sqartnValues;
- QVector<qreal> m_weights;
- QVector<qreal> m_averageWeights;
- qreal m_CI;
- qreal m_CR;
- };
- #endif // CONSISTENCYCHECK_H
|