-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Business plan plot #12
Conversation
I've renamed the back but it still shows sankey_branch should I do git fetch? |
Have you tested the execution of the function? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation!
I've added some comments.
It could also be nice to add a test once finished.
may you attach a plot of the image you obtain here for discussing it?
Awesome PR!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is getting a very nice shape! :D
src/ECModel.jl
Outdated
NPV = profit_distribution | ||
|
||
# Total reward | ||
Ann_reward = NPV .+ CAPEX .+ OPEX .+ Ann_Replacement .- Ann_Recovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't touch this line as I guess it is not clear.
In the original split function all this values where 1D arrays by user that represent the total discounted values by entity.
Therefore, by making the appropriate differences we calculated the total discounted reward allocation by user.
Now with each variable being 2D that is a bit tricky to do.
I think we should first identify the total annualized reward allocation and then (assumption) uniformly distribute it across the years.
Given that all the structures are 2D there is for sure a smart way to do that; I propose an approach, but feel to propose an alternative.
Basically, what we may need to do is to create a proxy total discounted cost of all terms but NPV so to reproduce the old (CAPEX .+ OPEX .+ Ann_Replacement .- Ann_Recovery
).
For example, something like:
(CAPEX .+ OPEX .+ Ann_Replacement .- Ann_Recovery).data * ann_factor
(note that since they are matrix operation, there may be the need for some transpositions
Then, the resulting vector shall be a 1 column or 1 vector and we can create the equivalent 1D cost vector, so that we can do (total_discounted_reward = NPV .- new_vector).
Then, we can do total_discounted_reward ./(sum(act_factor) - 1) and this should be a 1D vector of the yearly reward allocation by user, that can be exploded into 2D by simply duplicating the entries.
src/ECModel.jl
Outdated
REWARD = Float64[], RV = Float64[], PEAK = Float64[]) | ||
for i in years | ||
CAPEX = sum(business_plan.CAPEX[i, :]) | ||
Year = 0 + years[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The year set may be obtained from the axis of any function of business_plan, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll think about it
I see. |
This is the dataframe. For sure OEM, EN_SELL, REWARD and RV must be 0 the first year. And REP 0 except the year of substitution. EN_CONS and PEAK is always 0 except for last year 21×9 DataFrame |
I forgot in which part of the code insert ECModel.results[:R_Reward_agg_tot] = 0 for non_cooperative in order to create a reward variable that is = 0 for non cooperative and >0 for cooperative and ANC. You showed it to me but I forgot and I didn't apply the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool Tommaso :D
I think we are close to finalize :D
Could you add a sample plot as well?
Here :) EnergyCommunity.jl/src/non_cooperative.jl Line 692 in fc3420f
You can get inspiration from here: EnergyCommunity.jl/src/aggregated_non_cooperative.jl Lines 203 to 265 in fc3420f
Basically all expressions mentioned there should be available in the NC configuration as well, with appropriate values (including many 0s) Apologies for the late reply, I didn't see the message at first |
Maybe its the key: "labelS". |
The key labelS=bar_labels, kwargs...) cancel completely the following keys. Maybe it's because it's a vector and maybe should require a list but I've tried with [keys(plot_struct)] and It gives me a strange error. Maybe list(keys(plot_struct))? |
It may be the type of object that is a matrix instead. [1 2 3] is a 2D matrix 1×3 hcat(collect(keys(..))...) |
957ff03
to
181b7d7
Compare
d25b9e6
to
eb0ebae
Compare
eb0ebae
to
9743f12
Compare
@TomFer97 Merged :D |
No description provided.