File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -620,6 +620,29 @@ function MOI.get(model::Optimizer, ::MOI.TimeLimitSec)
620
620
return value == Inf ? nothing : value
621
621
end
622
622
623
+ # ##
624
+ # ## MOI.NodeLimit
625
+ # ##
626
+
627
+ MOI. supports (:: Optimizer , :: MOI.NodeLimit ) = true
628
+
629
+ function MOI. set (model:: Optimizer , :: MOI.NodeLimit , :: Nothing )
630
+ attr = MOI. RawOptimizerAttribute (" mip_max_nodes" )
631
+ MOI. set (model, attr, typemax (Cint))
632
+ return
633
+ end
634
+
635
+ function MOI. set (model:: Optimizer , :: MOI.NodeLimit , limit:: Real )
636
+ attr = MOI. RawOptimizerAttribute (" mip_max_nodes" )
637
+ MOI. set (model, attr, Int (limit))
638
+ return
639
+ end
640
+
641
+ function MOI. get (model:: Optimizer , :: MOI.NodeLimit )
642
+ value = MOI. get (model, MOI. RawOptimizerAttribute (" mip_max_nodes" ))
643
+ return value == typemax (Cint) ? nothing : Int (value)
644
+ end
645
+
623
646
# ##
624
647
# ## MOI.AbsoluteGapTolerance
625
648
# ##
You can’t perform that action at this time.
0 commit comments