def popRandomTarget(self, sceneName): random.seed(pymjin2.rand(True)) id = random.randint(0, len(MAIN_TARGETS_LEVERAGES) - 1) targetName = MAIN_TARGETS_LEVERAGES.keys()[id] key = "target.{0}.{1}.moving".format(sceneName, targetName) st = pymjin2.State() st.set(key, "1") self.senv.setState(st)
def popRandomTarget(self): random.seed(pymjin2.rand(True)) id = random.randint(1, SINGLE_MAIN_TARGETS_NB) self.u.d["TARGET"] = SINGLE_MAIN_TARGET_NAME + str(id) self.u.set("target.$SCENE.$TARGET.moving", "1")