SMPSO/RP

Example

[1]:
from jmetal.algorithm.multiobjective.smpso import SMPSORP
from jmetal.operator.mutation import PolynomialMutation
from jmetal.problem import ZDT4
from jmetal.util.archive import CrowdingDistanceArchiveWithReferencePoint
from jmetal.util.termination_criterion import StoppingByEvaluations

problem = ZDT4()

swarm_size = 100

reference_point = [[0.1, 0.8],[0.6, 0.1]]
archives_with_reference_points = []

for point in reference_point:
    archives_with_reference_points.append(
        CrowdingDistanceArchiveWithReferencePoint(int(swarm_size / len(reference_point)), point)
    )

max_evaluations = 50000
algorithm = SMPSORP(
    problem=problem,
    swarm_size=swarm_size,
    mutation=PolynomialMutation(probability=1.0 / problem.number_of_variables, distribution_index=20),
    reference_points=reference_point,
    leaders=archives_with_reference_points,
    termination_criterion=StoppingByEvaluations(max=max_evaluations)
)

algorithm.run()
solutions = algorithm.get_result()
Enter 2-points of dimension 2:

We can now visualize the Pareto front approximation:

[3]:
from jmetal.lab.visualization.plotting import Plot
from jmetal.util.solution import get_non_dominated_solutions

front = get_non_dominated_solutions(solutions)

plot_front = Plot(plot_title='Pareto front approximation', axis_labels=['x', 'y'], reference_point=reference_point)
plot_front.plot(front, label='SMPSORP-ZDT4')
../../../../_images/api_algorithm_multiobjective_psos_smpso_preference_5_0.png

API

class jmetal.algorithm.multiobjective.smpso.SMPSORP(problem: ~jmetal.core.problem.FloatProblem, swarm_size: int, mutation: ~jmetal.core.operator.Mutation, reference_points: ~typing.List[~typing.List[float]], leaders: ~typing.List[~jmetal.util.archive.ArchiveWithReferencePoint], termination_criterion: ~jmetal.util.termination_criterion.TerminationCriterion, swarm_generator: ~jmetal.util.generator.Generator = <jmetal.util.generator.RandomGenerator object>, swarm_evaluator: ~jmetal.util.evaluator.Evaluator = <jmetal.util.evaluator.SequentialEvaluator object>)[source]

Bases: SMPSO

get_name() str[source]
get_reference_point()[source]
init_progress() None[source]

Initialize the algorithm.

initialize_global_best(swarm: List[FloatSolution]) None[source]
result() List[FloatSolution][source]
select_global_best() FloatSolution[source]
update_global_best(swarm: List[FloatSolution]) None[source]
update_progress() None[source]

Update the progress after each iteration.

update_reference_point(new_reference_points: list)[source]