def preproccessing(locator, total_demand, building_names, weather_file, gv):

    # read weather and calculate ground temperature
    T_ambient = epwreader.epw_reader(weather_file)['drybulb_C']
    gv.ground_temperature = geothermal.calc_ground_temperature(T_ambient.values, gv)

    print "Run substation model for each building separately"
    subsM.subsMain(locator, total_demand, building_names, gv, Flag = True) # 1 if disconected buildings are calculated

    print "Heating operation pattern for disconnected buildings"
    dbM.discBuildOp(locator, building_names, gv)

    print "Create network file with all buildings connected"
    nM.Network_Summary(locator, total_demand, building_names, gv, "all") #"_all" key for all buildings

    print "Solar features extraction"
    solarFeat = sFn.solarRead(locator, gv)

    print "electricity"
    elecCosts, elecCO2, elecPrim = electricity.calc_pareto_electricity(locator, gv)

    print "Process Heat "
    hpCosts, hpCO2, hpPrim = hpMain.calc_pareto_Qhp(locator, total_demand, gv)

    extraCosts = elecCosts + hpCosts
    extraCO2 = elecCO2 + hpCO2
    extraPrim = elecPrim + hpPrim

    return extraCosts, extraCO2, extraPrim, solarFeat
예제 #2
0
def preproccessing(locator, total_demand, building_names, weather_file, gv):

    # read weather and calculate ground temperature
    T_ambient = epwreader.epw_reader(weather_file)['drybulb_C']
    gv.ground_temperature = geothermal.calc_ground_temperature(
        T_ambient.values, gv)

    print "Run substation model for each building separately"
    subsM.subsMain(locator, total_demand, building_names, gv,
                   Flag=True)  # 1 if disconected buildings are calculated

    print "Heating operation pattern for disconnected buildings"
    dbM.discBuildOp(locator, building_names, gv)

    print "Create network file with all buildings connected"
    nM.Network_Summary(locator, total_demand, building_names, gv,
                       "all")  #"_all" key for all buildings

    print "Solar features extraction"
    solarFeat = sFn.solarRead(locator, gv)

    print "electricity"
    elecCosts, elecCO2, elecPrim = electricity.calc_pareto_electricity(
        locator, gv)

    print "Process Heat "
    hpCosts, hpCO2, hpPrim = hpMain.calc_pareto_Qhp(locator, total_demand, gv)

    extraCosts = elecCosts + hpCosts
    extraCO2 = elecCO2 + hpCO2
    extraPrim = elecPrim + hpPrim

    return extraCosts, extraCO2, extraPrim, solarFeat
예제 #3
0
def checkNtw(individual, ntwList, locator, gv):
    """
    Calls the network routine if necessary
    
    Parameters
    ----------
    individual : list
        configuration considered
    ntwList : list
        list of DHN configuration previously encountered in the EA
    locator : string
        path to folders
    
    """
    indCombi = sFn.readCombi(individual, gv)
    print(indCombi)

    if not (indCombi in ntwList) and indCombi.count("1") > 0:
        ntwList.append(indCombi)

        if indCombi.count("1") == 1:
            total_demand = pd.read_csv(locator.pathNtwRes + "//" + "Total_" +
                                       indCombi + ".csv")
            building_names = total_demand.Name.values
            print "Direct launch of network summary routine for", indCombi
            nM.Network_Summary(locator, total_demand, building_names, gv,
                               indCombi)

        else:
            total_demand = sFn.createTotalNtwCsv(indCombi, locator)
            building_names = total_demand.Name.values

            # Run the substation and network routines
            print "Re-run the substation routine for new network configuration", indCombi
            sMain.subsMain(locator, total_demand, building_names, gv, indCombi)

            print "Launch network summary routine"
            nM.Network_Summary(locator, total_demand, building_names, gv,
                               indCombi)
def checkNtw(individual, ntwList, locator, gv):
    """
    Calls the network routine if necessary
    
    Parameters
    ----------
    individual : list
        configuration considered
    ntwList : list
        list of DHN configuration previously encountered in the EA
    locator : string
        path to folders
    
    """
    indCombi = sFn.readCombi(individual, gv)
    print(indCombi)
    
    if not (indCombi in ntwList) and indCombi.count("1") > 0:
        ntwList.append(indCombi)
        
        if indCombi.count("1") == 1:
            total_demand = pd.read_csv(locator.pathNtwRes + "//" +  "Total_" + indCombi + ".csv")
            building_names = total_demand.Name.values
            print "Direct launch of network summary routine for", indCombi
            nM.Network_Summary(locator, total_demand, building_names, gv, indCombi)

        else:
            total_demand = sFn.createTotalNtwCsv(indCombi, locator)
            building_names = total_demand.Name.values

            # Run the substation and network routines
            print "Re-run the substation routine for new network configuration", indCombi
            sMain.subsMain(locator, total_demand, building_names, gv, indCombi)
            
            print "Launch network summary routine"
            nM.Network_Summary(locator, total_demand, building_names, gv, indCombi)