platypus.weights module

platypus.weights.chebyshev(solution, ideal_point, weights, min_weight=0.0001)

Chebyshev (Tchebycheff) fitness of a solution with multiple objectives.

This function is designed to only work with minimized objectives.

Parameters

solutionSolution

The solution.

ideal_pointlist of float

The ideal point.

weightslist of float

The weights.

min_weightfloat

The minimum weight allowed.

platypus.weights.normal_boundary_weights(nobjs, divisions_outer, divisions_inner=0)

Returns weights generated by the normal boundary method.

The weights produced by this method are uniformly distributed on the hyperplane intersecting:

[(1, 0, ..., 0), (0, 1, ..., 0), ..., (0, 0, ..., 1)].

Parameters

nobjsint

The number of objectives.

divisions_outerint

The number of divisions along the outer set of weights.

divisions_innerint (optional)

The number of divisions along the inner set of weights.

platypus.weights.pbi(solution, ideal_point, weights, theta)

Penalty-based boundary intersection fitness of a solution with multiple objectives.

Requires numpy. This function is designed to only work with minimized objectives.

Callers need to set the theta value by using:

functools.partial(pbi, theta=0.5)

Parameters

solutionSolution

The solution.

ideal_point: list of float

The ideal point.

weightslist of float

The weights.

thetafloat

The theta value.

platypus.weights.random_weights(nobjs, population_size)

Returns a set of randomly-generated but uniformly distributed weights.

Simply producing N randomly-generated weights does not necessarily produce uniformly-distributed weights. To help produce more uniformly-distributed weights, this method picks weights from a large collection of randomly- generated weights such that the distances between weights is maximized.

Parameters

nobjsint

The number of objectives.

population_sizeint

The number of weights to generate.