Skip to content

Commit

Permalink
Add timelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-tomasini committed Dec 10, 2024
1 parent ec59b9f commit 5fe13cd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
self, input_instance: BaseLineInput, first_stage: BaselineFirstStage, timestep: timedelta,
buffer: float = 0.2, big_m: float = 1e6, error_threshold: float = 0.1, powered_volume_enabled: bool = True,
quantile: float = 0.15, spilled_factor: float = 1e2, with_penalty: bool = True, log_solver_info: bool = False,
global_price: bool = False
global_price: bool = False, time_limit:float = 120
):
self.retrieve_input(input_instance)
self.big_m: float = big_m
Expand Down Expand Up @@ -64,6 +64,8 @@ def __init__(
self.result_spilled_volume: pl.DataFrame = pl.DataFrame()
self.data: dict = {}


self.solver.options['TimeLimit'] = time_limit
self.initialise_volume()
self.get_alpha_boundaries()
self.calculate_powered_volume()
Expand Down

0 comments on commit 5fe13cd

Please sign in to comment.