メインコンテンツへスキップ

L1 space filling design

回答済み

コメント

3件のコメント

  • David Walz
    • Gurobi-versary
    • First Comment
    • First Question

    Also, how do you properly format code in this forum?

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi David,

    The logic of your model is correct. The issue is that default lower bounds for variables are 0 in Gurobi. However, your \(\texttt{(X{i1} - X{i2})_{j}}\) can take negative values. Setting the lower bound explicitly to be negative

    z1[i1, i2, j] = model.addVar(lb=-1,name=f"(X{i1}-X{i2})_{j}")

    solves the issue.

    In general, you should avoid having whitespaces in variable names. Gurobi does not care about the names internally and the whitespaces won't affect Gurobi's optimization algorithm, but when writing the model to a file or interacting with other software, whitespaces in names often lead to unexpected behavior.

    Also, how do you properly format code in this forum?

    Unfortunately, the forum editor does not support markdown. All features of the forum editor should be described in Posting to the Community Forum.

    Best regards, 
    Jaromił

     

    0
  • David Walz
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromil,

    great thanks!

    David

    0

サインインしてコメントを残してください。