Skip to content

Commit

Permalink
eliminate redundand info
Browse files Browse the repository at this point in the history
  • Loading branch information
ale94mleon committed Jul 21, 2022
1 parent b15d6e5 commit a1d1277
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions moldrug/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def LargerTheBest(Value:float, LowerLimit:float, Target:float, r:float = 1) ->
"""
if Value < LowerLimit:
return 0.0
elif (LowerLimit <= Value) and (Value <= Target):
elif Value <= Target:
return ((Value -LowerLimit)/(Target-LowerLimit))**r
else:
return 1.0
Expand All @@ -285,7 +285,7 @@ def SmallerTheBest(Value:float, Target:float, UpperLimit:float, r:float = 1) ->
"""
if Value < Target:
return 1.0
elif (Target <= Value) and (Value <= UpperLimit):
elif Value <= UpperLimit:
return ((UpperLimit-Value)/(UpperLimit-Target))**r
else:
return 0.0
Expand Down Expand Up @@ -315,9 +315,9 @@ def NominalTheBest(Value:float, LowerLimit:float, Target:float, UpperLimit:float
"""
if Value < LowerLimit:
return 0.0
elif (LowerLimit <= Value) and (Value <= Target):
elif Value <= Target:
return ((Value -LowerLimit)/(Target-LowerLimit))**r1
elif (Target <= Value) and (Value <= UpperLimit):
elif Value <= UpperLimit:
return ((UpperLimit-Value)/(UpperLimit-Target))**r2
else:
return 0.0
Expand Down

0 comments on commit a1d1277

Please sign in to comment.