Exemplo n.º 1
0
def RLCSimulation(folderName, inputType, unit, approachName, houseNumber, randomFlag):
    '''
    This method used to construct yaml file and construct the RLC result based on random.
        str, str, int, str, [int, int, ...] => file
    '''
    
    # read CSV input files
    Result = ReadCSV(folderName, inputType)
    requests = list(Result[0])
    
    ideal_type_load = modify_ideal_load(Result[1][-1], unit)
    
    # write load profile files
    getLoadProfileFiles(folderName, unit)
        
    # get house layout and zip_loads
    houseLayout = yamlCalcMethods.getHouseLayout(houseNumber, requests)
    S_ZipList = yamlCalcMethods.getSZipList(len(houseLayout))
    lengthMvList = yamlCalcMethods.getLengthMvList(len(houseLayout))
    
    # get the load, which not perform RLC approach
    original_loads = getOriginalObservedLoad(Result, unit, approachName)
    
    # get the relationship between request name, and its last minute number
    requestNameMinMap = yamlCalcMethods.getRequestNameMinMap(requests) # get the requestNameMinMap
    
    # write yaml file, and return RLC result
    random_observed_loads = writeYamlFileAndReturnRandomProbabilities(Result, houseNumber, requests, unit, folderName, approachName, houseLayout, requestNameMinMap, S_ZipList, lengthMvList)
    
    # write the csv file which save original and RLC loads
    write_output(ideal_type_load, original_loads, random_observed_loads, folderName, inputType, randomFlag)
    
    print 'FINISH Random Output'
Exemplo n.º 2
0
def main():
    
    ## input information
    folder_name = 'Experiment2_1'
    input_type = 'ideal_shiftable_load'
    unit = 5
    approach_name = 'profile_load'
    random_flag = True
    
    Result = ReadCSV(folder_name, input_type) # read requests information from input csv file
    requests = Result[0]
    ideal_type_load = modify_ideal_load(Result[1][-1], unit)

    initialResult = initialSituation(ideal_type_load, requests, unit, approach_name)
    original_observed_load = initialResult[1] # get the observed load without random approach
    original_loads = [original_observed_load]
    random_observed_load = calcRandLoad(Result, unit, approach_name) # get observed load
    
    ## get output relative parameters
    random_observed_loads = [random_observed_load] 
    
    write_output(ideal_type_load, original_loads, random_observed_loads, folder_name, input_type, random_flag) # output results
    
    print 'Job Done.'