示例#1
0
# number of samples for training and testing meta-models
#number of samples in each climate zone = num_sample * number of sensitive model inputs
num_sample = 6
# parameters' library
# list the entire sets of some inputs
###############################################################################
# 0.change the idf file to 15 minute format
import scheduleChange as schedule

## 0.1.get schedule information(15 min intervel) exclude design day schedule
for cz in climate:
    schedule.schedule('./sourceFolder/' + cz + '.idf', cz)
## 0.2.change the schedule to 15min interval
for cz in climate:
    schedule.modify('./sourceFolder/' + cz + '.idf',
                    './results/scheduleInformation/' + cz + 'schedule.csv', cz)

######################################################################################
#1.sampleing: get different value of model input (LHM)
import sampleMeta as samp
for cz in climate:
    data_set, param_values = samp.sampleMeta(num_sample, cz)
    # data_set contains variables name, min value, max value in climate zone cz
    #param_values is the sample which contain the vaiables' value

    ## record the data in the folder './results/samples'
    ## store the information of data_set
    with open('./results/samples/data_set.csv', 'wb') as csvfile:
        for row in data_set:
            data = csv.writer(csvfile, delimiter=',')
            data.writerow(row)
示例#2
0
y_best_post = [40.60,40.60,39.72,41.48,39.72,36.19,45.01,40.60,41.48,47.66,43.25,52.96,47.66,56.49,75.02]
y_best_pre = [44.16,44.16,43.20,45.12,43.20,39.36,48.96,44.16,45.12,51.84,47.04,57.60,51.84,61.44,81.61]
# number of samples 
num_sample = 4
pathway = os.getcwd()

###############################################################################
# 0.change the idf file to 15 minute format
import scheduleChange as schedule
os.chdir(pathway)
## 0.1.get schedule information(15 min intervel) exclude design day schedule
schedule.schedule ('./sourceFolder_pre/1A.idf','pre')
schedule.schedule ('./sourceFolder_post/1A.idf','post')
## 0.2.change the schedule to 15min interval    
for cz in climate:
    schedule.modify('./sourceFolder_pre/'+cz+'.idf','./results/scheduleInformation/pre_schedule.csv',cz,'pre')
    schedule.modify('./sourceFolder_post/'+cz+'.idf','./results/scheduleInformation/post_schedule.csv',cz,'post')

######################################################################################
#1.sampleing: get different value of model input (LHM)

import sampleMeta as samp
os.chdir(pathway)

data_set,param_values = samp.sampleMeta(num_sample,'1A','pre') 
with open('./results/samples/data_set.csv', 'wb') as csvfile:
    for row in data_set:
        data = csv.writer(csvfile, delimiter=',')
        data.writerow(row)   
## store the information of param_values
with open('./results/samples/param_values.csv', 'wb') as csvfile: