Modeling constraints in gurobi

$$\max \lbrace 0, q_i \rbrace \le L^r_i \le \min \lbrace Q^r,Q^r+q_i \rbrace \quad \forall i\in N,r\in R$$

I am not sure if this type of question is allowed here but I am stuck at modeling this constraints for the pickup dropoff problem with time window in Python using Gurobi API. Can anyone point me in the right direction or show an example?

• This type of question is definitely allowed. I suggest that you edit your question though and use MathJax for your equation. And also, can you clarify in your question that $Q^r$ is a positive constant and $q_i$ and $L^r_{i}$ are variables (integer and continuous)?
– EhsanK
Apr 8, 2022 at 13:33
• Thanks Ehsan! yes Qr is positive continuous, qi can be negative parameter . Lri is variable.
– mars
Apr 8, 2022 at 13:49
• The good news is that max and min both appear convexly (i.e., all the constraints are convex), so no linearization, logic modeling, or introduction of binaries, etc should be needed. Apr 8, 2022 at 15:03