-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca8e67e
commit 8a68d67
Showing
2 changed files
with
454 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from pyomo.environ import ConcreteModel, Var, SolverFactory, value | ||
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=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") | ||
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 |
Oops, something went wrong.