Skip to content

Commit

Permalink
Rename method of class Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Jan 22, 2024
1 parent 15cdc47 commit 6f123c5
Show file tree
Hide file tree
Showing 79 changed files with 91 additions and 91 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ algorithm.run()
We can then proceed to explore the results:

```python
from jmetal.util.solution import get_non_dominated_solutions, print_function_values_to_file, \
from jmetal.util.solution import get_non_dominated_solutions, print_function_values_to_file,
print_variables_to_file

front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# save to files
print_function_values_to_file(front, 'FUN.NSGAII.ZDT1')
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/gde3/gde3_spark_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.get_name() + "." + problem.name())
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/gde3/gde3_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
algorithm = GDE3(problem=problem, population_size=100, cr=0.5, f=0.5, termination_criterion=StoppingByKeyboard())

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/gde3/ggde3_zdt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/hype/hype_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/ibea/ibea_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/mocell/mocell_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/moead/moead_dtlz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

hypervolume = HyperVolume([1.0, 1.0, 1.0])
print("Hypervolume: " + str(hypervolume.compute([front[i].objectives for i in range(len(front))])))
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/moead/moead_iepsilon_lircmop1.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/moead/moead_lz09.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/moead/moeaddra_lz09.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

hypervolume = HyperVolume([2.0, 2.0])
print("Hypervolume: " + str(hypervolume.compute([front[i].objectives for i in range(len(front))])))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

print(f"Algorithm: {algorithm.get_name()}")
print(f"Problem: {problem.get_name()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
observer=VisualizerObserver(reference_front=problem.reference_front, reference_point=reference_point))

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(title='Pareto front approximation. Problem: ' + problem.get_name(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def f2(x: [float]):
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def c2(x: [float]):
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def c2(x: [float]):
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaii/nsgaii_solving_ZDT5.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaii/nsgaii_ssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaii/nsgaii_standard_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

algorithm.run()

front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
algorithm.observable.register(observer=VisualizerObserver(reference_front=problem.reference_front))

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaii/nsgaii_steady_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaiii/nsgaiii_dtlz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)

algorithm.run()
front = get_non_dominated_solutions(algorithm.get_result())
front = get_non_dominated_solutions(algorithm.result())

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/omopso/omopso_spark_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.get_name() + "." + problem.name())
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/omopso/omopso_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/preferences/ggde3_zdt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_schaffer_on_the_fly.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def f2(x: [float]):
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_spark_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.get_name() + "." + problem.get_name())
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_srinivas.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, 'FUN.' + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_srinivas_on_the_fly.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def c2(x: [float]):
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_tanaka.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpso_zdt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/smpso/smpsorp_zdt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Plot front
plot_front = Plot(
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/gspea2_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/spea2_dtlz1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/spea2_zdt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

algorithm.run()
front = algorithm.get_result()
front = algorithm.result()

# Save results to file
print_function_values_to_file(front, "FUN." + algorithm.label)
Expand Down
Loading

0 comments on commit 6f123c5

Please sign in to comment.