随笔分类 -  Project 2:Grid

Pudure Python Project 2:Grid
摘要:关于该部分的项目描述请见Project2 Percolation in Grids 网格渗透 测试的场景要求如下:· set n=75 · consider values of p from 0 to 1 in increments of 0.05 (or smaller) · for each value of p, generate 10 random grids and record for each algorithm the average running time on the ten grids 可是我在编写该部分的测试代码时,遇到了些麻烦,一开始还 阅读全文
posted @ 2011-08-10 14:22 牛皮糖NewPtone 阅读(402) 评论(0) 推荐(0) 编辑
摘要:此实验来自于part1中的具体要求:Next, consider grid sizes n = 10, 25, 50, and 75 and determine the percolation probabilities (you already know it for n=25). One way to visualize the performance for the different values of n is to make the same curve as above and show all three in one plot. Discuss how the size o. 阅读全文
posted @ 2011-08-10 13:28 牛皮糖NewPtone 阅读(815) 评论(0) 推荐(0) 编辑
摘要:迷茫童鞋的阅读指南该项目的详细描述和算法的具体说明请参见前一篇 Project2 Percolation in Grids 网格渗透本人给出了percolation_provided.py的函数说明目前已完成水波探测算法的实现 该算法的关键是实现explore函数中递归,及percolation_recursive对explore的初始调用。Step1: 国际惯例导入提供的函数:from percolation_provided import * 先考虑percolation_recursive函数,参数和前面的水波算法函数一样,定义为:percolation_recursive(input. 阅读全文
posted @ 2011-08-09 22:13 牛皮糖NewPtone 阅读(531) 评论(0) 推荐(0) 编辑
摘要:本文中,我们将使用前面已经实现的水波渗透算法来测定对于固定大小的网格,在不同开放概率p下发生渗透的概率。关于该部分的具体说明如下:How many trials are needed to make a prediction on whether a grid generated with probability p percolates? How many different values of p should be considered to determine the percolation probability q? 需要做多少次实验才能确定一个按概率p产生的网格是否渗透? 需要考 阅读全文
posted @ 2011-08-08 14:09 牛皮糖NewPtone 阅读(619) 评论(0) 推荐(0) 编辑
摘要:水波探测算法的实现 迷茫童鞋的阅读指南该项目的详细描述和算法的具体说明请参见前一篇 Project2 Percolation in Grids 网格渗透本人也给出了percolation_provided.py的函数说明 俗话说得好:凡事说起来容易,做起来难。 博主没有谨慎思考打开IDE就是一顿乱敲,然后就是不停地修复各种BUG。下面谈谈该算法的实现以及遇到的问题和解决办法:Step1: 国际惯例导入提供的函数:from percolation_provided import * 再敲定函数名:percolation_wave(input_grid)。名字取好了就可以开始干活了,参数先暂定一个 阅读全文
posted @ 2011-08-07 23:10 牛皮糖NewPtone 阅读(736) 评论(0) 推荐(0) 编辑
摘要:Updated 1st:2011.8.7 Project2:解读percolation_provided这里咱们开始解读项目2中提供的percolation_provided.py,一共提供了4个函数,分别为:printgrid(grid): prints the grid represented by the nested list, one row per line (this module may be helpful in testing and debugging your code) printgrid(grid):输出用嵌套列表表示的网络,每排代表一行(这一模型可能对测试和调试你 阅读全文
posted @ 2011-04-26 00:18 牛皮糖NewPtone 阅读(376) 评论(0) 推荐(0) 编辑
摘要:Updated log 1st 2011.8.7 a big project! Project2PercolationinGrids网格渗透Introduction 介绍Imagine a landscape filled with patches of dry grass. A fire has started at one end and it jumps from one patch to another. What is the probability that the fire manages to cross the entire area? Imagine a system co 阅读全文
posted @ 2011-04-19 17:35 牛皮糖NewPtone 阅读(1011) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示