embcol.problem.Constraint

class embcol.problem.Constraint(function, jacobian, hessian, n_outputs, lower_bound=-inf, upper_bound=inf)[source]

Bases: object

Constraint for parameters.

Parameters:
  • function (callable) – Constraint function. The signature must be (params) -> values, where params is a one-dimensional array of parameters and values is a one-dimensional array of constrained values.

  • jacobian (callable) – Jacobian of a constraint function. The signature must be (params) -> values, where params is a one-dimensional array of parameters and values is a Jacobian matrix. values[i, k] is a derivative of the ith output with respect to the kth parameter.

  • hessian (callable) – Hessian of a constraint function. The signature must be (params) -> values, where params is a one-dimensional array of parameters and values is a Hessian matrix. values[i, k1, k2] is a second derivative of the ith output with respect to the k1th and k2th parameters.

  • n_outputs (int) – Number of outputs of a constraint function.

  • lower_bound (float, optional) – Lower bound of a constraint function.

  • upper_bound (float, optional) – Upper bound of a constraint function.

Attributes

function

Constraint function.

hessian

Hessian of a constraint function.

jacobian

Jacobian of a constraint function.

lower_bound

Lower bound of a constraint function.

n_outputs

Number of outputs of a constraint function.

upper_bound

Upper bound of a constraint function.

Methods

transform(feasible)

Transform a constraint for adjusting a feasible region.

violation(params)

Measure degrees of the constraint violation.