Skip to content

Commit 211264f

Browse files
author
Giovanni Amorim
committed
fix objective function for bilevel mode to represent avg cost
1 parent 75be3bb commit 211264f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/optimizers/bilevel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function solve_bilevel(
9595
low_obj = sum([
9696
value(x -> low_var_map[x][t], pre_obj_func)
9797
for t=1:T
98-
])
98+
]) / T
9999
@objective(Lower(bilevel_model), pre_obj_sense, low_obj)
100100

101101
# upper model objective
@@ -104,7 +104,7 @@ function solve_bilevel(
104104
up_obj = sum([
105105
value(x -> up_var_map[x][t], post_obj_func)
106106
for t=1:T
107-
])
107+
]) / T
108108
@objective(Upper(bilevel_model), post_obj_sense, up_obj)
109109

110110
# fix upper model observations

0 commit comments

Comments
 (0)