Skip to content

Commit

Permalink
export more inner state variables of critic method
Browse files Browse the repository at this point in the history
jbytecode committed Mar 13, 2024
1 parent 42749d5 commit 727a930
Showing 3 changed files with 1,623 additions and 1,616 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 0.7.15 (Upcoming Release)

- Export more inner state variables of critic method.


### 0.7.14

26 changes: 10 additions & 16 deletions src/critic.jl
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@ CriticMethod() = CriticMethod(Normalizations.maxminrangenormalization)
struct CRITICResult <: MCDMResult
decisionMatrix::Matrix
w::Vector
correlationmatrix::Matrix
scores::Vector
end


@@ -73,26 +75,14 @@ function critic(
normalization::G = Normalizations.maxminrangenormalization
)::CRITICResult where {F<:Function, G<:Function}

row, col = size(decisionMat)
colMax = colmaxs(decisionMat)
colMin = colmins(decisionMat)
_ , col = size(decisionMat)
#colMax = colmaxs(decisionMat)
#colMin = colmins(decisionMat)

A = similar(decisionMat)

zerotype = eltype(decisionMat[:, 1])

#for i = 1:row
# for j = 1:col
# if fns[j] == maximum
# @inbounds A[i, j] =
# (decisionMat[i, j] - colMin[j]) / (colMax[j] - colMin[j])
# elseif fns[j] == minimum
# @inbounds A[i, j] =
# (colMax[j] - decisionMat[i, j]) / (colMax[j] - colMin[j])
# end
# end
#end

normalizedMat = normalization(decisionMat, fns)

corMat = one(zerotype) .- cor(normalizedMat)
@@ -109,7 +99,11 @@ function critic(
w[i] = scores[i] ./ sum(scores)
end

result = CRITICResult(decisionMat, w)
result = CRITICResult(
decisionMat,
w,
corMat,
scores)

return result
end
3,211 changes: 1,611 additions & 1,600 deletions test/testmcdm.jl

Large diffs are not rendered by default.

0 comments on commit 727a930

Please sign in to comment.