def __init__(self, demand, c_up, c_do, delay_time, *args, **kwargs): super().__init__(*args, **kwargs) self.c_up = solph_sequence(c_up) self.c_do = solph_sequence(c_do) self.delay_time = delay_time self.demand = solph_sequence(demand)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.nominal_capacity = kwargs.get('nominal_capacity') self.nominal_input_capacity_ratio = kwargs.get( 'nominal_input_capacity_ratio', None) self.nominal_output_capacity_ratio = kwargs.get( 'nominal_output_capacity_ratio', None) self.initial_capacity = kwargs.get('initial_capacity') self.capacity_loss = solph_sequence(kwargs.get('capacity_loss', 0)) self.inflow_conversion_factor = solph_sequence( kwargs.get('inflow_conversion_factor', 1)) self.outflow_conversion_factor = solph_sequence( kwargs.get('outflow_conversion_factor', 1)) self.capacity_max = solph_sequence(kwargs.get('capacity_max', 1)) self.capacity_min = solph_sequence(kwargs.get('capacity_min', 0)) self.investment = kwargs.get('investment') # General error messages e_no_nv = ("If an investment object is defined the invest variable " "replaces the {0}.\n Therefore the {0} should be 'None'.\n") e_duplicate = ( "Duplicate definition.\nThe 'nominal_{0}_capacity_ratio'" "will set the nominal_value for the flow.\nTherefore " "either the 'nominal_{0}_capacity_ratio' or the " "'nominal_value' has to be 'None'.") # Check investment if self.investment and self.nominal_capacity is not None: raise AttributeError(e_no_nv.format('nominal_capacity')) # Check input flows for flow in self.inputs.values(): if self.investment and flow.nominal_value is not None: raise AttributeError(e_no_nv.format('nominal_value')) if (flow.nominal_value is not None and self.nominal_input_capacity_ratio is not None): raise AttributeError(e_duplicate) if (not self.investment and self.nominal_input_capacity_ratio is not None): flow.nominal_value = (self.nominal_input_capacity_ratio * self.nominal_capacity) if self.investment: if not isinstance(flow.investment, Investment): flow.investment = Investment() # Check output flows for flow in self.outputs.values(): if self.investment and flow.nominal_value is not None: raise AttributeError(e_no_nv.format('nominal_value')) if (flow.nominal_value is not None and self.nominal_output_capacity_ratio is not None): raise AttributeError(e_duplicate) if (not self.investment and self.nominal_output_capacity_ratio is not None): flow.nominal_value = (self.nominal_output_capacity_ratio * self.nominal_capacity) if self.investment: if not isinstance(flow.investment, Investment): flow.investment = Investment()
def __init__(self, demand, c_up, c_do, *args, **kwargs): super().__init__(*args, **kwargs) self.c_up = solph_sequence(c_up) self.c_do = solph_sequence(c_do) self.demand = solph_sequence(demand) self.method = kwargs.get('method', 'delay') self.shift_interval = kwargs.get('shift_interval', 24) self.delay_time = kwargs.get('delay_time', 3)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.nominal_capacity = kwargs.get('nominal_capacity') self.nominal_input_capacity_ratio = kwargs.get( 'nominal_input_capacity_ratio') self.nominal_output_capacity_ratio = kwargs.get( 'nominal_output_capacity_ratio') self.initial_capacity = kwargs.get('initial_capacity') self.capacity_loss = solph_sequence(kwargs.get('capacity_loss', 0)) self.inflow_conversion_factor = solph_sequence( kwargs.get('inflow_conversion_factor', 1)) self.outflow_conversion_factor = solph_sequence( kwargs.get('outflow_conversion_factor', 1)) self.capacity_max = solph_sequence(kwargs.get('capacity_max', 1)) self.capacity_min = solph_sequence(kwargs.get('capacity_min', 0)) self.investment = kwargs.get('investment') self.invest_relation_input_output = kwargs.get( 'invest_relation_input_output') self.invest_relation_input_capacity = kwargs.get( 'invest_relation_input_capacity') self.invest_relation_output_capacity = kwargs.get( 'invest_relation_output_capacity') self._invest_group = isinstance(self.investment, Investment) warnings.simplefilter('always', DeprecationWarning) dpr_msg = ("\nDeprecated. The attributes " "'nominal_input_capacity_ratio' and " "'nominal_input_capacity_ratio' will be removed in " "oemof >= v0.3.0.\n Please use the 'invest_relation_...' " "attribute in case of the investment mode.\n Please use " "the 'nominal_value' within in the Flows for the dispatch " "mode.\n These measures will avoid this warning.") # DEPRECATED. Set nominal_value of in/out Flows using # nominal_input_capacity_ratio / nominal_input_capacity_ratio if self._invest_group is False and ( self.nominal_input_capacity_ratio is not None or self.nominal_output_capacity_ratio is not None): self._set_flows(dpr_msg) # Check attributes for the investment mode. if self._invest_group is True: self._check_invest_attributes(dpr_msg)
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fuel_input = kwargs.get('fuel_input') self.electrical_output = kwargs.get('electrical_output') self.heat_output = kwargs.get('heat_output') self.Beta = solph_sequence(kwargs.get('Beta')) self.back_pressure = kwargs.get('back_pressure') self._alphas = None # map specific flows to standard API fuel_bus = list(self.fuel_input.keys())[0] fuel_flow = list(self.fuel_input.values())[0] fuel_bus.outputs.update({self: fuel_flow}) self.outputs.update(kwargs.get('electrical_output')) self.outputs.update(kwargs.get('heat_output'))
def __init__(self, conversion_factor_full_condensation, *args, **kwargs): super().__init__(*args, **kwargs) self.conversion_factor_full_condensation = { k: solph_sequence(v) for k, v in conversion_factor_full_condensation.items() }