PowerModels.jl
PowerModels.jl copied to clipboard
Access to constraint references
In our application, it is required to be able to reference constraints generated through the PowerModels.jl interface, either to modify them or to access dual values.
My current fork is up-to-date with the lanl-ansi master branch except for a few changes to have some of the methods that construct constraints to return the constraint references:
https://github.com/bcdandurand/PowerModels.jl
If I missed some existing feature that would have made these modifications unnecessary, please let me know. Otherwise, may I ask that a future release of PowerModels provide a mechanism to give the user access to constraint references from generated constraints? Thank you.
The datastore pm.con us where the constraint references live. However, we are not currently very consistent about which ones are added there and what their names are. At the moment it is just the power balance and branch limits needed for some LMP analysis.
For now then, we need to use our fork until the PowerModels master version allows access to the needed constraint references. We shall keep our fork updated with the PowerModels master version until then.
After additional experience using PowerModels, it might be better that standard constraint names be established in a future version, rather than having the constraint generating functions return references. That way, if the user generates a model first, then later attaches a solver, the user can otherwise obtain the reference via the constraint name.
Agreed, the convention would that constraint references are stored in pm.con under a standard naming scheme. For the moment this is only done for a few constraint cases (power balance and branch flow) and not well tested across different formulations.
Adding this feature will incur a non trivial amount of code maintenance and also put a bigger burden on PowerModels extension implementation. So I am hesitant to commit to it until I have a sufficient body of motivating use cases.