Concave#
- class eclypse.graph.assets.concave.Concave[source]#
Bases:
AssetConcaveAsset represents a numeric asset where the aggregation is concave.
Methods
__init__(lower_bound, upper_bound[, ...])Create a new Concave asset.
aggregate(*assets)Aggregate the assets into a single asset by taking the maximum value.
flip()Flip the concave asset into a convex asset.
is_consistent(asset)Check if the asset belongs to the interval [lower_bound, upper_bound].
satisfies(asset, constraint)Check if asset contains constraint.
- __init__(lower_bound, upper_bound, init_fn_or_value=None, functional=True)[source]#
Create a new Concave 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 by taking the maximum value.
If no assets are provided, the lower bound is returned.
- Parameters:
assets (Iterable[TConcave]) – The assets to aggregate.
- Returns:
The aggregated asset.
- Return type:
TConcave
- satisfies(asset, constraint)[source]#
Check if asset contains constraint.
In the ordering of a concave asset, the lower value contains the other.
- Parameters:
asset (TConcave) – The “container” asset.
constraint (TConcave) – The “contained” asset.
- Returns:
True if asset <= constraint, False otherwise.
- Return type:
bool