# builders.domain.constraints

Domain specification

Domain

# Constrained

A domain must inherit this class if it has constraints.

# get_constraints Constrained

get_constraints(
  self
) -> list[Constraint[Memory[D.T_state], StrDict[list[D.T_event]], D.T_state]]

Get the (cached) domain constraints.

By default, Constrained.get_constraints() internally calls Constrained._get_constraints_() the first time and automatically caches its value to make future calls more efficient (since the list of constraints is assumed to be constant).

# Returns

The list of constraints.

# _get_constraints Constrained

_get_constraints(
  self
) -> list[Constraint[Memory[D.T_state], StrDict[list[D.T_event]], D.T_state]]

Get the (cached) domain constraints.

By default, Constrained._get_constraints() internally calls Constrained._get_constraints_() the first time and automatically caches its value to make future calls more efficient (since the list of constraints is assumed to be constant).

# Returns

The list of constraints.

# _get_constraints_ Constrained

_get_constraints_(
  self
) -> list[Constraint[Memory[D.T_state], StrDict[list[D.T_event]], D.T_state]]

Get the domain constraints.

This is a helper function called by default from Constrained.get_constraints(), the difference being that the result is not cached here.

TIP

The underscore at the end of this function's name is a convention to remind that its result should be constant.

# Returns

The list of constraints.