• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tree.node函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tree.node函数的典型用法代码示例。如果您正苦于以下问题:Python node函数的具体用法?Python node怎么用?Python node使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了node函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: splitBDD

def splitBDD(BDD,c1):
	if len(BDD.data) > c1-1:
		#print type(BDD),type(BDD.cutval),type(BDD.dimCutVal),type(BDD.data),type(BDD.n1),type(BDD.n2),type(BDD.LE),type(BDD.LEM)################
		cutVals = C2_criterion(BDD)
		BDD.n1 = tree.node(-1,-1,[],None,None,[],[])
		BDD.n2 = tree.node(-1,-1,[],None,None,[],[])
		for x in range(0,c1-1):
			if(BDD.data[x][cutVals[1]] <= cutVals[0]):
				BDD.n1.data.append(BDD.data[x])
			else:
				BDD.n2.data.append(BDD.data[x])
				pass
			pass
		BDD.cutval = cutVals[0]
		BDD.dimCutVal = cutVals[1]

		BDD.n1.LE = copy(BDD.LE)
		BDD.n1.LEM = copy(BDD.LEM)
		BDD.n2.LE = copy(BDD.LE)
		BDD.n2.LEM = copy(BDD.LEM)

		#supp de DATA LE et LEM du pere
		BDD.LE = []
		BDD.LEM = []
		BDD.data = []
	else:
		pass
开发者ID:ArtemisMucaj,项目名称:intelligent-adaptive-curiosity,代码行数:27,代码来源:utilities.py


示例2: getMove

def getMove(board, roll):

    validMoves = moveGen.getMoves(board, roll, 1)
    treeRoots = []
    #print validMoves
    for validMove in validMoves:
        root = tree.node()
        root.name = str(validMove)
        root.move = validMove
        newBoard = move(board, validMove[0][0], validMove[0][1], 1)
        newBoard = move(newBoard, validMove[1][0], validMove[1][1], 1)
        root.board = newBoard
        root.roll = roll
        treeRoots.append(root)

# What complete is essentaily the first max level
# So min first then max
# Each level should then consist of a call to the min max function
# Which will min then max
    highest = tree.node()
    for root in treeRoots:
        minMax(root)
        #print root.score
        #print root.name
        if root.score > highest.score:
            highest = root
    return highest.move
开发者ID:absolutezer093,项目名称:backgammon,代码行数:27,代码来源:ai.py


示例3: ProcName

def ProcName(father):
	global lookahead, token_list, node

	PROCNAME = node()
	nt_init(father, PROCNAME, "ProcName", [])

	if match("id"):
		T_ID = node()
		t_init(PROCNAME, T_ID, lookahead[1], [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例4: Top

def Top(father):
	global lookahead, token_list, node

	TOP = node()
	nt_init(father, TOP, "Top", [])

	if match("intc"):
		T_INTC = node()
		t_init(TOP, T_INTC, lookahead[1], [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例5: Low

def Low(father):
	global lookahead, token_list, node

	LOW = node()
	nt_init(father, LOW, "Low", [])

	if match("intc"):
		T_INTC = node()
		t_init(LOW, T_INTC, lookahead[1], [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例6: Invar

def Invar(father):
	global lookahead, token_list, node

	INVAR = node()
	nt_init(father, INVAR, "Invar", [])

	if match("id"):
		T_ID = node()
		t_init(INVAR, T_ID, lookahead[1], [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例7: TypeId

def TypeId(father):
	global lookahead, token_list, node

	TYPEID = node()
	nt_init(father, TYPEID, "TypeId", [])

	if match("id"):
		T_ID = node()
		t_init(TYPEID, T_ID, lookahead[1], [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例8: ReturnStm

def ReturnStm(father):
	global lookahead, token_list, node

	RETURNSTM = node()
	nt_init(father, RETURNSTM, "ReturnStm", [])

	if match("return"):
		T_RETURN = node()
		t_init(RETURNSTM, T_RETURN, "return", [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:9,代码来源:r_d_p.py


示例9: IdList

def IdList(father):
	global lookahead, token_list, node

	IDLIST = node()
	nt_init(father, IDLIST, "IdList", [])

	if match("id"):
		T_ID = node()
		t_init(IDLIST, T_ID, lookahead[1], [])
	IdMore(IDLIST)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例10: ProgramHead

def ProgramHead(father):
	global lookahead, token_list, node

	PROGRAMHEAD = node()
	nt_init(father, PROGRAMHEAD, "ProgramHead", [])

	if match("program"):
		T_PROGRAM = node()
		t_init(PROGRAMHEAD, T_PROGRAM, "program", [])
	ProgramName(PROGRAMHEAD)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例11: VarDec

def VarDec(father):
	global lookahead, token_list, node

	VARDEC = node()
	nt_init(father, VARDEC, "VarDec", [])

	if match("var"):
		T_VAR = node()
		t_init(VARDEC, T_VAR, "var", [])
	VarDecList(VARDEC)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例12: VarIdList

def VarIdList(father):
	global lookahead, token_list, node

	VARIDLIST = node()
	nt_init(father, VARIDLIST, "VarIdList", [])

	if match("id"):
		T_ID = node()
		t_init(VARIDLIST, T_ID, lookahead[1], [])
	VarIdMore(VARIDLIST)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例13: Variable

def Variable(father):
	global lookahead, token_list, node

	VARIABLE = node()
	nt_init(father, VARIABLE, "Variable", [])

	if match("id"):
		T_ID = node()
		t_init(VARIABLE, T_ID, lookahead[1], [])
	VariMore(VARIABLE)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例14: FieldVar

def FieldVar(father):
	global lookahead, token_list, node

	FIELDVAR = node()
	nt_init(father, FIELDVAR, "FieldVar", [])

	if match("id"):
		T_ID = node()
		t_init(FIELDVAR, T_ID, lookahead[1], [])
	FieldVarMore(FIELDVAR)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例15: FormList

def FormList(father):
	global lookahead, token_list, node

	FORMLIST = node()
	nt_init(father, FORMLIST, "FormList", [])

	if match("id"):
		T_ID = node()
		t_init(FORMLIST, T_ID, lookahead[1], [])
	FidMore(FORMLIST)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:10,代码来源:r_d_p.py


示例16: ProcDecMore

def ProcDecMore(father):
	global lookahead, token_list, node

	PROCDECMORE = node()
	nt_init(father, PROCDECMORE, "ProcDecMore", [])

	if lookahead[1] == "procedure":
		ProcDec(PROCDECMORE)
	else:
		T_VOID = node()
		t_init(PROCDECMORE, T_VOID, "ε", [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:11,代码来源:r_d_p.py


示例17: ProcDecpart

def ProcDecpart(father):
	global lookahead, token_list, node

	PROCDECPART = node()
	nt_init(father, PROCDECPART, "ProcDecpart", [])

	if lookahead[1] == "procedure":
		ProcDec(PROCDECPART)
	else:
		T_VOID = node()
		t_init(PROCDECPART, T_VOID, "ε", [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:11,代码来源:r_d_p.py


示例18: VarDecPart

def VarDecPart(father):
	global lookahead, token_list, node

	VARDECPART = node()
	nt_init(father, VARDECPART, "VarDecPart", [])

	if lookahead[1] == "var":
		VarDec(VARDECPART)
	else:
		T_VOID = node()
		t_init(VARDECPART, T_VOID, "ε", [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:11,代码来源:r_d_p.py


示例19: TypeDecMore

def TypeDecMore(father):
	global lookahead, token_list, node

	TYPEDECMORE = node()
	nt_init(father, TYPEDECMORE, "TypeDecMore", [])

	if lookahead[2] == "id":
		TypeDecList(TYPEDECMORE)
	else:
		T_VOID = node()
		t_init(TYPEDECMORE, T_VOID, "ε", [])
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:11,代码来源:r_d_p.py


示例20: AssignmentRest

def AssignmentRest(father):
	global lookahead, token_list, node

	ASSIGNMENTREST = node()
	nt_init(father, ASSIGNMENTREST, "AssignmentRest", [])

	VariMore(ASSIGNMENTREST)
	if match(":="):
		T_ASSIGNMENT = node()
		t_init(ASSIGNMENTREST, T_ASSIGNMENT, ":=", [])
	Exp(ASSIGNMENTREST)
开发者ID:YoungLeeNENU,项目名称:SNL-compiler-frontend,代码行数:11,代码来源:r_d_p.py



注:本文中的tree.node函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tree.tree函数代码示例发布时间:2022-05-27
下一篇:
Python tree.loadWordMap函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap