Skip to content

Julia package for multiple-criteria decision making with Grey Numbers

License

Notifications You must be signed in to change notification settings

bahadirfyildirim/GreyDecision.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GreyDecision.jl

A Julia package for Grey Numbers, their operations, and Grey Decision tools.

Grey Numbers

Basic Arithmetic

julia> g = GreyNumber(5.0, 6.0)
GreyNumber{Float64}(5.0, 6.0)

julia> h = GreyNumber(11.0, 8.0)
GreyNumber{Float64}(8.0, 11.0)

julia> g + h
GreyNumber{Float64}(13.0, 17.0)

julia> g - h
GreyNumber{Float64}(-6.0, -2.0)

julia> g * h
GreyNumber{Float64}(40.0, 66.0)

julia> g / h
GreyNumber{Float64}(0.45454545454545453, 0.75)

Integration of other Julia Base operations

julia> zero(GreyNumber)
GreyNumber{Float64}(0.0, 0.0)

julia> one(GreyNumber)
GreyNumber{Float64}(1.0, 1.0)

julia> zeros(GreyNumber{Float64}, 2, 3)
2×3 Matrix{GreyNumber{Float64}}:
 GreyNumber{Float64}(0.0, 0.0)  GreyNumber{Float64}(0.0, 0.0)  GreyNumber{Float64}(0.0, 0.0)
 GreyNumber{Float64}(0.0, 0.0)  GreyNumber{Float64}(0.0, 0.0)  GreyNumber{Float64}(0.0, 0.0)

julia> ones(GreyNumber{Float64}, 2, 3)
2×3 Matrix{GreyNumber{Float64}}:
 GreyNumber{Float64}(1.0, 1.0)  GreyNumber{Float64}(1.0, 1.0)  GreyNumber{Float64}(1.0, 1.0)
 GreyNumber{Float64}(1.0, 1.0)  GreyNumber{Float64}(1.0, 1.0)  GreyNumber{Float64}(1.0, 1.0)

Mathematical functions on Grey Numbers

julia> g
GreyNumber{Float64}(5.0, 6.0)

julia> g^2.0
GreyNumber{Float64}(25.0, 36.0)

julia> sqrt(g)
GreyNumber{Float64}(2.23606797749979, 2.449489742783178)

julia> g * 10
GreyNumber{Float64}(50.0, 60.0)

julia> sum([g, h])
GreyNumber{Float64}(13.0, 17.0)

Grey Decision Analysis

List and examples for implemented methods

Topsis

julia> decmat = [
               GreyNumber(1.0, 2.0) GreyNumber(2.0, 3.0) GreyNumber(3.0, 4.0);
               GreyNumber(2.0, 3.0) GreyNumber(1.0, 2.0) GreyNumber(3.0, 4.0);
               GreyNumber(3.0, 4.0) GreyNumber(2.0, 3.0) GreyNumber(1.0, 2.0);
           ]; # Decision matrix with Grey Numbers

julia> w = [0.5, 0.4, 0.1]; # Weights

julia> fns = [maximum, maximum, minimum]; # Direction of optimization

julia> scores = topsis(decmat, w, fns)
3-element Vector{GreyNumber{Float64}}:
 GreyNumber{Float64}(0.2350699228751952, 0.83613099715003)
 GreyNumber{Float64}(0.24317523558639148, 1.002942207810138)
 GreyNumber{Float64}(0.10851899761349458, 1.23913068959885)

 julia> scores |> sortperm |> last # Best strategy is 2nd.
 2

Simple Additive Weighting (SAW)

julia> saw(decmat, w, fns)
Dict{Symbol, Any} with 3 entries:
  :scores    => GreyNumber{Float64}[GreyNumber{Float64}(0.416667, 1.0), GreyNumber{Float64}(0.408333, 0.966667), GreyN
  :bestindex => 3
  :rankings  => [3, 1, 2]

Vikor

julia> vikor(decmat, w, fns)
Dict{Symbol, Any} with 2 entries:
  :scores    => GreyNumber{Float64}[GreyNumber{Float64}(NaN, NaN), GreyNumber{Float64}(NaN, NaN), GreyNumber{Float64}(
  :bestindex => 1

Non-dominated sorting

Moora

julia> moora(decmat, w, fns)
Dict{Symbol, Any} with 2 entries:
  :scores    => GreyNumber{Float64}[GreyNumber{Float64}(0.0112818, 0.441675), GreyNumber{Float64}(-0.0750996, -0.00411
  :bestindex => 2

Electre

About

Julia package for multiple-criteria decision making with Grey Numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages