class MetricInt(object):
    """Int wrapper that adds only during the observation window."""

def __init__(self, sim, initial):
    self.sim = sim
self.val = int(initial)

def __add__(self, val):
    if self.sim.in_observe_window():
        self.val += int(val)
return self

def __int__(self):
    return self.val

def __float__(self):
    return float(self.val)
OverflowError: Python int too large to convert to C long