search.py 文件源码

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

项目:robocup-soccer 作者: kengz 项目源码 文件源码
def simulated_annealing(problem, schedule=exp_schedule()):
    "[Fig. 4.5]"
    current = Node(problem.initial)
    for t in xrange(sys.maxint):
        T = schedule(t)
        if T == 0:
            return current
        next = random.choice(expand(node. problem))
        delta_e = next.path_cost - current.path_cost
        if delta_e > 0 or probability(math.exp(delta_e/T)):
            current = next
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号