Skip to content

Commit

Permalink
Corrected oscillatory behavior in load shed/pickup. Updated gitignore…
Browse files Browse the repository at this point in the history
… for ReOPT's julia install.
  • Loading branch information
LMSlaugh committed Jun 10, 2024
1 parent 2a7abdc commit eefec40
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ omf/solvers/reopt_jl/testFiles/resultsResilience.json
omf/solvers/reopt_jl/testFiles/results.json
omf/solvers/reopt_jl/testFiles/REoptInputs.json
omf/solvers/reopt_jl/reopt_jl.so
omf/solvers/reopt_jl/julia-1.9.4/*
instantiated.txt
35 changes: 17 additions & 18 deletions omf/models/restoration.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def graphMicrogrid(modelDir, pathToOmd, profit_on_energy_sales, restoration_cost
actionAction = []
actionLoadBefore = []
actionLoadAfter = []
loadsShed = []
prevLoadsShed = []
cumulativeLoadsShed = []
startTime = 1
if type(simTimeStepsRaw[0]) == str:
Expand Down Expand Up @@ -810,23 +810,22 @@ def graphMicrogrid(modelDir, pathToOmd, profit_on_energy_sales, restoration_cost
actionLoadAfter.append(switchActionsNew[entry])
switchActionsOld = key['Switch configurations']
loadShed = key['Shedded loads']
if len(loadShed) != 0:
for entry in loadShed:
cumulativeLoadsShed.append(entry)
if entry not in loadsShed:
actionDevice.append(entry)
actionTime.append(str(timestep))
actionAction.append('Load Shed')
actionLoadBefore.append('online')
actionLoadAfter.append('offline')
loadsShed.append(entry)
else:
actionDevice.append(entry)
actionTime.append(str(timestep))
actionAction.append('Load Pickup')
actionLoadBefore.append('offline')
actionLoadAfter.append('online')
loadsShed.remove(entry)
loadsPickedUp = [load for load in prevLoadsShed if load not in loadShed]
newShed = [load for load in loadShed if load not in prevLoadsShed]
for entry in newShed:
cumulativeLoadsShed.append(entry)
actionDevice.append(entry)
actionTime.append(str(timestep))
actionAction.append('Load Shed')
actionLoadBefore.append('online')
actionLoadAfter.append('offline')
for entry in loadsPickedUp:
actionDevice.append(entry)
actionTime.append(str(timestep))
actionAction.append('Load Pickup')
actionLoadBefore.append('offline')
actionLoadAfter.append('online')
prevLoadsShed = loadShed
timestep += 1
timestep = startTime
# while timestep < 24:
Expand Down

0 comments on commit eefec40

Please sign in to comment.