コード例 #1
0
# Decentralised water storage model: master file - Neal Hughes

# Model testing

from __future__ import division
import numpy as np
from para import Para
import model
import time
from econlearn.samplegrid import test
import pylab

if __name__ == '__main__':

    para = Para(rebuild=True)
    para.set_property_rights(scenario='RS')

    para.ch7['inflow_share'] = 0
    para.ch7['capacity_share'] = 0

    mod = model.Model(para, ch7=True, turn_off_env=True)
    #mod.plannerQV_ch7(T=125000, stage2=True, d=0.2, simulate=True, envoff=True)
    #print mod.sim.ITEROLD
    #stats_envoff = mod.sim.stats
    #series_envoff = mod.sim.series

    #del mod
    #mod = model.Model(para, ch7=True, turn_off_env=False)
    #mod.plannerQV_ch7(T=125000, stage2=True, d=0.2, simulate=True, envoff=False)
    #print mod.sim.ITEROLD
    #stats = mod.sim.stats
コード例 #2
0
NCI = '/short/fr3/ndh401/chapter6/'
out = '/Dropbox/Thesis/IMG/chapter6/'

para = Para()

scenarios = ['CS'] #['RS-HL-O', 'RS-HL', 'RS-O', 'RS', 'CS', 'CS-O', 'CS-HL', 'CS-HL-O', 'CS-U']
results = {scen: 0 for scen in scenarios}
Lambda = {scen: 0 for scen in scenarios}
LambdaK = {scen: 0 for scen in scenarios}

#==========================================
# Central case (with trade)
#==========================================

for scen in scenarios:
    para.set_property_rights(scenario=scen)
    para.aproximate_shares(nonoise=True)

    mod = Model(para)

    results[scen], Lambda[scen], LambdaK[scen] = mod.chapter6(sens=True)
        
    del mod


#chapter6.tables(results, scenarios, Lambda, LambdaK, label='central')

#with open(home + folder + 'central_result.pkl', 'wb') as f:
#    pickle.dump(results, f)
#    f.close()
コード例 #3
0
ファイル: chapter5.py プロジェクト: nealbob/regrivermod
# Decentralised water storage model: master file - Neal Hughes

# Chapter 5 model runs

from __future__ import division
import numpy as np
from para import Para
import model
import pickle

para = Para()
para.central_case(N=100, printp=False)
para.set_property_rights(scenario='OA')
para.solve_para()

home = '/home/nealbob'
folder = '/Dropbox/Model/results/chapter5/'

scenarios = ['CS', 'SWA', 'OA', 'NS', 'CS-SL', 'SWA-SL', 'CS-SWA']
results = {scen: 0 for scen in scenarios}
policies = {scen: 0 for scen in scenarios}

for i in range(1):
    #try:

    para.central_case(N = 100)
    para.t_cost = 100000000000
    para.aproximate_shares(nonoise=True)
    #if i > 0:
    #    para.randomize(N = 100)
    #    para.aproximate_shares()
コード例 #4
0
ファイル: chapter7_init.py プロジェクト: nealbob/regrivermod
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