designspace.ConstraintReport#

class designspace.ConstraintReport(constraint: Constraint, applicable: float, satisfied: float)#

Bases: object

One SamplingReport.constraints row.

constraint is the declared Constraint. For a per-element template (ListDomain.element_constraints), the template itself, never an instantiated per-instance copy.

applicable and satisfied are fractions of all n draws. A per-element constraint folds its per-draw instance evaluations into one applicable and satisfied decision per draw before dividing by n, so every row shares one denominator and stays comparable to acceptance_rate. satisfied is conditioned on applicable (fraction of applicable draws satisfied), and is 0.0 by convention, never NaN, when applicable == 0.0.

constraint#

The declared constraint this row reports on.

Type:

Constraint

applicable#

Fraction of draws in which the constraint could be decided at all. A low value is the “rarely relevant” pathology: the constraint is governing almost nothing.

Type:

float

satisfied#

Fraction of applicable draws in which the stored predicate held. Raw, so its healthy direction depends on the verb; read violation_rate instead.

Type:

float

property violation_rate: float#

The polarity-resolved fraction of applicable draws in the bad state, the aggregate analog of ConstraintEval.violated. satisfied alone is raw: a forbid/discourage names a bad state (satisfied is the violation fraction), a require/encourage/bound a good one (violation is the complement, 1 - satisfied). Reading a mixed table of rows by satisfied alone means re-deriving this flip by hand per verb, exactly the confusion ConstraintEval.violated already exists to avoid for a single evaluation.

0.0 when applicable == 0.0, for both polarities, mirroring ConstraintEval.violated’s “inapplicable is never violated” (Kleene rule 4) and satisfied’s own “0.0 by convention, never NaN” default, rather than computed mechanically as 1 - satisfied, which would report a never-evaluated require/encourage row as “always violated” instead of “carries no information.”