def initialize(self): """ initilize the services and the algorithms """ self.msg.cinfo(' initilize ') svcs = self.svcs.values() map(self._declare, svcs) oks1 = map(lambda svc: svc.initialize(), svcs) if (len(self.algs) == 0): self.msg.warning(self.name,' No algorithms to run') return True for alg in self.algs: self.counters[alg.name] = 0 oks2 = map(lambda alg: alg.initialize(), self.algs) return (isok(oks1) and isok(oks2))
def execute(self): """ do the execute method over the list of algorithms """ if (self.ievt%self.evtfreq==0): self.msg.cinfo(' event ', self.ievt) self.evt.clear() if (len(self.algs)==0): self.ievt += 1; return True oks = map(lambda alg: alg.execute(), self.algs) def count(alg,ok): if (ok): self.counters[alg.name]+=1 map(count,self.algs,oks) self.ievt+=1 return isok(oks)