SMPSO

Example

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

problem = ZDT4()

max_evaluations = 25000
algorithm = SMPSO(
    problem=problem,
    swarm_size=100,
    mutation=PolynomialMutation(probability=1.0 / problem.number_of_variables, distribution_index=20),
    leaders=CrowdingDistanceArchive(100),
    termination_criterion=StoppingByEvaluations(max=max_evaluations)
)

algorithm.run()
solutions = algorithm.get_result()

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'])
plot_front.plot(front, label='SMPSO-ZDT4')
../../../../_images/api_algorithm_multiobjective_psos_smpso_5_0.png

API

class jmetal.algorithm.multiobjective.smpso.SMPSO(problem: ~jmetal.core.problem.FloatProblem, swarm_size: int, mutation: ~jmetal.core.operator.Mutation, leaders: ~jmetal.util.archive.BoundedArchive | None, dominance_comparator: ~jmetal.util.comparator.Comparator = <jmetal.util.comparator.DominanceComparator object>, termination_criterion: ~jmetal.util.termination_criterion.TerminationCriterion = <jmetal.util.termination_criterion.StoppingByEvaluations object>, swarm_generator: ~jmetal.util.generator.Generator = <jmetal.util.generator.RandomGenerator object>, swarm_evaluator: ~jmetal.util.evaluator.Evaluator = <jmetal.util.evaluator.SequentialEvaluator object>)[source]

Bases: ParticleSwarmOptimization

create_initial_solutions() List[FloatSolution][source]

Creates the initial list of solutions of a metaheuristic.

evaluate(solution_list: List[FloatSolution])[source]

Evaluates a solution list.

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

Initialize the algorithm.

initialize_global_best(swarm: List[FloatSolution]) None[source]
initialize_particle_best(swarm: List[FloatSolution]) None[source]
initialize_velocity(swarm: List[FloatSolution]) None[source]
perturbation(swarm: List[FloatSolution]) None[source]
result() List[FloatSolution][source]
select_global_best() FloatSolution[source]
stopping_condition_is_met() bool[source]

The stopping condition is met or not.

update_global_best(swarm: List[FloatSolution]) None[source]
update_particle_best(swarm: List[FloatSolution]) None[source]
update_position(swarm: List[FloatSolution]) None[source]
update_progress() None[source]

Update the progress after each iteration.

update_velocity(swarm: List[FloatSolution]) None[source]