Guest User

Untitled

a guest
Jun 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. if True:
  2.     satList = [False]*items
  3.     for i in range(maxLimit):
  4.         print "<<<<<<<<"+str(i)+">>>>>>>>"
  5.         enforceList = [(i-1)*limits[j]/maxLimit != i*limits[j]/maxLimit for j in range(items)]
  6.         print "enforceList:", enforceList
  7.         willEnforce = any([e and not s for (e, s) in zip(enforceList,satList)])
  8.         print "willEnforce:", willEnforce
  9.         if willEnforce:
  10.             allSatisfied = True
  11.             for j in range(len(enforceList)):
  12.                 if enforceList[j]:
  13.                     # Enforce constraint j
  14.                     satisfied = (random.randint(0,5)>1)
  15.                     satList[j] = satisfied
  16.                     allSatisfied = satisfied and allSatisfied
  17.             if not allSatisfied:
  18.                 satList = [False]*items
  19.             print "allSatisfied:", allSatisfied
  20.         print "satList:", satList
  21.         print
Add Comment
Please, Sign In to add comment