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

How to take the remainder of the variables in gurobi?

回答済み

コメント

6件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    You could try expressing each of the affected t variables as \(t = 7*a + b\), with \(a, b\) being integers and \(b \in [0,6]\) Then, \(b\) is your reminder and you can use it in the constraint you showed.

    Hope this helps.

    Best regards,
    Jonasz

    0
  • Yu yue
    • Gurobi-versary
    • Conversationalist
    • First Question

    Sorry, I didn't describe the problem I encountered clearly. I would like to solve the following problem,

    Cargo k starts shipping at time

    and arrives at time

    The start time  is known (represents the day of the week, Monday, Tuesday, etc.) and the arrival timeis the decision variable (determined by the chosen path,).
    I wantandto be the same, e.g. both on Monday or both on Tuesday.

     

    For example,=1 (ship on Monday),=35 (arrive in 35 days), and 35 days is also a Monday.

    Best regards,

    Yu

    0
  • Yu yue
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Jonasz,

    I'm sorry I didn't think carefully about the method you proposed, and I did the calculation again using your method. It worked.

    Thank you very much!

    Yu

    0
  • Matthias Miltenberger
    • Gurobi Staff

    One more piece of advice, Yu: You can use LaTeX directly in our Community Forum as explained here: Posting to the Community Forum

    This is a lot less work than copy-pasting mathematical notation as images.

    Cheers,
    Matthias

    0
  • Yu yue
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Matthias,

    Thanks, this is very helpful to me.

    Best regards,

    Yu

    0

投稿コメントは受け付けていません。