Internalize variables -> self.variables & add revenue functions within a class #2
Open
minhokg wants to merge 2 commits intoFlexPwr:mainfrom
Open
Internalize variables -> self.variables & add revenue functions within a class #2minhokg wants to merge 2 commits intoFlexPwr:mainfrom
minhokg wants to merge 2 commits intoFlexPwr:mainfrom
Conversation
|
Dear minhokg, Thanks for this contribution. It is really useful. One quick question is should the power_cap be taken into account as well in the revenue calculation because step1_dis_daa and step1_cha_daa are fractions of the bid energy? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses the two issues about optimizer.py and suggests improvements.
For example, in the step1_optimize_daa function, I modified
step1_cha_daatoself.step1_cha_daa. By doing so, the step2_optimize_ida function no longer needs the step1 function's return value.That is, step2 function requires fewer arguments than previous: From
step2_optimize_ida(self, ..., ida_price_vector: list, step1_cha_daa: list, step1_dis_daa: list)tostep2_optimize_ida(self,..., ida_price_vector: list). The same logic is applied to the step3 functions (i.e. it no longer needs step2 return values).Previously, revenue values( DAA, IDA, IDC) were calculated outside the optimizer class. So, I added the revenue functions inside the class for convenience.
For example,
So you can calculate the revenue just by calling the function
Because all variables within the class are internalized, the revenue_daa function doesn't need any additional argument. You can see the example in the modified example.ipynb.
Thank you for reviewing this pull request. I'm eager to address any feedback and further improve the bess_optimizer.