Skip to content

Commit

Permalink
Merge pull request #21 from IDAES/main
Browse files Browse the repository at this point in the history
Bring Dev up to date
  • Loading branch information
rundxdi authored Jul 9, 2024
2 parents 0374f3d + 961eb75 commit 01df0f8
Show file tree
Hide file tree
Showing 5 changed files with 1,072 additions and 240 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,8 @@ cython_debug/
*.json

# ignore .DS_Store
*.DS_Store
*.DS_Store

# ignore "data"
*.csv
*.xlsx
44 changes: 29 additions & 15 deletions gtep/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,51 @@
data_path = "./gtep/data/5bus"
data_object = ExpansionPlanningData()
data_object.load_prescient(data_path)

mod_object = ExpansionPlanningModel(
stages=2,
stages=6,
data=data_object.md,
num_reps=2,
len_reps=1,
num_commit=24,
num_dispatch=12,
num_dispatch=4,
)
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 = Gurobi()
opt = Highs()
# mod_object.results = opt.solve(mod_object.model, tee=True)
# # 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("./gtep_solution.json")

sol_object.import_data_object(data_object)

# sol_object.read_json("./gtep_lots_of_buses_solution.json") # "./gtep/data/WECC_USAEE"
# sol_object.read_json("./gtep_11bus_solution.json") # "./gtep/data/WECC_Reduced_USAEE"
# sol_object.read_json("./gtep_solution.json")
# sol_object.read_json("./updated_gtep_solution_test.json")
# sol_object.read_json("./gtep_wiggles.json")
sol_object.plot_levels(save_dir="./plots/")

# save_numerical_results = False
# if save_numerical_results:

save_numerical_results = False
if save_numerical_results:
# sol_object = ExpansionPlanningSolution()

sol_object = ExpansionPlanningSolution()
# sol_object.load_from_model(mod_object)
# sol_object.dump_json()
# load_numerical_results = False
# if load_numerical_results:
# # sol_object.read_json("./gtep_solution.json")
# sol_object.read_json("./bigger_longer_wigglier_gtep_solution.json")
# plot_results = False
# if plot_results:
# sol_object.plot_levels(save_dir="./plots/")

sol_object.load_from_model(mod_object)
sol_object.dump_json()
load_numerical_results = False
if load_numerical_results:
# sol_object.read_json("./gtep_solution.json")
sol_object.read_json("./bigger_longer_wigglier_gtep_solution.json")
plot_results = False
if plot_results:
sol_object.plot_levels(save_dir="./plots/")

pass
Loading

0 comments on commit 01df0f8

Please sign in to comment.