That’s the problem with ILP; it is NP-complete so times can explode.
A simple strategy is to solve and optimise a problem as an ordinary linear programming problem, get the solution, and check where your other rules are violated. For example if you find an optimal solution where x = 12.381 but x must be an integer, then you solve two problems, one with x <= 12 added, and one with x >= 13 added. (If you do this by hand you can also handle cases like “x must be the square of a prime”: Either x <= 9 or x >= 25).
In your case, you just solve ignoring your condition. If your condition is fulfilled, great. Otherwise you solve the problem once with a (ts, it) = 1 added, and once with a (ts, it) = 0 and (one of the four conditions is not met) added.