Asset.__init__#
- Asset.__init__(lower_bound, upper_bound, init_fn_or_value=None, functional=True)[source]
Initialize the asset with the lower and upper bounds.
The lower and the upper bounds represent the element which is always contained in and the element the always contains the asset, respectively. Thus, they must respect the total ordering of the asset.
The init_fn_or_value parameter is the function to initialize the asset. It can be a primitive type, a callable with no arguments or an AssetSpace object. If it is not provided, the asset will be initialized with the lower bound.
The functional parameter indicates if the asset is functional or not, thus if it must be checked during the validation of a placement or not.
- Parameters:
lower_bound (Any) – The lower bound of the asset.
upper_bound (Any) – The upper bound of the asset.
init_fn_or_value (PrimitiveType | AssetSpace | Callable[[], Any] | None) – The function to initialize the asset. It can be a primitive type, a callable with no arguments or an AssetSpace object. If it is not provided, the asset will be initialized with the lower bound. Defaults to None.
functional (bool, optional) – If True, the asset is functional. Defaults to True.
- Raises:
ValueError – If the lower bound is not contained in the upper bound.
TypeError – If the init_fn is not a callable or an AssetSpace object.