ConstraintBase

class desdeo_problem.problem.ConstraintBase[source]

Bases: ABC

Base class for constraints.

Methods Summary

evaluate(decision_vector, objective_vector)

Evaluate the constraint functions.

Methods Documentation

abstract evaluate(decision_vector, objective_vector)[source]

Evaluate the constraint functions.

This function will evaluate constraints and return a float indicating how severely the constraint has been broken.

Parameters:
  • decision_vector (np.ndarray) – A decision_vector containing the decision variable values.

  • objective_vector (np.ndarray) – A decision_vector containing the objective function values.

Returns:

A float representing how and if the constraint has been violated. A positive value represents no violation and a negative value represents a violation. The absolute value of the returned float functions as an indicator of the severity of the violation (or how well the constraint holds, if the returned value of positive).

Return type:

float