Multiplicative#
- class eclypse.graph.assets.multiplicative.Multiplicative[source]#
Bases:
AssetRepresent a numeric asset where the aggregation is multiplicative.
Methods
__init__(lower_bound, upper_bound[, ...])Create a new Multiplicative asset.
aggregate(*assets)Aggregate the assets into a single asset via product.
flip()Flip the multiplicative asset into a multiplicative concave asset.
is_consistent(asset)Check if the asset belongs to the interval [lower_bound, upper_bound].
satisfies(asset, constraint)Check asset contains constraint.
- __init__(lower_bound, upper_bound, init_fn_or_value=None, functional=True)[source]#
Create a new Multiplicative asset.
- Parameters:
lower_bound (float) – The lower bound of the asset.
upper_bound (float) – 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 $lower_bound > upper_bound$.
- aggregate(*assets)[source]#
Aggregate the assets into a single asset via product.
- Parameters:
assets (Iterable[float]) – The assets to aggregate.
- Returns:
The aggregated asset.
- Return type:
float
- satisfies(asset, constraint)[source]#
Check asset contains constraint.
In an multiplicative asset, the higher value contains the lower value.
- Parameters:
asset (float) – The “container” asset.
constraint (float) – The “contained” asset.
- Returns:
True if asset >= constraint, False otherwise.
- Return type:
bool