ZeroConstraint

class glotaran.model.clp_constraint.ZeroConstraint(*, interval: tuple[float, float] | list[tuple[float, float]] | None = None, target: str, type: str = 'zero')[source]

Bases: ClpConstraint

Constraints the target to 0 in the given interval.

Method generated by attrs for class ZeroConstraint.

Attributes Summary

type

target

interval

Methods Summary

applies

Check if the index is in the intervals.

get_item_type

Get the type string.

get_item_type_class

Get the type for a type string.

get_item_types

Get all type strings.

has_interval

Check if intervals are defined.

Methods Documentation

applies(index: float | None) bool

Check if the index is in the intervals.

Parameters:

index (float) – The index.

Return type:

bool

classmethod get_item_type() str

Get the type string.

Return type:

str

classmethod get_item_type_class(item_type: str) Type

Get the type for a type string.

Parameters:

item_type (str) – The type string.

Return type:

Type

classmethod get_item_types() list[str]

Get all type strings.

Return type:

list[str]

has_interval() bool

Check if intervals are defined.

Return type:

bool

interval: tuple[float, float] | list[tuple[float, float]] | None
target: str
type: str