【发布时间】:2013-11-30 14:33:23
【问题描述】:
我有这个代码:
for times in range(50):
factor = (min(getHeight(),getWidth()) / math.sqrt(qtdPosicoes)) * guess()
positionInGrid = {}
grid = np.zeros((getGridColumns(),getGridLines()))
groupMatrix = np.zeros((grid.shape[0], grid.shape[1]))
groups = getGroups(grid, listaComPosicoes, getXRanges(listaComPosicoes),getYRanges(listaComPosicoes))
solution = calculaSilhueta()
if bestSolution is None or solution > bestSolution:
bestSolution = solution
我在文档时间模块中找到但我不明白如何使用
【问题讨论】:
-
将上面的内容放在一个函数中(没有循环),然后查看
timeit模块为你做计时/重复。 -
@JonClements,谢谢!
标签: python