out = '/Dropbox/Thesis/IMG/chapter7/' NCIhome = '/short/fr3/ndh401' NCIfolder = '/chapter7/' #========================================== # NCI general case - initialisation #========================================== try: arg1 = sys.argv[1] except IndexError: print "Provide arguments <runnum> <numofjobs> <scenario>" para = Para() para.central_case(N = 100) para.randomize() para.set_property_rights(scenario='CS') run_no = int(arg1) print '============================================================' print 'Initialisation for run no: ' + str(run_no) print '============================================================' mod = Model(para, ch7=True, turn_off_env=True) E_lambda = mod.chapter7_initialise() print '============================================================' print 'E_lambda: ' + str(E_lambda) print '============================================================' para.E_lambda_hat = E_lambda
out = '/Dropbox/Thesis/IMG/chapter7/' NCIhome = '/short/fr3/ndh401' NCIfolder = '/chapter7/' #========================================== # NCI general case - initialisation #========================================== try: arg1 = sys.argv[1] except IndexError: print "Provide arguments <runnum> <numofjobs> <scenario>" para = Para() para.central_case(N=100) para.randomize() para.set_property_rights(scenario='CS') run_no = int(arg1) print '============================================================' print 'Initialisation for run no: ' + str(run_no) print '============================================================' mod = Model(para, ch7=True, turn_off_env=True) E_lambda = mod.chapter7_initialise() print '============================================================' print 'E_lambda: ' + str(E_lambda) print '============================================================' para.E_lambda_hat = E_lambda
mod.simulate_myopic(500000) result['stats'].append(mod.sim.stats) result['paras'].append(para.para_list) #result['series'].append(mod.sim.series) #mod2 = Model(para) #mod2.simulate_myopic(500000) #temp[1] = mod2.sim.series #result['series'].append(temp) if i == 0: W_f = mod.sdp.W_f V_f = mod.sdp.V_f SW_f = mod.users.SW_f para.SDP_GRID = 35 para.randomize(N = 100) mod = Model(para) except KeyboardInterrupt: raise except: raise with open(NCI + 'result.pkl', 'wb') as f: pickle.dump(result, f) f.close() #chapter3.build(results)