Skip to content

Commit

Permalink
See #ANT-1267 Explicit naming for variables and constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmnz committed Mar 6, 2024
1 parent 1b77200 commit 9d5da66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/andromede/simulation/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def make_constraint(
Adds constraint to the solver.
"""
solver_constraints = {}
constraint_name = data.name
constraint_name = f"{data.name}_t{block_timestep}_s{scenario}"
for instance in range(instances):
if instances > 1:
constraint_name += f"_{instance}"
Expand Down Expand Up @@ -753,7 +753,7 @@ def _create_variables(self) -> None:
solver_var = self.solver.NumVar(
lower_bound,
upper_bound,
f"{component.id}_{model_var.name}_{block_timestep}_{scenario}",
f"{component.id}_{model_var.name}_t{block_timestep}_s{scenario}",
)
component_context.add_variable(
block_timestep, scenario, model_var.name, solver_var
Expand Down

0 comments on commit 9d5da66

Please sign in to comment.