RandomPolicy.py 258 B

12345678910111213
  1. # main imports
  2. import random
  3. # module imports
  4. from .Policy import Policy
  5. class RandomPolicy(Policy):
  6. def select(self):
  7. # choose operator randomly
  8. index = random.randint(0, len(self.operators) - 1)
  9. return self.operators[index]