title: How to round up in gurobi python?
body: <p>I am working on a math model using <code>Python</code>.</p>
  <p>I have 4 datasets:</p>
  <pre><code>1. Trucks=[1:263]
  2. Slots=[0:23]
  3. Companies=[0:3]
  4. Blocks=[0:7]
  </code></pre>
  <p>2 binary decision variables <code>X</code> and <code>Y</code> and 1 binary dependent decision variable <code>Z (Z=X+Y)</code>.</p>
  <p>I want to add the continuous-time parameters <code>(tp+twg)</code> to the index <code>s</code> (which is an integer) to make the truck access the terminal in the time slot after <code>(tp+twg)</code>.</p>
  <p>So I have to round the value of <code>(s+tp+twg)</code> to the next time slot.
  I used the function below <code>math.ceil()</code> but I got an error in time slot 23. Gurobi can't calculate the value of (0,0,1,24) because the upper limit of the set <code>S</code> is 23. <code>S</code> refers to the time slot at which the truck will access to the terminal in <code>X</code> and <code>Y</code>. In <code>Z</code>, it refers to the time slot at which the truck will arrive at the terminal gate.</p>
  <p>Any ideas on how to fix this?</p>
  <pre><code>    for i in Trucks:
          for k in Companies:
              for b in Blocks:
                  for s in Slots:
                      if 0 &lt;= s &lt; 23:
                          cont_9=m.addConstr(X[i,k,b, math.ceil(s+tp[s]+twg[s])]+Y[i,k,b, math.ceil(s+tp[s]+twg[s])] &lt;= Z[i,k,b,s])
  </code></pre>