diff --git a/src/mcdm.jl b/src/mcdm.jl index 0bc9d65..d00a42d 100644 --- a/src/mcdm.jl +++ b/src/mcdm.jl @@ -73,9 +73,9 @@ function mcdm( elseif method isa ArasMethod aras(df, w, fns) elseif method isa CocosoMethod - cocoso(df, w, fns, lambda = method.lambda) + cocoso(df, w, fns, lambda=method.lambda) elseif method isa CodasMethod - codas(df, w, fns, tau = method.tau) + codas(df, w, fns, tau=method.tau) elseif method isa CoprasMethod copras(df, w, fns) elseif method isa ROVMethod @@ -83,7 +83,7 @@ function mcdm( elseif method isa EdasMethod edas(df, w, fns) elseif method isa GreyMethod - grey(df, w, fns, zeta = method.zeta) + grey(df, w, fns, zeta=method.zeta) elseif method isa MabacMethod mabac(df, w, fns) elseif method isa MaircaMethod @@ -95,9 +95,9 @@ function mcdm( elseif method isa SawMethod saw(df, w, fns) elseif method isa VikorMethod - vikor(df, w, fns, v = method.v) + vikor(df, w, fns, v=method.v) elseif method isa WaspasMethod - waspas(df, w, fns, lambda = method.lambda) + waspas(df, w, fns, lambda=method.lambda) elseif method isa WPMMethod wpm(df, w, fns) elseif method isa MarcosMethod @@ -145,10 +145,7 @@ julia> # mcdm(setting, GreyMethod(0.6)) ``` """ -function mcdm( - setting::MCDMSetting, - method::T1 = TopsisMethod(), -)::MCDMResult where {T1<:MCDMMethod} +function mcdm(setting::MCDMSetting, method::T1=TopsisMethod())::MCDMResult where {T1<:MCDMMethod} mcdm(setting.df, setting.weights, setting.fns, method) end diff --git a/test/testgreymcdm.jl b/test/testgreymcdm.jl index ddfbed3..8023184 100644 --- a/test/testgreymcdm.jl +++ b/test/testgreymcdm.jl @@ -74,7 +74,7 @@ using Test ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end @@ -118,7 +118,7 @@ using Test GreyNumber(2.519094173200623), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -152,7 +152,7 @@ using Test GreyNumber(0.188656204), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end @@ -251,7 +251,7 @@ using Test GreyNumber(1.00000), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -289,7 +289,7 @@ using Test GreyNumber(0.385194), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end @@ -323,7 +323,7 @@ using Test GreyNumber(0.34452), GreyNumber(0.20035), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -353,7 +353,7 @@ using Test GreyNumber(0.1454237), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end @@ -385,7 +385,7 @@ using Test GreyNumber(0.6625969061), GreyNumber(0.6611032076), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -415,7 +415,7 @@ using Test GreyNumber(0.01926526), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -490,7 +490,7 @@ using Test @test result.rankings == [1, 2, 3, 4] @test result.bestIndex == 4 - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -522,7 +522,7 @@ using Test GreyNumber(1.0884916686098811), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end @@ -557,7 +557,7 @@ using Test @test result.ranks == [4, 2, 3, 1] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -591,7 +591,7 @@ using Test GreyNumber(0.784976), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -623,7 +623,7 @@ using Test @test result.bestIndex == 3 @test result.ranking == [3, 2, 5, 1, 4] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -657,7 +657,7 @@ using Test GreyNumber(0.788239), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end @@ -688,7 +688,7 @@ using Test GreyNumber(0.7873956894791), GreyNumber(0.7674278741782), ] - for i = 1:length(knownscores) + for i = eachindex(knownscores) @test isapprox(result.scores[i], knownscores[i], atol = tol) end end