Skip to content

Commit

Permalink
Made 2 methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
bedoge committed Jan 5, 2024
1 parent 05b0057 commit 30e5e4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
4 changes: 0 additions & 4 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ API

.. autofunction:: src.WMSDTransformer.TOPSISAggregationFunction.improvement_genetic

.. autofunction:: src.WMSDTransformer.TOPSISAggregationFunction.solve_quadratic_equation

.. autofunction:: src.WMSDTransformer.TOPSISAggregationFunction.choose_appropriate_solution

.. autoclass:: src.WMSDTransformer.PostFactumTopsisPymoo

.. autoclass:: src.WMSDTransformer.ATOPSIS
Expand Down
36 changes: 10 additions & 26 deletions src/WMSDTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,16 +1283,8 @@ def improvement_genetic(
return None

@staticmethod
def solve_quadratic_equation(a, b, c):
"""TO DO
Parameters
----------
parameter : type
description
Returns
-------
TO DO
"""
def __solve_quadratic_equation(a, b, c):

discriminant = b**2 - 4 * a * c
if discriminant < 0:
return None
Expand All @@ -1301,18 +1293,10 @@ def solve_quadratic_equation(a, b, c):
return solution_1, solution_2

@staticmethod
def choose_appropriate_solution(
def __choose_appropriate_solution(
solution_1, solution_2, lower_bound, upper_bound, objective
):
"""TO DO
Parameters
----------
parameter : type
description
Returns
-------
TO DO
"""

solution_1_is_feasible = upper_bound > solution_1 > lower_bound
solution_2_is_feasible = upper_bound > solution_2 > lower_bound
if solution_1_is_feasible:
Expand Down Expand Up @@ -1475,7 +1459,7 @@ def improvement_single_feature(
- target_agg_value**2
)

solutions = TOPSISAggregationFunction.solve_quadratic_equation(
solutions = TOPSISAggregationFunction.__solve_quadratic_equation(
a, b, c
) # solutions are new performances in VS, not modifications
if solutions is None:
Expand All @@ -1487,7 +1471,7 @@ def improvement_single_feature(
solution_2 = ((solutions[1] / weights[j]) * criterion_range) + lower_bound

# solution -- new performances in CS
solution = TOPSISAggregationFunction.choose_appropriate_solution(
solution = TOPSISAggregationFunction.__choose_appropriate_solution(
solution_1, solution_2, lower_bound, upper_bound, objective
)
if solution is None:
Expand Down Expand Up @@ -1645,7 +1629,7 @@ def improvement_single_feature(
- target_agg_value**2
)

solutions = TOPSISAggregationFunction.solve_quadratic_equation(
solutions = TOPSISAggregationFunction.__solve_quadratic_equation(
a, b, c
) # solutions are new performances in VS, not modifications
if solutions is None:
Expand All @@ -1657,7 +1641,7 @@ def improvement_single_feature(
solution_2 = ((solutions[1] / weights[j]) * criterion_range) + lower_bound

# solution -- new performances in CS
solution = TOPSISAggregationFunction.choose_appropriate_solution(
solution = TOPSISAggregationFunction.__choose_appropriate_solution(
solution_1, solution_2, lower_bound, upper_bound, objective
)
if solution is None:
Expand Down Expand Up @@ -1822,7 +1806,7 @@ def improvement_single_feature(
)
c = (v_ij[j] - NIS[j]) ** 2 - k * (v_ij[j] - PIS[j]) ** 2 - p

solutions = TOPSISAggregationFunction.solve_quadratic_equation(
solutions = TOPSISAggregationFunction.__solve_quadratic_equation(
a, b, c
) # solutions are performance modifications in CS !!!
if solutions is None:
Expand All @@ -1834,7 +1818,7 @@ def improvement_single_feature(
solution_2 = solutions[1] + performances_CS[j]

# solution -- new performances in CS
solution = TOPSISAggregationFunction.choose_appropriate_solution(
solution = TOPSISAggregationFunction.__choose_appropriate_solution(
solution_1, solution_2, lower_bound, upper_bound, objective
)
if solution is None:
Expand Down

0 comments on commit 30e5e4b

Please sign in to comment.