odatse.util.limitation module

class odatse.util.limitation.Inequality(a: ndarray, b: ndarray, is_limitary: bool)[source]

Bases: LimitationBase

Class representing an inequality limitation.

Initialize the inequality limitation.

Parameters:
  • a (np.ndarray) – Coefficient matrix.

  • b (np.ndarray) – Constant vector.

  • is_limitary (bool) – Boolean indicating if the limitation is active.

__init__(a: ndarray, b: ndarray, is_limitary: bool)[source]

Initialize the inequality limitation.

Parameters:
  • a (np.ndarray) – Coefficient matrix.

  • b (np.ndarray) – Constant vector.

  • is_limitary (bool) – Boolean indicating if the limitation is active.

classmethod from_dict(d)[source]

Create an Inequality instance from a dictionary.

Parameters:

d – Dictionary containing ‘co_a’ and ‘co_b’ keys.

Returns:

an Inequality instance.

Return type:

Inequality

judge(x: ndarray) bool[source]

Judge if the inequality limitation is satisfied.

Parameters:

x (np.ndarray) – Input array to be judged.

Returns:

Boolean indicating if the limitation is satisfied.

Return type:

bool

class odatse.util.limitation.LimitationBase(is_limitary: bool)[source]

Bases: object

Abstract base class for limitations.

Initialize the limitation.

Parameters:

is_limitary (bool) – Boolean indicating if the limitation is active.

abstract __init__(is_limitary: bool)[source]

Initialize the limitation.

Parameters:

is_limitary (bool) – Boolean indicating if the limitation is active.

abstract judge(x: ndarray) bool[source]

Abstract method to judge if the limitation is satisfied.

Parameters:

x (np.ndarray) – Input array to be judged.

Returns:

Boolean indicating if the limitation is satisfied.

Return type:

bool

class odatse.util.limitation.Unlimited[source]

Bases: LimitationBase

Class representing an unlimited (no limitation) condition.

Initialize the unlimited condition.

__init__()[source]

Initialize the unlimited condition.

judge(x: ndarray) bool[source]

Always returns True as there is no limitation.

Parameters:

x (np.ndarray) – Input array to be judged.

Returns:

Always True.

Return type:

bool