Demo entry 1468502

MaxValue

   

Submitted by anonymous on Mar 14, 2015 at 02:01
Language: Python. Code size: 344 Bytes.

def maxvalue(self ,state, agentIndex, currentdepth):
      v = (float("-inf"), "Stop")
      for action in state.getLegalActions(agentIndex):
        v = max([v, (self.value(state.generateSuccessor(agentIndex, action), \
          (currentdepth+1) % self.number_of_agents, currentdepth+1), action)], key=lambda item:item[0])
      return v

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).