Skip to content

Commit

Permalink
Merge pull request #5 from rundxdi/main
Browse files Browse the repository at this point in the history
Solver Testing Update
  • Loading branch information
rundxdi authored Jan 23, 2024
2 parents ded8eaf + e1c9459 commit 035547f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gtep/tests/unit/test_gtep_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@ def test_model_init(self):
len(dispatch_block_1), len(commitment_block_q[1].dispatchPeriods)
)

# Solve the debug model as is. Objective value should be $466769.69
# Assumes availability of HiGHS
# Solve the debug model as is. Objective value should be $1375.56
# assumes availability of scip
def test_solve_bigm(self):
md = read_debug_model()
modObject = ExpansionPlanningModel(
data=md, num_reps=1, len_reps=1, num_commit=1, num_dispatch=1
)
modObject.create_model()
opt = SolverFactory("highs")
opt = SolverFactory("scip")
TransformationFactory("gdp.bigm").apply_to(modObject.model)
modObject.results = opt.solve(modObject.model, tee=False, load_solutions=True)
modObject.report_model()
self.assertAlmostEqual(
value(modObject.model.total_cost_objective_rule), 483519.2, places=1
value(modObject.model.total_cost_objective_rule), 1375.56, places=1
)
self.assertEqual(
str(u.get_units(modObject.model.total_cost_objective_rule.expr)), "USD"
Expand Down

0 comments on commit 035547f

Please sign in to comment.