示例#1
0
# 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()
示例#2
0
folder = '/Dropbox/Model/results/chapter7/'
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 '============================================================'
示例#3
0
for scen in scenarios:
    para.set_property_rights(scenario=scen)
    mod = Model(para)

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

    del mod

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

with open(home + folder + 'notrade_result.pkl', 'wb') as f:
    pickle.dump(results, f)
    f.close()
"""
"""
#==========================================
# Risk aversion
#==========================================

para.central_case(utility=True, risk=3)

for scen in scenarios:
    para.set_property_rights(scenario=scen)
    mod = Model(para)

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

    del mod

chapter6.tables(results, scenarios, Lambda, LambdaK, label='risk1', risk=True)
示例#4
0
folder = '/Dropbox/Model/results/chapter7/'
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 '============================================================'
示例#5
0
import numpy as np
from para import Para
from model import Model
from results import chapter3
import pickle

# Store results here

home = '/home/nealbob'
folder = '/Dropbox/Model/results/chapter3/'
NCI = '/short/fr3/ndh401/chapter3/'

# Initialise parameters

para = Para(rebuild=True, charts=False)
para.central_case(N=100, printp=False)
para.set_property_rights(scenario='CS')
para.solve_para()
para.SDP_GRID = 40

# Create model instance

mod = Model(para)

# Model runs

result = {'paras' : [], 'stats' : [], 'series' : []}
#temp = [0,0]

for i in range(1000):
    try:
示例#6
0
for scen in scenarios:
    para.set_property_rights(scenario=scen)
    mod = Model(para)

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

    del mod

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

with open(home + folder + 'notrade_result.pkl', 'wb') as f:
    pickle.dump(results, f)
    f.close()
"""
"""
#==========================================
# Risk aversion
#==========================================

para.central_case(utility=True, risk=3)

for scen in scenarios:
    para.set_property_rights(scenario=scen)
    mod = Model(para)

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

    del mod

chapter6.tables(results, scenarios, Lambda, LambdaK, label='risk1', risk=True)