本文整理汇总了Python中Graph.process_meta方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.process_meta方法的具体用法?Python Graph.process_meta怎么用?Python Graph.process_meta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.process_meta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Graph [as 别名]
# 或者: from Graph import process_meta [as 别名]
#.........这里部分代码省略.........
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
while G.out == 'True':
rsp=raw_input("Please enter a result ex. p1 (-g) (a:f,a:d,-d:j) >>> ")
if rsp=='next':
break
elif rsp=='':
continue
elif rsp=='display':
inp1= "p1 "+ str(G.G1.nodes())+" "+str(G.G1.edges())
inp2= "p2 "+ str(G.G2.nodes())+" "+str(G.G2.edges())
inp3= "p3 "+ str(G.G3.nodes())+" "+str(G.G3.edges())
inp4= "p4 "+ str(G.G4.nodes())+" "+ str(G.G4.edges())
print inp1
print inp2
print inp3
print inp4
elif rsp=='scores':
try:
G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)
except G.nx.NetworkXError:
print "issue with one of the graphs. Likely one is disconnected."
elif rsp[0]=='w':
if rsp == 'w1':
G.w1+=.05
if rsp == 'w2':
G.w2+=.05
if rsp == 'w3':
G.w3+=.05
if rsp == 'w4':
G.w4+=.05
elif rsp[0]=='p':
try:
cl=G.process_meta(rsp)
#print avail
#print cl
tagged=[]
for x in cl:
if x not in avail:
tagged.append(x)
for x in tagged:
cl.remove(x)
for e in range(len(cl)):
if len(imgs)>0:
ind=avail.index(cl[e])
avail[ind]=imgs.pop(0)
im = pygame.image.load(data_dir+"/"+avail[ind])
x=50+ind*300
background.blit(im,(x,10))
screen.blit(background, (0, 0))
pygame.display.flip()
except:
print "Invalid input, please try again."
else:
print "Invalid input, please try again."
elif i == 14:
writer("Boston Invite!!",(520,420))
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[0],(520,440),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
elif i == 29:
writer("Elite-Select Challenge!!",(520,420))
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[0],(520,440),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
elif i == 44:
writer("Top Select!!",(520,420))
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[0],(520,440),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
elif i == 49:
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[0],(520,440),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
else:
writer("Practice!!",(520,420))
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[0],(520,440),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[1],(520,460),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[2],(520,480),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[3],(520,500),False)
writer(G.algorithm(G.w1,G.w2,G.w3,G.w4,G.G1,G.G2,G.G3,G.G4)[4],(520,520),False)
break
pygame.quit()