Ejemplo n.º 1
0
    def __init__(self, json_data, loads_path, output_path, print_output=True):
        """
        Constructor for the class.
        """

        PrintClass(print_output, output_path)

        # init base class
        BaseGHXClass.__init__(self, json_data, loads_path, output_path,
                              print_output)

        errors_found = False

        try:
            self.min_hourly_history = json_data['Simulation Configuration'][
                'Min Hourly History']
        except:  # pragma: no cover
            PrintClass.my_print("....'Min Hourly History' key not found",
                                'warn')
            errors_found = True

        try:
            self.agg_load_intervals = json_data['Simulation Configuration'][
                'Intervals']
        except:  # pragma: no cover
            PrintClass.my_print("....'Intervals' key not found", 'warn')
            errors_found = True

        if not errors_found:
            # success
            PrintClass.my_print("Simulation successfully initialized")
        else:  # pragma: no cover
            PrintClass.fatal_error(
                message="Error initializing GHXArrayFixedAggBlocks")

        # class data

        # set load aggregation intervals
        self.set_load_aggregation()

        # set first aggregated load, which is zero. Need this for later
        self.agg_load_objects.append(AggregatedLoadFixed([0], 0, 1, True))

        self.g_func_hourly = deque()
        self.hourly_loads = deque()
Ejemplo n.º 2
0
    def __init__(self,
                 ghx_input_json_path,
                 loads_path,
                 output_path,
                 print_output=True):
        """
        Class constructor
        """

        PrintClass(print_output, output_path)
        ConstantClass()

        self.timer_start = timeit.default_timer()

        self.ghx_input_json_path = ghx_input_json_path
        self.json_data = None
        self.loads_path = loads_path
        self.output_path = output_path
        self.print_output = print_output

        self.aggregation_type = ''

        self.get_sim_config(self.ghx_input_json_path)