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
I see in the API documentation that the OptiGraph object extends a JuMP.AbstractModel and supports most JuMP.Model functions. My understanding was that one could specify certain OptiNode objects within the OptiGraph, and then one could have a custom overall objective that one would specify in the OptiGraphtaking variables from different OptiNodes.
For example, I would like to only specify feasibility problems in the OptiNodes and then set up an objective for the OptiGraph (instead of using a linear combination as is default).
However, when I try to add a variable or an objective to the Optigraph object, I get a MethodError:
I realize that jump_model(node::OptiNode) prints out the respective JuMP model. I was wondering if there is a corresponding function for the OptiGraph
The text was updated successfully, but these errors were encountered:
An OptiGraph does not support adding variables directly. It requires variables to be defined on OptiNodes (although I have been thinking about adding support for light-weight variable nodes). You can still create your objective function using @objective, you just have to reference variables on the nodes. For example, you should be able to do something like:
For your second question, the closest thing is aggregate(graph). This copies everything in the optigraph into a new node and returns the node and a dictionary that maps optigraph elements to the new node elements. This would look like:
Hi, Thanks for the exciting toolkit.
I see in the API documentation that the
OptiGraph
object extends a JuMP.AbstractModel and supports most JuMP.Model functions. My understanding was that one could specify certainOptiNode
objects within theOptiGraph
, and then one could have a customoverall
objective that one would specify in theOptiGraph
taking variables from differentOptiNodes
.For example, I would like to only specify feasibility problems in the
OptiNode
s and then set up an objective for theOptiGraph
(instead of using a linear combination as is default).However, when I try to add a variable or an objective to the
Optigraph
object, I get a MethodError:jump_model(node::OptiNode)
prints out the respective JuMP model. I was wondering if there is a corresponding function for theOptiGraph
The text was updated successfully, but these errors were encountered: