Skip to content

Commit

Permalink
Merge pull request #1 from hardsnow-sandia/dev-move
Browse files Browse the repository at this point in the history
moved updates to the right place
  • Loading branch information
hardsnow-sandia authored May 7, 2024
2 parents 8a68d67 + 0a64da4 commit 4dbb310
Show file tree
Hide file tree
Showing 4 changed files with 407 additions and 469 deletions.
32 changes: 0 additions & 32 deletions driver.py

This file was deleted.

19 changes: 16 additions & 3 deletions gtep/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@
from pyomo.environ import units as u
from gtep.gtep_model import ExpansionPlanningModel
from gtep.gtep_data import ExpansionPlanningData
from gtep.gtep_solution import ExpansionPlanningSolution
from egret.data.model_data import ModelData
from pyomo.core import TransformationFactory
from pyomo.contrib.appsi.solvers.highs import Highs


data_path = "./gtep/data/5bus"
data_object = ExpansionPlanningData()
data_object.load_prescient(data_path)
mod_object = ExpansionPlanningModel(
data=data_object.md, num_reps=1, len_reps=1, num_commit=1, num_dispatch=1
data=data_object.md, num_reps=2, len_reps=3, num_commit=4, num_dispatch=5
)
mod_object.create_model()
TransformationFactory("gdp.bound_pretransformation").apply_to(mod_object.model)
TransformationFactory("gdp.bigm").apply_to(mod_object.model)
opt = SolverFactory("gurobi")
mod_object.results = opt.solve(mod_object.model, tee=True)
# opt = SolverFactory("gurobi")
opt = Highs()
# mod_object.results = opt.solve(mod_object.model, tee=True)
mod_object.results = opt.solve(mod_object.model)

sol_object = ExpansionPlanningSolution()

sol_object.load_from_model(mod_object)
sol_object.dump_json()

sol_object.read_json("./gtep_solution.json")
sol_object.plot_dispatch_level(save_dir="./plots/")
pass
Loading

0 comments on commit 4dbb310

Please sign in to comment.