Skip to content

Commit

Permalink
Add activity bounds to MIMO facade
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Apr 22, 2024
1 parent f10666f commit 3dd0ef7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions oemof_industry/mimo_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,13 +720,15 @@ def __init__(self, **kwargs):
conversion_factors = self._init_efficiencies(buses, groups, kwargs)
emission_factors = self._init_emissions(buses, groups, kwargs)
flow_shares = self._init_facade_flow_shares(buses, kwargs)
activity_bounds = self._init_facade_activity_bounds(kwargs)

super().__init__(
inputs=inputs,
outputs=outputs,
conversion_factors=conversion_factors,
emission_factors=emission_factors,
flow_shares=flow_shares,
activity_bounds=activity_bounds,
**kwargs,
)

Expand Down Expand Up @@ -877,3 +879,13 @@ def _init_facade_flow_shares(buses, kwargs):
flow_shares[share_type] = {bus_entry: value}
kwargs.pop(key)
return flow_shares

@staticmethod
def _init_facade_activity_bounds(kwargs):
activity_bounds = {}
for key, value in list(kwargs.items()):
if key.startswith("activity_bound"):
constraint_type = key.split("_")[2]
activity_bounds[constraint_type] = value
kwargs.pop(key)
return activity_bounds

0 comments on commit 3dd0ef7

Please sign in to comment.