multi_run_period¶
-
multi_run_period.
merge_hubs
(hubs)[source]¶ Compiles and combines the constraints of each subproblem into one list. :param hubs: List of EHubs. :return: The list of constraints for each hub combined with the capacities constraint to ensure the same converter capacities across all EHubs.
-
multi_run_period.
multi_run_output
(hubs, factor)[source]¶ Function for collecting the correct info from the multiple EHub models and combining them into one set of results :param hubs: the EHub models now containing their solutions :param factor: If the models are samples for larger time scales
-
multi_run_period.
run_split_period
(excel=None, request=None, output_filename=None, max_carbon=None, num_periods=1, len_periods=24, num_periods_in_sample_period=1, sample_period_position=0, solver='glpk')[source]¶ Core function for splitting a PyEHub model into smaller problems to solve together. :param excel: Input excel file if the hub to be split is in excel. Converted into request format before being split into subproblems. :param request: Input in request JSON format if the hub to be split is in JSON. :param output_filename: Name for file to right the output to if an output file is being used. :param max_carbon: Max carbon value if using a capped carbon value. :param num_periods: Number of sub problem EHubs to be solved together. :param len_periods: Number of time steps per sub problem EHub to be solved. :param num_periods_in_sample_period: Number of periods being grouped together to be represented by 1 sub problem EHub. Example: One week representing a whole month would be ~four periods in a sample period. :param sample_period_position: Which period in the grouped sample to use as the representative EHub. Example the second week of every month would be two. :param solver: Which MILP solver to use. :return: The status of pylp’s solving, the list of hubs (each with their solution), and the absolute cost (cost of all the subproblems added together with the correct factor)
-
multi_run_period.
same_converter_constraint
(converter, hubs)[source]¶ Constraint to ensure the capacities are kept constant across all the subproblems.