Skip to content

Commit

Permalink
Fix rebase conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
tbittar committed Mar 13, 2024
1 parent abed8a0 commit 303bd14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/andromede/simulation/benders_decomposed.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
InvestmentProblemStrategy,
OperationalProblemStrategy,
)
from andromede.simulation.time_block import ConfiguredTree, TimeBlock
from andromede.simulation.time_block import TimeBlock
from andromede.study.data import DataBase
from andromede.study.network import Network
from andromede.utils import read_json, serialize, serialize_json
Expand Down Expand Up @@ -228,7 +228,6 @@ def build_benders_decomposed_problem(
master = build_problem(
master_network,
database,
configured_tree.root, # Could be any node, given the implmentation of get_nodes()
null_time_block := TimeBlock( # Not necessary for master, but list must be non-empty
0, [0]
),
Expand Down
26 changes: 17 additions & 9 deletions tests/integration/test_benders_decomposed.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
CONSTANT,
DEMAND_MODEL,
GENERATOR_MODEL,
NODE_BALANCE_MODEL,
NODE_WITH_SPILL_AND_ENS_MODEL,
NODE_WITH_SPILL_AND_ENS,
)
from andromede.model import (
Constraint,
Expand All @@ -38,6 +37,10 @@
TimeBlock,
build_benders_decomposed_problem,
)
from andromede.simulation.decision_tree import (
create_network_on_tree,
create_single_node_decision_tree,
)
from andromede.study import (
Component,
ConstantData,
Expand Down Expand Up @@ -214,7 +217,7 @@ def test_benders_decomposed_integration(

demand = create_component(model=DEMAND_MODEL, id="D")

node = Node(model=NODE_WITH_SPILL_AND_ENS_MODEL, id="N")
node = Node(model=NODE_WITH_SPILL_AND_ENS, id="N")
network = Network("test")
network.add_node(node)
network.add_component(demand)
Expand All @@ -228,9 +231,13 @@ def test_benders_decomposed_integration(
PortRef(cluster_candidate, "balance_port"), PortRef(node, "balance_port")
)
scenarios = 1
blocks = [TimeBlock(1, [0])]

configured_tree = create_single_node_decision_tree(blocks, scenarios)
tree_node_to_network = create_network_on_tree(network, configured_tree.root)

xpansion = build_benders_decomposed_problem(
network, database, [TimeBlock(1, [0])], scenarios
tree_node_to_network, database, configured_tree
)

data = {
Expand Down Expand Up @@ -305,7 +312,7 @@ def test_benders_decomposed_multi_time_block_single_scenario(
id="D",
)

node = Node(model=NODE_WITH_SPILL_AND_ENS_MODEL, id="N")
node = Node(model=NODE_WITH_SPILL_AND_ENS, id="N")
network = Network("test")
network.add_node(node)
network.add_component(demand)
Expand All @@ -316,12 +323,13 @@ def test_benders_decomposed_multi_time_block_single_scenario(
network.connect(PortRef(candidate, "balance_port"), PortRef(node, "balance_port"))

scenarios = 1
blocks = [TimeBlock(1, [0]), TimeBlock(2, [1])]

configured_tree = create_single_node_decision_tree(blocks, scenarios)
tree_node_to_network = create_network_on_tree(network, configured_tree.root)

xpansion = build_benders_decomposed_problem(
network,
database,
[TimeBlock(1, [0]), TimeBlock(2, [1])],
scenarios,
tree_node_to_network, database, configured_tree
)

data = {
Expand Down

0 comments on commit 303bd14

Please sign in to comment.