def disconnected_building_main(locator, total_demand, config, prices, lca):
    """
    This functions optimizes disconnected buildings individually

    :param locator: locator class
    :type locator: class
    :return: elecCosts, elecCO2, elecPrim
    :rtype: tuple
    """

    # local variables
    buildings_name_with_heating = get_building_names_with_load(total_demand, load_name='QH_sys_MWhyr')
    buildings_name_with_space_heating = get_building_names_with_load(total_demand, load_name='Qhs_sys_MWhyr')
    buildings_name_with_cooling = get_building_names_with_load(total_demand, load_name='QC_sys_MWhyr')

    if buildings_name_with_heating and buildings_name_with_space_heating:
        decentralized_buildings_heating.disconnected_buildings_heating_main(locator, total_demand,
                                                                            buildings_name_with_heating,
                                                                            config, prices, lca)

    if buildings_name_with_cooling:
        decentralized_buildings_cooling.disconnected_buildings_cooling_main(locator,
                                                                            buildings_name_with_cooling,
                                                                            total_demand,
                                                                            config, prices, lca)
    print("done.")
Example #2
0
def disconnected_building_main(locator, building_names, config, prices, lca):
    """
    This function computes the parameters for the electrical demand contributing to the pareto optimal alternatives.
    in the future, this aspect should be included in the optimization itself.

    :param locator: locator class
    :param gv: global variables class
    :type locator: class
    :type gv: class
    :return: elecCosts, elecCO2, elecPrim
    :rtype: tuple
    """
    if config.region == 'SIN':
        decentralized_buildings_cooling.disconnected_buildings_cooling_main(
            locator, building_names, config, prices, lca)
    elif config.region == 'CH':
        decentralized_buildings_heating.disconnected_buildings_heating_main(
            locator, building_names, config, prices, lca)
    else:
        raise ValueError("the region is not specified correctly")

    print "Run decentralized model for buildings"
def disconnected_building_main(locator, building_names, config, prices, lca):
    """
    This function computes the parameters for the electrical demand contributing to the pareto optimal alternatives.
    in the future, this aspect should be included in the optimization itself.

    :param locator: locator class
    :param gv: global variables class
    :type locator: class
    :type gv: class
    :return: elecCosts, elecCO2, elecPrim
    :rtype: tuple
    """
    controls = pd.read_excel(locator.get_archetypes_system_controls(config.region))
    if controls['has-cooling-season'].item() or controls['has-heating-season'].item():
        if controls['has-cooling-season'].item():
            decentralized_buildings_cooling.disconnected_buildings_cooling_main(locator, building_names, config, prices, lca)
        if controls['has-heating-season'].item():
            decentralized_buildings_heating.disconnected_buildings_heating_main(locator, building_names, config, prices, lca)
    else:
        raise ValueError("The case study has neither a heating nor a cooling season, please specify in system_controls.xlsx")

    print "Run decentralized model for buildings"