ClpConstraint

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

Bases: TypedItem, IntervalItem

Baseclass for clp constraints.

There are two types: zero and equal. See the documentation of the respective classes for details.

Method generated by attrs for class ClpConstraint.

Attributes Summary

target

type

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