def __init__(self, state): self.V = None self.converge = False self.Actions = {} for act in init.actions(state): act1 = STATEACTION() self.Actions[act] = act1
def action(self, state): """action by state""" acts = list(init.actions(state)) return random.choice(acts)