Ejemplo n.º 1
0
    def recalculate_time_period_full(self,
                                     state_handle,
                                     results,
                                     supply_request,
                                     max_supply=[],
                                     price=[],
                                     make_string=False):
        """Recalculate as for calculate_time_period_full, but without updating the state first.
        Typically this would be used when iterating through a transmission model.

        calculate_time_period_full must be called first, with do_decommissioning set to False. Once the
        iterations are complete, calculate_update_decommissioning must be called to complete the 
        calculations for the period.

        This implementation below assumes that the decommissioning and capital costs are not dependent on
        supply_request, max_supply or price.
        
        Inputs:
            state_handle: an arbitrary object, which initiated from self.get_startup_state_handle, 
                that describes the state of the generator model at the current time period.
            results: the dict output from a run of calculate_time_period_full.
            supply_request, max_supply, price, make_string: as for calculate_time_period_full.
            
        Outputs:
            None - but the results input is updated in-place.
        """
        raise mureilexception.ProgramException(
            'Function recalculate_time_period_full called by ' +
            self.__class__.name +
            ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
        )
Ejemplo n.º 2
0
 def calculate_outputs_and_costs(self,
                                 state_handle,
                                 supply_request,
                                 max_supply=[],
                                 price=[]):
     """Calculate the supply output of each site at each point in the timeseries. Return
     a set of timeseries of supply. Also calculate, for the length of time
     represented by the timeseries length, the variable cost (fuel, maintenance etc)
     for each site, and the carbon emissions.
     
     Inputs:
         state_handle: an arbitrary object, which initiated from self.get_startup_state_handle, 
             that describes the state of the generator model at the current time period
         supply_request: a timeseries indicating the total requested supply 
             for this generator
         max_supply: optional - a set of timeseries indicating any curtailing
             due to transmission restrictions.
         price: optional - a timeseries indicating the market price in $/MWh
         
     Outputs:
         All lists below will correspond to the list of site indices as returned by 
         get_site_indices with the same state_handle.
         
         supply: a set of timeseries, one per site, indicating output in MW at
             each timepoint in supply_request.
         variable_cost: a set of costs, one per site, in $M, for the timeseries length.
         carbon_emissions: a set of carbon emissions, one per site, in tonnes of CO2,
             for the timeseries length.
         other: an arbitrary dict, for extra information such as reliability.
     """
     raise mureilexception.ProgramException(
         'Function calculate_outputs_and_costs called by ' +
         self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )
Ejemplo n.º 3
0
 def set_startup_state(self, startup_data):
     """Setup the startup state from startup_data.
     
     Inputs:
         startup_data: whatever data type is implemented for this
             function by a subclass.
     """
     raise mureilexception.ProgramException(
         'Function set_startup_state called by ' + self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )
Ejemplo n.º 4
0
 def calculate_time_period_full(self,
                                state_handle,
                                period,
                                new_params,
                                supply_request,
                                max_supply={},
                                price=[],
                                make_string=False,
                                do_decommissioning=True):
     """Calculate, for this time period, the supply from each site, the capacity at
     each site, the variable cost, capital cost and carbon emissions. Expose all of 
     the parameters and require the transmission and/or economic models to do the
     rest of the work.
     
     Inputs:
         state_handle: an arbitrary object, which initiated from self.get_startup_state_handle, 
             that describes the state of the generator model before the current time period
         period: an integer identifying the period - e.g. 2010, 2020.
         new_params: a list of param numbers of length matching self.get_param_count
         supply_request: a timeseries indicating the total requested supply 
             for this generator
         max_supply: optional - a set of timeseries indicating any curtailing
             due to transmission restrictions - as a dict of {site_index: timeseries}
         price: optional - a timeseries indicating the market price in $/MWh
         make_string: if True, return as the final output, a string describing the
             current state and outputs.
         do_decommissioning: if True, update to the state after decommissioning at the
             end of the period. Set to False if recalculate_time_period_full will be called.
         
     Outputs:
         results: a dict with all of the following values
             site_indices: the identifying indices of each site with active capacity. All lists of
                 sites below will correspond with this list.
             capacity: a list of the installed electrical capacity at each site.
             decommissioned: a list of tuples of (site_index, capacity, cost) - the capacity 
                 at each site that was decommissioned at the end of this period.
             new_capacity: a list of tuples of (site_index, capacity, cost) - the new capacity 
                 built at each site in this period.
             supply: a set of timeseries, one per site, indicating output in MW at
                 each timepoint in supply_request.
             variable_cost_ts: a set of costs, one per site, in $M, for the timeseries length.
             carbon_emissions_ts: a set of carbon emissions, one per site, in tonnes of CO2,
                 for the timeseries length, or empty list if none.
             other: an arbitrary dict, for extra information such as reliability.
             desc_string: a descriptive string on the current state and output, 
                 only returned if make_string in inputs is True.
     """
     raise mureilexception.ProgramException(
         'Function calculate_time_period_full called by ' +
         self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )
Ejemplo n.º 5
0
    def calculate_time_period_simple(self,
                                     state_handle,
                                     period,
                                     new_params,
                                     supply_request,
                                     full_results=False):
        """Calculate, for this time period, the total supply of all sites in this model,
        and the total cost. This is for use in a simple dispatch model with copper-plated
        transmission.

        Inputs:
            state_handle: an arbitrary object, which initiated from self.get_startup_state_handle, 
                that describes the state of the generator model before the current time period
            period: an integer identifying the period - e.g. 2010, 2020.
            new_params: a list of param numbers of length matching self.get_param_count
            supply_request: a timeseries indicating the total requested supply 
                for this generator
            full_results: optional - if True, return a detailed results structure in addition

        Outputs:
            site_indices: the identifying indices of each site with active capacity. All lists of
                sites below will correspond with this list.
            cost: the total cost incurred in this period
            aggregate_supply: the total supply from all active sites in this model

            results: only returned if full_results is True. Returns a dict with items:
                site_indices: the identifying indices of each site with active capacity. All lists of
                    sites below will correspond with this list.
                cost: the total cost incurred in this period
                aggregate_supply: the total supply from all active sites in this model
                capacity: a list of the installed electrical capacity at each site.
                decommissioned: a list of tuples of (site_index, capacity, cost) - the capacity 
                    at each site that was decommissioned at the end of this period.
                new_capacity: a list of tuples of (site_index, capacity, cost) - the new capacity 
                    built at each site in this period.
                supply: a set of timeseries, one per site, indicating output in MW at
                    each timepoint in supply_request.
                variable_cost_period: a set of costs, one per site, in $M, for the period.
                carbon_emissions_period: a set of carbon emissions, one per site, in tonnes of CO2,
                    for the period, or empty list if none.
                total_supply_period: the total supply in MWh for the period from this generator
                other: an arbitrary dict, for extra information such as reliability.
                desc_string: a descriptive string on the current state and output
        """
        raise mureilexception.ProgramException(
            'Function calculate_time_period_simple called by ' +
            self.__class__.name +
            ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
        )
Ejemplo n.º 6
0
 def calculate_outputs(self, state_handle, ts_length):
     """Calculate the maximum outputs, before scheduling.
     
     Inputs:
         state_handle
         ts_length: an integer - the length of the timeseries
         
     Outputs:
         site_indices: the list of sites with active capacity
         output: a set of timeseries, corresponding to site_indices
     """
     raise mureilexception.ProgramException(
         'Function calculate_outputs called by ' + self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )
Ejemplo n.º 7
0
 def calculate_variable_costs(self, state_handle, site_indices, schedule):
     """Calculate variable costs and carbon based on schedule.
     
     Inputs:
         state_handle
         site_indices
         schedule: The scheduled output, a set of timeseries
         
     Outputs:
         variable_cost, carbon, other
     """
     raise mureilexception.ProgramException(
         'Function calculate_variable_costs called by ' +
         self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )
Ejemplo n.º 8
0
 def calculate_costs_from_schedule_and_finalise(self, state_handle,
                                                schedule):
     """Calculate the costs, given the schedule from the dispatcher.
     Finalise the decommissioning for that period.
     Inputs:
         state_handle: 
             as for calculate_time_period_full in txmultigeneratorbase.py
         schedule: a set of timeseries for each active site, as previously
             listed in the call to get_offers_* 
     
     Outputs:
             as for calculate_time_period_full in txmultigeneratorbase.py
     """
     raise mureilexception.ProgramException(
         'Function calculate_costs_from_schedule_and_finalise called by ' +
         self.__class__.name +
         ', falling through to TxMultiGeneratorBase which does not provide an implementation.'
     )