You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this problem trying to implement a copy function for an OptiGraph, and it might be related to the way backends are set up. In the following code, the aggregated graph backend does not correctly record the variables:
If you look at graph backend of the original vs. aggregated graphs (gb vs. gb_agg), the latter reports 0 variables and constraints. In addition, the element_to_graph_map and graph_to_element_map are both empty and node_variables is missing nodes and variables. The all_variables function still correctly works though.
I looked into this a little deeper, and I think it may have to do with MOIU.pass_attributes in the aggregate.jl file here. In the source code for MOIU.pass_attributeshere, it relies on the function MOI.get function to collect attributes of the MOI.ListOfModelAttributesSet() or MOI.ListOfVariableAttributesSet(). However, if I call either MOI.get(gb, MOI.ListOfVariableAttributesSet()) or MOI.get(gb.backend, MOI.ListOfVariableAttributesSet()), I get an empty vector returned. However, the vector is nonempty if I call it on the lowest level subgraph's backend (e.g., on graph_backend(getsubgraphs(g1)[1]). I think perhaps the MOI backend is not seeing the subgraph information correctly? Any thoughts on how best to address this? I think my knowledge on the MOI backend and graph backend interfaces is not yet good enough to know how to resolve this.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Admittedly, the aggregate_to_depth code is the least tested part of Plasmo.jl right now. I'm not at all surprised you're having issues with it. I'll take a look in the next few days and see if I can get a fix out.
This seems to be an issue with aggregating the objective function. We are not copying the objective data to the aggregated graph correctly when we specify a depth.
Ran into this problem trying to implement a
copy
function for an OptiGraph, and it might be related to the way backends are set up. In the following code, the aggregated graph backend does not correctly record the variables:If you look at graph backend of the original vs. aggregated graphs (
gb
vs.gb_agg
), the latter reports 0 variables and constraints. In addition, theelement_to_graph_map
andgraph_to_element_map
are both empty andnode_variables
is missing nodes and variables. Theall_variables
function still correctly works though.I looked into this a little deeper, and I think it may have to do with
MOIU.pass_attributes
in theaggregate.jl
file here. In the source code forMOIU.pass_attributes
here, it relies on the functionMOI.get
function to collect attributes of theMOI.ListOfModelAttributesSet()
orMOI.ListOfVariableAttributesSet()
. However, if I call eitherMOI.get(gb, MOI.ListOfVariableAttributesSet())
orMOI.get(gb.backend, MOI.ListOfVariableAttributesSet())
, I get an empty vector returned. However, the vector is nonempty if I call it on the lowest level subgraph's backend (e.g., ongraph_backend(getsubgraphs(g1)[1])
. I think perhaps the MOI backend is not seeing the subgraph information correctly? Any thoughts on how best to address this? I think my knowledge on the MOI backend and graph backend interfaces is not yet good enough to know how to resolve this.The text was updated successfully, but these errors were encountered: