better bounds checking for get_times in boolean circuit

This commit is contained in:
Marcell Vazquez-Chanlatte 2017-04-24 00:07:48 -07:00
parent 5d3e2ed354
commit 8f5035a9e3

View file

@ -33,8 +33,10 @@ def get_times(x, tau, lo=None, hi=None):
lo = min(v.first()[0] for v in x.values())
if hi is None or hi is oo:
hi = max(v.last()[0] for v in x.values())
lo += tau
hi += tau
end = min(v.domain.end() for v in x.values())
hi = hi + tau if hi + tau <= end else end
lo = lo + tau if lo + tau <= end else end
if lo > hi:
return []
elif hi == lo: