SpineOpt.jl
SpineOpt.jl copied to clipboard
Update variable and constraint names after rolling
I noticed that we set the variable and constraint names at the beginning of the first window, to a string that includes the TimeSlice index. When TimeSlices roll, obviously this string doesn't change automatically which means variables and constraints will have obsolete names. This may be misleading to people trying to debug models that rolled -> all the variables and constraints will have names with time slices from the first window.
Ah - is there a cheap way to fix this behaviour?
The cheap coding solution, i.e. just updating the strings, can be extremely computationally expensive. So we need to get creative.
I was referring to performance rather than coding effort :-)
I was referring to performance rather than coding effort :-)
Of course you were!
I was thinking that we could, instead of setting the variables and constraints names in JuMP, just implement Base.show
for our variable and constraint containers. That would push the computation of the names to the moment the user decides to print the optimisation model. That's ok, but I don't know if there are drawbacks to not setting up the names in JuMP.
There may be issues when you want to use the conflict resolution functionality to diagnose infeasibilities - that's actually the reason I implemented to constraint names to begin with
Sorry I'm not familiar, what's the conflict resolution functionality?
There is the compute_conflict!
JuMP function... but the constraint names were for originally identifying infeasibilities reported by the solver
Thank you! In that case I think a good option would be to introduce a keyword argument that defaults to not setting any JuMP names for speed, but also allows to set the names for debugging - in which case the names would also be updated on rolling. I can try and go for that?
I not sure... perhaps a long run would die midway through because of an infeasibility - it would be a pity then, to have to change some parameters and rerun to find out why. It's very useful functionality when trying to debug models - let's not be too quick to take it away. Let me look into a little more
I see. Another option would be to define a 'static name' for time slices that's independent of the window, so it doesn't need to be updated when rolling. This could be for example a combination of the temporal block name and a consecutive integer.... or even a 'delta' computed from the start of the window?
That sounds good
Closing due to stale status.