-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix time indices for representative temporal blocks #1015
base: master
Are you sure you want to change the base?
Fix time indices for representative temporal blocks #1015
Conversation
…sentative temporal structure
…slices" This reverts commit 1c31c02.
only prune the dynamic time slices for unit_state_transition prune first dynamic time slice only for unit with representative temporal blocks prune dynamic time slice by temp parameter
remove unused function
remove wrong pilot implementation
# the model can't find a mapping to representative blocks for the outside time indices. | ||
if !(explicit_representative_temporal_block(temporal_block=blk)) || tb in time_slice( | ||
m; temporal_block=members(blk) | ||
) |
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 will damage performance.
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.
src/variables/variable_common.jl
Outdated
merge!(vars, Dict(ind => coeff * vars[ref_ind] for (ind, (ref_ind, coeff)) in ind_map)) | ||
# A ref_ind may not be covered by keys(vars) unless | ||
# the ind_map is carefully designed in specific variable adding functions. | ||
merge!(vars, Dict(ind => coeff * vars[ref_ind] for (ind, (ref_ind, coeff)) in ind_map if haskey(vars, ref_ind))) |
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 haskey introduce an extra lookup for every iteration of the comprehension and might also damage performance.
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.
Thanks! The haskey check now goes outside the iteration (commit 2cefffa).
@nnhjy thanks a lot for this, seems to be coming along nicely. Perhaps you can describe in more detail the issue this is trying to solve? Also if you need help or if you want someone to review it before you merge it please let me know. |
A perhaps provisional fix for the cases where we need representative temporal blocks and constraints concerning unit state transitions.
Fixes # (issue)
Checklist before merging