code: def doOutages(self):
          
          assert len(self.branchOutages) == len(self.market.case.branches)
  
          weights = [[(False, r), (True, 1 - (r))] for r in self.branchOutages]
  
          for i, ln in enumerate(self.market.case.branches):
              ln.online = weighted_choice(weights[i])
              if ln.online == False:
                  print "Branch outage [%s] in period %d." %(ln.name,self.stepid)
docs: Applies branch outtages.