'Runs the analysis through completion (until done() returns True) or, if n is provided, n times.
:param n: the maximum number of ticks
:returns: itself for chaining'

def run(self, n=None):

    global STOP_RUNS, PAUSE_RUNS
    self.active = self.filter_paths(self.active)
    while ((not self.done) and ((n is None) or (n > 0))):
        self.step()
        if STOP_RUNS:
            l.warning('%s    stopping    due    to    STOP_RUNS    being    set.', self)
            l.warning('...    please    call    resume_analyses()    and    then    this.run()    if    you    want    to    resume    execution.')
            break
        if PAUSE_RUNS:
            l.warning('%s    pausing    due    to    PAUSE_RUNS    being    set.', self)
            l.warning("...    please    call    disable_singlestep()    before    continuing    if    you    don't    want    to    single-step.")
            try:
                import ipdb as pdb
            except ImportError:
                import pdb
            pdb.set_trace()
        if (n is not None):
            n -= 1
    return self
