Пример #1
0
fout.write('d = ' + str(datetime.date.today()))
fout.close()

### Main Function

r = Graph()

if init_fname == "":
    r.init_rectgrid(model_size, include_corners=False, wrap=False, cellsize=1)
    if block_size.a == 0:
        init_r = 30 * [0]
        init_r[0] = 1
        r.init_rvals([init_r, [-1], [0]])
    else:
        r.init_block(model_size=model_size,
                     block_size=block_size,
                     no_vals=param[10],
                     increment=param[11])
    r.to_csv(f_name, path)
else:
    #    r.init_ppm(init_fname,base_path+'\\maps\\',color_dict)
    r.from_csv(init_fname, base_path)

p = r.parcel_list()

footprint = r.parcel_fp(p[0], len(state_dict))
floor_area = r.parcel_flr(p[0], len(state_dict))
if out_fname != "":
    r.to_csv(out_fname, base_path)

t = History(r)
t.set_dict(color_dict, state_dict)
Пример #2
0
### Main Function
## make it a loop
for i in range(0,param[29]-1):
    s = i*((param[29])-1.0)
    print

    r = Graph()

    if init_fname == "":
        r.init_rectgrid(model_size,include_corners=False,wrap=False,cellsize=1)
        if block_size.a == 0:
            init_r = 30 * [0]
            init_r[0] = 1
            r.init_rvals([init_r,[-1],[0]])
        else:
            r.init_block(model_size=model_size,block_size=block_size, no_vals = param[10], increment = param[11])
        r.to_csv(f_name,path)
    else:
    #    r.init_ppm(init_fname,base_path+'\\maps\\',color_dict)
        r.from_csv(init_fname,base_path)

    p = r.parcel_list()

    footprint = r.parcel_fp(p[0], len(state_dict))
    floor_area = r.parcel_flr(p[0], len(state_dict))
    if out_fname != "":
        r.to_csv(out_fname,base_path)


    t= History(r)
    t.set_dict(color_dict,state_dict)
Пример #3
0
        fout.write(line)
fout.write('d = '+str(datetime.date.today()))
fout.close()

### Main Function

r = Graph()

if init_fname == "":
    r.init_rectgrid(model_size,include_corners=False,wrap=False,cellsize=1)
    if block_size.a == 0:
        init_r = 30 * [0]
        init_r[0] = 1
        r.init_rvals([init_r,[-1],[0]])
    else:
        r.init_block(model_size,block_size, param[0])
    r.to_csv(f_name,path)
else:
    r.init_ppm(init_fname,base_path+'\\maps\\',color_dict)
#    r.from_csv(init_fname,base_path)

if out_fname != "":
    r.to_csv(out_fname,base_path)


t= History(r)

t.set_rule(base_path+'\\rules\\'+rule_fname)
t.set_vis(base_path+'\\rules\\'+vis_fname)
t.set_params(param)