Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnebro committed Sep 2, 2024
1 parent f05d660 commit 10cfb5d
Show file tree
Hide file tree
Showing 37 changed files with 40 additions and 42 deletions.
3 changes: 2 additions & 1 deletion examples/experiment/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
from jmetal.algorithm.multiobjective.smpso import SMPSO
from jmetal.core.quality_indicator import *
from jmetal.lab.experiment import Experiment, Job, generate_summary_from_experiment
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1, ZDT2, ZDT3
from jmetal.util.archive import CrowdingDistanceArchive
from jmetal.util.termination_criterion import StoppingByEvaluations


def configure_experiment(problems: dict, n_run: int):
jobs = []
max_evaluations = 25000
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/hype/hype_zdt1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.hype import HYPE
from jmetal.core.solution import FloatSolution
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.solution import (
print_function_values_to_file,
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/ibea/ibea_zdt1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.ibea import IBEA
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.solution import (
print_function_values_to_file,
Expand Down
3 changes: 1 addition & 2 deletions examples/multiobjective/mocell/mocell_zdt1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.mocell import MOCell
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.archive import CrowdingDistanceArchive
from jmetal.util.neighborhood import C9
Expand All @@ -9,7 +9,6 @@
print_variables_to_file,
read_solutions,
)

from jmetal.util.termination_criterion import StoppingByEvaluations

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from distributed import LocalCluster

from jmetal.algorithm.multiobjective.nsgaii import DistributedNSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.multiobjective.zdt import ZDT1Modified
from jmetal.util.termination_criterion import StoppingByEvaluations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.multiobjective.zdt import ZDT1Modified
from jmetal.util.evaluator import DaskEvaluator
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.multiobjective.zdt import ZDT1Modified
from jmetal.util.evaluator import SparkEvaluator
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import DynamicNSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.multiobjective.fda import FDA2
from jmetal.util.observable import TimeCounter
from jmetal.util.observer import PlotFrontToFileObserver, WriteFrontToFileObserver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.lab.visualization import Plot, InteractivePlot
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT2
from jmetal.util.comparator import GDominanceComparator
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.core.problem import OnTheFlyFloatProblem
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.util.solution import (
get_non_dominated_solutions,
print_function_values_to_file,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.core.problem import OnTheFlyFloatProblem
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.util.comparator import DominanceWithConstraintsComparator
from jmetal.util.solution import (
get_non_dominated_solutions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.core.problem import OnTheFlyFloatProblem
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.util.comparator import DominanceWithConstraintsComparator
from jmetal.util.solution import (
get_non_dominated_solutions,
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
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.problem import ZDT5
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
from jmetal.util.termination_criterion import StoppingByEvaluations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.problem.multiobjective.unconstrained import OneZeroMax
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
from jmetal.util.termination_criterion import StoppingByEvaluations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import Srinivas
from jmetal.util.comparator import DominanceWithConstraintsComparator
from jmetal.util.solution import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import IntegerPolynomialMutation, PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.crossover import CompositeCrossover, IntegerSBXCrossover
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import CompositeMutation
from jmetal.operator.mutation import IntegerPolynomialMutation, PolynomialMutation
from jmetal.problem.multiobjective.unconstrained import MixedIntegerFloatProblem
from jmetal.util.solution import (
get_non_dominated_solutions,
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/nsgaii/nsgaii_ssp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.problem.multiobjective.unconstrained import SubsetSum
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
from jmetal.util.termination_criterion import StoppingByEvaluations
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
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT4
from jmetal.util.solution import (
get_non_dominated_solutions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.lab.visualization import InteractivePlot, Plot
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
from jmetal.util.solution import (
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
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.solution import (
get_non_dominated_solutions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.lab.visualization import InteractivePlot, Plot
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
from jmetal.util.solution import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.multiobjective.zdt import ZDT1Modified
from jmetal.util.evaluator import MultiprocessEvaluator
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
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 @@ -2,8 +2,8 @@
NSGAIII,
UniformReferenceDirectionFactory,
)
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import DTLZ2
from jmetal.util.solution import (
get_non_dominated_solutions,
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
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.omopso import OMOPSO
from jmetal.operator.mutation import UniformMutation
from jmetal.operator.mutation import NonUniformMutation
from jmetal.operator.mutation import UniformMutation
from jmetal.problem.multiobjective.zdt import ZDT1Modified
from jmetal.util.archive import CrowdingDistanceArchive
from jmetal.util.evaluator import SparkEvaluator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.lab.visualization import InteractivePlot, Plot
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT2
from jmetal.util.comparator import GDominanceComparator
from jmetal.util.observer import ProgressBarObserver, VisualizerObserver
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/gspea2_zdt1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.spea2 import SPEA2
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.comparator import GDominanceComparator
from jmetal.util.solution import (
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/spea2_dtlz1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.spea2 import SPEA2
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import DTLZ2
from jmetal.util.solution import (
print_function_values_to_file,
Expand Down
2 changes: 1 addition & 1 deletion examples/multiobjective/spea2/spea2_zdt1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.spea2 import SPEA2
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT1
from jmetal.util.solution import (
print_function_values_to_file,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.problem import OneMax
from jmetal.util.observer import PrintObjectivesObserver
from jmetal.util.termination_criterion import StoppingByEvaluations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.singleobjective.unconstrained import Rastrigin
from jmetal.util.termination_criterion import StoppingByEvaluations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.core.solution import PermutationSolution
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.operator.crossover import PMXCrossover
from jmetal.operator.mutation import PermutationSwapMutation
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.problem.singleobjective.tsp import TSP
from jmetal.util.comparator import MultiComparator, OverallConstraintViolationComparator, ObjectiveComparator
from jmetal.util.observer import PrintObjectivesObserver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.problem.singleobjective.unconstrained import SubsetSum
from jmetal.util.termination_criterion import StoppingByEvaluations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.selection import BinaryTournamentSelection
from jmetal.problem.singleobjective.knapsack import Knapsack
from jmetal.util.termination_criterion import StoppingByEvaluations

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import BitFlipMutation
from jmetal.operator.crossover import SPXCrossover
from jmetal.operator.mutation import BitFlipMutation
from jmetal.problem import OneMax
from jmetal.util.comparator import DominanceComparator
from jmetal.util.observer import ProgressBarObserver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jmetal.algorithm.multiobjective.nsgaii import NSGAII
from jmetal.operator.mutation import PolynomialMutation
from jmetal.operator.crossover import SBXCrossover
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem.singleobjective.unconstrained import Rastrigin
from jmetal.util.comparator import DominanceComparator
from jmetal.util.solution import print_function_values_to_file, print_variables_to_file
Expand Down
2 changes: 0 additions & 2 deletions src/jmetal/algorithm/multiobjective/gde3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from jmetal.core.problem import DynamicProblem, Problem
from jmetal.core.solution import FloatSolution
from jmetal.operator.crossover import DifferentialEvolutionCrossover
from jmetal.operator.selection import DifferentialEvolutionSelection

from jmetal.operator.selection import DifferentialEvolutionSelection
from jmetal.util.comparator import Comparator, DominanceComparator
from jmetal.util.evaluator import Evaluator
Expand Down
2 changes: 1 addition & 1 deletion src/jmetal/algorithm/multiobjective/omopso.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from jmetal.core.algorithm import ParticleSwarmOptimization
from jmetal.core.problem import FloatProblem
from jmetal.core.solution import FloatSolution
from jmetal.operator.mutation import UniformMutation
from jmetal.operator.mutation import NonUniformMutation
from jmetal.operator.mutation import UniformMutation
from jmetal.util.archive import BoundedArchive, NonDominatedSolutionsArchive
from jmetal.util.comparator import DominanceComparator, EpsilonDominanceComparator
from jmetal.util.evaluator import Evaluator
Expand Down

0 comments on commit 10cfb5d

Please sign in to comment.