def main():
    A=perc.make_sites(0.6,25)
    perc.write_grid('sites.txt',A)
    B=perc.read_grid('sites.txt')
    C=perc.flow(B)
    if perc.percolates(C):
        print('percolates')
    else:
        print('does not percolate')
def main():
    site_matrix=perc.make_sites(25,0.45)
    perc.write_grid('sites.txt',site_matrix)
    sites_read=perc.read_grid('sites.txt')
    sites_flow=perc.vertical_flow(sites_read)
    if perc.percolates(sites_flow):
        print('percolates')
    else:
        print('does not percolate')
Example #3
0
def main():
    A=perc.make_sites(25,0.45)
    perc.write_grid('sites.txt',A)
    infile=open('sites.txt','r')
    B=perc.read_grid(infile)
    C=perc.flow(B)
    if perc.percolates(C):
        print('percolates')
    else:
        print('does not percolate')
Example #4
0
def main():
    """Test Percolation Vertical."""
    A = perc.make_sites(25, 0.45)
    perc.write_grid('sites.txt', A)
    infile = open('sites.txt', 'r')
    B = perc.read_grid(infile)
    C = perc.flow(B)
    if perc.percolates(C):
        print('percolates')
    else:
        print('does not percolate')
def main():
    A = perc.make_sites(25, 0.65)
    perc.write_grid('test.txt', A)
    infile = open('test.txt', 'r')
    B = perc.read_grid(infile)
    C = perc.flow(B)
    if perc.percolates(C):
        print('percolates')
    else:
        print('does not percolate')

    perc.plot(B, C)
Example #6
0
def main():
    """Test Percolation Vertical."""
    A = perc.make_sites(25, 0.45)
    perc.write_grid('sites.txt', A)
    infile = open('sites.txt', 'r')
    B = perc.read_grid(infile)
    infile.close()
    C = perc.flow(B)
    if perc.percolates(C):
        print('percolates')
    else:
        print('does not percolate')