Skip to main content

Set definition

Awaiting user input

Comments

1 comment

  • Mario Ruthmair
    Gurobi Staff Gurobi Staff

    Hi Shuk,

    How is this related to Gurobi? Are you trying to create variables for each tuple (tau,q)?

    Creating the list of feasible tuples can be done, e.g., with Python generator expressions:

    Tpt = [(tau, q) for tau in range(ESp, LSp + 1) for q in range(1, dp + 1) if tau + q - 1 == t]

    Then, you could for example create one binary variable for each pair (tau,q) by:

    x = model.addVars(Tpt, vtype=GRB.BINARY, name="x")

    Is this what you need?

    Best regards,
    Mario

    0

Please sign in to leave a comment.