在alpha,beta修剪算法中, 我有一个类,其中定义了一个函数def getAction(self,gamestate)id。我在做高清的getAction 2个功能python中的alpha beta修剪
像:
class BAC:
def you(self,gamestate):
def me(gamestate,depth,alpha, beta):
------
return v
def both(gamestate,depth,alpha, beta):
-------------------
return v
return me(gamestate,0,alpha, beta)-
我需要把α,β函数我和两个。但是,我在哪里定义alpha和beta值。如果我定义了alpha和beta定义我和def两个然后错误发生,因为有全局名称alpha不存在。
如何制作alpha和beta局部变量或如何才能使其正确工作?
除了有人会为你编码吗? – djondal 2010-08-03 02:01:27