Visualizations.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:GoodEnoughAlgs 作者: elsander 项目源码 文件源码
def LongMC3(fname=None):
    '''Plot a single long MC3 run to demonstrate high performance
    but slow convergence.'''
    if fname:
        run = scipy.genfromtxt(fname)
    else:
        bestSol, run = tsp.TSP(200, 'MC3', 20000, 10, seed=None,
                               coordfile='tmp.txt')
        fname = 'ExampleOutput/MC3-Long.txt'
        run = scipy.array(run)
        scipy.savetxt(fname, run)

    # plotting
    Xs = range(0, run.shape[0] * 1000, 1000)
    pl.plot(Xs, run)
    pl.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号