soogo.problem module

Problem definitions for interfacing with pymoo.

class soogo.problem.ListDuplicateElimination(**kwargs) None

Bases: DefaultDuplicateElimination

Specialization of DefaultDuplicateElimination for better performance in the problems we have.

The particularity in this software is that the labels for the variables always go from 0 to n-1, so we can rely on that information to using ElementwiseDuplicateElimination.

calc_dist(pop, other=None)

Compute the distances between the members of two populations.

If other is None, compute the distance between pop with itself.

This implementation uses the built-in Python sorted() function for sorting the keys of the dictionary. This is faster than using the runtime func().

Parameters:
  • pop – First population of size m.

  • other – Second population of size n. (default: None)

Returns:

m-by-n matrix with the distances.

class soogo.problem.PymooProblem(objfunc, bounds, iindex=(), n_obj: int = 1, gfunc=None, n_ieq_constr: int = 0)

Bases: Problem

Mixed-integer problem with constraints for pymoo.

Parameters:
  • objfunc – Objective function. Stored in objfunc.

  • bounds – List with the limits [x_min,x_max] of each direction x in the search space.

  • iindex – Indices of the input space that are integer. Default is (). (default: ())

  • n_obj (int) – Number of objective functions. Default is 1. (default: 1)

  • gfunc – Constraint function. Stored in gfunc. If None, no constraints are defined. (default: None)

  • n_ieq_constr (int) – Number of inequality constraints. Default is 0. (default: 0)

objfunc

Objective function.

gfunc

Constraint function.

is_mixed_integer

Indicates whether the problem is a mixed-integer problem.