class documentation
class DequeCDF(_collections.deque):
a queue with (in case) element-wise cdf computation.
The deque
is here used like a list
with maximum length functionality,
the (inherited) constructor takes maxlen
as keyword argument (since Python 2.6).
>>> import cma >>> d = cma.constraints_handler.DequeCDF(maxlen=22) >>> for i in range(5): ... d.append([i]) >>> ' '.join(['{0:.2}'.format(x) for x in ... [d.cdf(0, 0), d.cdf(0, 2), d.cdf(0, 2.1), d.cdf(0, 22.1), d.cdf(0, 4, 2)]]) '0.1 0.5 0.6 1.0 0.75'