-
Notifications
You must be signed in to change notification settings - Fork 2
Adding binary (binary_big_M) decomposition type #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1030,7 +1030,7 @@ def get_converted_consumption_data( | |
| varstr=converted_varstr, | ||
| ) | ||
|
|
||
| if decomposition_type == "absolute_value": | ||
| if decomposition_type in ("absolute_value", "binary_big_M"): | ||
| # Decompose consumption data into positive and negative components | ||
| # with constraint that total = positive - negative | ||
| # (where negative is stored as positive magnitude) | ||
|
|
@@ -1042,7 +1042,7 @@ def get_converted_consumption_data( | |
| converted_consumption, | ||
| model=model, | ||
| varstr=utility, | ||
| decomposition_type="absolute_value", | ||
| decomposition_type=decomposition_type, | ||
| ) | ||
|
|
||
| consumption_data_dict[utility] = { | ||
|
|
@@ -1201,8 +1201,10 @@ def calculate_cost( | |
|
|
||
| decomposition_type : str or None | ||
| Type of decomposition to use for consumption data. | ||
| - "absolute_value": Linear problem using absolute value | ||
| - "binary_variable": `NotImplementedError` | ||
| - "absolute_value": Uses max(x, 0) constraints. Creates nonlinear problem | ||
| for Pyomo due to abs() constraint. | ||
| - "binary_big_M": Uses binary indicator with Big-M constraints. | ||
| Creates a MILP (mixed-integer linear program) for Pyomo. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be "for Pyomo or CVXPY" since |
||
| - None (default): No decomposition, treats all consumption as imports | ||
|
|
||
| varstr_alias_func: function | ||
|
|
@@ -1449,8 +1451,10 @@ def build_pyomo_costing( | |
|
|
||
| decomposition_type : str or None | ||
| Type of decomposition to use for consumption data. | ||
| - "absolute_value": Linear problem using absolute value | ||
| - "binary_variable": `NotImplementedError` | ||
| - "absolute_value": Uses max(x, 0) constraints. Creates nonlinear problem | ||
| for Pyomo due to abs() constraint. | ||
| - "binary_big_M": Uses binary indicator with Big-M constraints. | ||
| Creates a MILP (mixed-integer linear program) for Pyomo. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be "for Pyomo or CVXPY" since binary_big_M is supported for both? |
||
| - None (default): No decomposition, treats all consumption as imports | ||
|
|
||
| varstr_alias_func: function | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!