Skip to content

Commit

Permalink
Merge branch 'multi_stock' of https://github.com/AntaresSimulatorTeam…
Browse files Browse the repository at this point in the history
…/antares-water-values into multi_stock
  • Loading branch information
Juliette-Gerbaux committed Dec 11, 2024
2 parents 74d2fe8 + 85aecd3 commit b709fa2
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 115 deletions.
14 changes: 4 additions & 10 deletions src/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def draw_usage_values(
marker=dict(symbol="circle"),
showlegend=True,
)
for i, (area, mng) in enumerate(
multi_stock_management.dict_reservoirs.items()
)
for i, (_, _) in enumerate(multi_stock_management.dict_reservoirs.items())
]
+ [
go.Scatter(
Expand All @@ -76,9 +74,7 @@ def draw_usage_values(
line=dict(dash="dash"),
showlegend=True,
)
for i, (area, mng) in enumerate(
multi_stock_management.dict_reservoirs.items()
)
for i, (_, mng) in enumerate(multi_stock_management.dict_reservoirs.items())
]
+ [
go.Scatter(
Expand All @@ -90,9 +86,7 @@ def draw_usage_values(
line=dict(dash="dash"),
showlegend=True,
)
for i, (area, mng) in enumerate(
multi_stock_management.dict_reservoirs.items()
)
for i, (_, mng) in enumerate(multi_stock_management.dict_reservoirs.items())
],
layout=dict(title=f"Usage Values"),
)
Expand Down Expand Up @@ -166,7 +160,7 @@ def draw_uvs_sddp(
showlegend=True,
visible=(r == 0),
)
for r, res in enumerate(reservoirs)
for r, _ in enumerate(reservoirs)
]
+ [
go.Scatter(
Expand Down
4 changes: 1 addition & 3 deletions src/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def __init__(
costs: np.ndarray,
duals: np.ndarray,
correlations: Optional[np.ndarray] = None,
interp_mode: bool = False,
) -> None:
"""
Instanciates a LinearCostEstimator
Expand Down Expand Up @@ -385,7 +384,6 @@ def update(
inputs: np.ndarray,
costs: np.ndarray,
duals: np.ndarray,
interp_mode: bool = False,
) -> None:
"""
Updates the parameters of the Linear Interpolators
Expand All @@ -407,7 +405,7 @@ def update(
duals=duals,
)

def enrich_estimator(self, n_splits: int = 3) -> None:
def enrich_estimator(self) -> None:
"""
Adds 'mid_cuts' to our cost estimator to smoothen the curves and (hopefully) accelerate convergence
Expand Down
1 change: 0 additions & 1 deletion src/functions_iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ def init_iterative_calculation(
stock_discretization=X,
)

i = 0
gap = 1e3
fin = time()
tot_t.append(fin - debut)
Expand Down
4 changes: 0 additions & 4 deletions src/hyperplane_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ def interpolate_between(
return mlr, data


mlrs: list = []
datas: list = []


def enrich_by_interpolation(
controls_init: np.ndarray, costs: np.ndarray, slopes: np.ndarray, n_splits: int = 3
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
Expand Down
4 changes: 2 additions & 2 deletions src/launch_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def calculate_bellman_values(

elif method == "precalculated":
# or with precalulated reward
vb, G = calculate_bellman_value_with_precalculated_reward(
vb, _ = calculate_bellman_value_with_precalculated_reward(
len_controls=len_controls,
param=param,
reservoir_management=reservoir_management,
Expand All @@ -61,7 +61,7 @@ def calculate_bellman_values(

elif method == "iterative":
# or with iterative algorithm
vb, G, _, _, controls_upper, traj = itr_control(
vb, _, _, _, _, _ = itr_control(
param=param,
reservoir_management=reservoir_management,
output_path=output_path,
Expand Down
Loading

0 comments on commit b709fa2

Please sign in to comment.