airac = 334 starting_date=[2010,5,6] n_days=1 cut_alt=240. mode='navpoints' data_version=None n_iter = 10 # Does not control anything (TODO: change when interface with abm_tactical allows to control parameters) n_M1_trajs = 100 main_dir = os.path.abspath(__file__) main_dir = os.path.split(os.path.dirname(main_dir))[0] dontdo = ['EGCC', 'EGPX'] for country in ['LI']:#, 'EB', 'LI']: paras = paras_strategic(zone=country, airac=airac, starting_date=starting_date, n_days=n_days, cut_alt=cut_alt,\ mode=mode, data_version=data_version) db=_mysql.connect("localhost","root", paras['password_db'], "ElsaDB_A" + str(airac), conv=my_conv) db.query("""SELECT accName FROM ACCBoundary WHERE accName LIKE '""" + country + """%'""") r=db.store_result() rr=[rrr[0] for rrr in r.fetch_row(maxrows=0, how=0)] db.close() for zone in rr: if not zone in dontdo: print "==============================================" print " Running abm: tactical for zone:", zone print "==============================================" with open('../libs/All_shapes_334.pic','r') as f: all_shapes = pickle.load(f)
for country in ['LIRR']: # paras = paras_strategic(zone=country, airac=airac, starting_date=starting_date, n_days=n_days, cut_alt=cut_alt,\ # mode=mode, data_version=data_version) # db=_mysql.connect("localhost","root", paras['password_db'], "ElsaDB_A" + str(airac), conv=my_conv) # db.query("""SELECT accName FROM ACCBoundary WHERE accName LIKE '""" + country + """%'""") # r=db.store_result() # rr=[rrr[0] for rrr in r.fetch_row(maxrows=0,how=0)] # db.close() for ACtot in [100, 500, 1000, 1500, 2000, 2500, 3000, 4000]: print "==============================================" print " Generating traffic for ACtot:", ACtot print "==============================================" paras_nav = paras_strategic(zone=country, mode='navpoints', data_version=data_version) #TODO name_G = name_net(paras_nav, data_version) try: G = network_whose_name_is(result_dir + '/networks/' + name_G) except IOError: print "Could not load the network, I skip it." print continue with open('../libs/All_shapes_334.pic','r') as f: all_shapes = pickle.load(f) boundary = list(all_shapes[country]['boundary'][0].exterior.coords) assert boundary[0]==boundary[-1] with open(result_dir + '/trajectories/bounds/' + G.name + '_bound_latlon.dat', 'w') as f: for x, y in boundary: