Skip to content

变量初值设置 #12

Answered by metab0t
huiq666 asked this question in 中文Q&A
Jun 23, 2024 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

Set the upper bound and lower bound of the variable to the same value.

def fix_variable(model, var, value):
    model.set_variable_attribute(var, poi.VariableAttribute.LowerBound, value)
    model.set_variable_attribute(var, poi.VariableAttribute.UpperBound, value)

fix_variable(model, x, 1.0)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@huiq666
Comment options

Answer selected by metab0t
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants