Single-objective problems

Unconstrained

class jmetal.problem.singleobjective.unconstrained.OneMax(number_of_bits: int = 256)[source]

Bases: jmetal.core.problem.BinaryProblem

create_solution() → jmetal.core.solution.BinarySolution[source]

Creates a random_search solution to the problem.

Returns

Solution.

evaluate(solution: jmetal.core.solution.BinarySolution) → jmetal.core.solution.BinarySolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name() → str[source]
class jmetal.problem.singleobjective.unconstrained.Rastrigin(number_of_variables: int = 10)[source]

Bases: jmetal.core.problem.FloatProblem

evaluate(solution: jmetal.core.solution.FloatSolution) → jmetal.core.solution.FloatSolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name() → str[source]
class jmetal.problem.singleobjective.unconstrained.Sphere(number_of_variables: int = 10)[source]

Bases: jmetal.core.problem.FloatProblem

evaluate(solution: jmetal.core.solution.FloatSolution) → jmetal.core.solution.FloatSolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name() → str[source]
class jmetal.problem.singleobjective.unconstrained.SubsetSum(C: int, W: list)[source]

Bases: jmetal.core.problem.BinaryProblem

create_solution() → jmetal.core.solution.BinarySolution[source]

Creates a random_search solution to the problem.

Returns

Solution.

evaluate(solution: jmetal.core.solution.BinarySolution) → jmetal.core.solution.BinarySolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name() → str[source]

Knapsack

class jmetal.problem.singleobjective.knapsack.Knapsack(number_of_items: int = 50, capacity: float = 1000, weights: list = None, profits: list = None, from_file: bool = False, filename: str = None)[source]

Bases: jmetal.core.problem.BinaryProblem

Class representing Knapsack Problem.

create_solution() → jmetal.core.solution.BinarySolution[source]

Creates a random_search solution to the problem.

Returns

Solution.

evaluate(solution: jmetal.core.solution.BinarySolution) → jmetal.core.solution.BinarySolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name()[source]

TSP

class jmetal.problem.singleobjective.tsp.TSP(instance: str = None)[source]

Bases: jmetal.core.problem.PermutationProblem

Class representing TSP Problem.

create_solution() → jmetal.core.solution.PermutationSolution[source]

Creates a random_search solution to the problem.

Returns

Solution.

evaluate(solution: jmetal.core.solution.PermutationSolution) → jmetal.core.solution.PermutationSolution[source]

Evaluate a solution. For any new problem inheriting from Problem, this method should be replaced. Note that this framework ASSUMES minimization, thus solutions must be evaluated in consequence.

Returns

Evaluated solution.

get_name()[source]
property number_of_cities