Skip to content

Commit

Permalink
add reference to grey number comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed May 2, 2024
1 parent 391753f commit 38b95fa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/greynumber.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ function Base.exp(g::GreyNumber)::GreyNumber
return GreyNumber(exp(g.a), exp(g.b))
end


"""
Bhunia, Asoke Kumar, and Subhra Sankha Samanta. "A study of interval metric
and its application in multi-objective optimization with interval objectives."
Computers & Industrial Engineering 74 (2014): 169-178.
"""
function Base.isless(g1::GreyNumber, g2::GreyNumber)::Bool
if g1.a < g2.a
return true
Expand All @@ -106,15 +112,19 @@ function Base.isless(g1::GreyNumber, g2::GreyNumber)::Bool
end
end



function Base.isless(g::GreyNumber, scalar::T)::Bool where {T <: Real}
return g < GreyNumber(scalar, scalar)
end



function Base.:(g1::GreyNumber, g2::GreyNumber)::Bool
if g1.a <= g2.a
return true
else
return false
return g1.b <= g2.b
end
end

Expand All @@ -132,7 +142,7 @@ function Base.:≥(g1::GreyNumber, g2::GreyNumber)::Bool
if g1.a >= g2.a
return true
else
return false
return g1.b >= g2.b
end
end

Expand Down

0 comments on commit 38b95fa

Please sign in to comment.