ahp-criteria-helper
Version:
A simple package that helps to find the weights of n criteria, and also calculate your consistency ratio.
14 lines • 615 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.calculateWeights = void 0;
var calculateWeights = function (matrix) {
return Array.from(Array(matrix.length)).map(function (_weight, index) {
return matrix.reduce(function (acc, array, rowIndex) {
return acc +
matrix[index][rowIndex] /
array.reduce(function (arrAcc, _value, colIndex) { return arrAcc + matrix[colIndex][rowIndex]; }, 0);
}, 0) / matrix.length;
});
};
exports.calculateWeights = calculateWeights;
//# sourceMappingURL=calculate-weights.js.map