コード例 #1
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):
        super().__init__(*args,
                         **kwargs,
                         _facade_requires_=['from_bus', 'to_bus'])

        self.capacity = kwargs.get('capacity')

        self.loss = kwargs.get('loss', 0)

        self.capacity_cost = kwargs.get('capacity_cost')

        investment = self._investment()

        self.inputs.update({self.from_bus: Flow(), self.to_bus: Flow()})

        self.outputs.update({
            self.from_bus:
            Flow(nominal_value=self.capacity, investment=investment),
            self.to_bus:
            Flow(nominal_value=self.capacity, investment=investment)
        })

        self.conversion_factors.update({
            (self.from_bus, self.to_bus):
            sequence((1 - self.loss)),
            (self.to_bus, self.from_bus):
            sequence((1 - self.loss))
        })
コード例 #2
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):
        super().__init__(*args,
                         **kwargs,
                         _facade_requires_=['from_bus', 'to_bus'])

        self.capacity = kwargs.get('capacity')

        self.efficiency = kwargs.get('efficiency', 1)

        self.marginal_cost = kwargs.get('marginal_cost', 0)

        self.capacity_cost = kwargs.get('capacity_cost')

        self.input_edge_parameters = kwargs.get('input_edge_parameters', {})

        self.output_edge_parameters = kwargs.get('output_edge_parameters', {})

        self.conversion_factors.update({
            self.from_bus: sequence(1),
            self.to_bus: sequence(self.efficiency)
        })

        self.inputs.update({self.from_bus: Flow(**self.input_edge_parameters)})

        self.outputs.update({
            self.to_bus:
            Flow(nominal_value=self.capacity,
                 variable_costs=self.marginal_cost,
                 investment=self._investment(),
                 **self.output_edge_parameters)
        })
コード例 #3
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_linear_n1transformer_invest(self):
        """Constraint test of a LinearN1Transformer with Investment.
        """

        bgas = Bus(label='gasBus')
        bcoal = Bus(label='coalBus')
        bel = Bus(label='electricityBus')

        LinearN1Transformer(label='powerplant_gas_coal',
                            inputs={
                                bgas: Flow(),
                                bcoal: Flow()
                            },
                            outputs={
                                bel:
                                Flow(variable_costs=50,
                                     investment=Investment(maximum=1000,
                                                           ep_costs=20))
                            },
                            conversion_factors={
                                bgas: 0.58,
                                bcoal: 0.2
                            })

        self.compare_lp_files('linear_n1_transformer_invest.lp')
コード例 #4
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_fixed_source_invest_sink(self):
        """ Wrong constraints for fixed source + invest sink w. `summed_max`.
        """

        bel = Bus(label='electricityBus')

        Source(label='wind',
               outputs={
                   bel:
                   Flow(actual_value=[12, 16, 14],
                        nominal_value=1000000,
                        fixed=True,
                        fixed_costs=20)
               })

        Sink(label='excess',
             inputs={
                 bel:
                 Flow(summed_max=2.3,
                      variable_costs=25,
                      max=0.8,
                      investment=Investment(ep_costs=500, maximum=10e5))
             })

        self.compare_lp_files('fixed_source_invest_sink.lp')
コード例 #5
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_linear_transformer_chp_invest(self):
        """Constraint test of a LinearTransformer with Investment (two outputs).
        """

        bgas = Bus(label='gasBus')
        bheat = Bus(label='heatBus')
        bel = Bus(label='electricityBus')

        LinearTransformer(label='chp_powerplant_gas',
                          inputs={
                              bgas:
                              Flow(variable_costs=50,
                                   investment=Investment(maximum=1000,
                                                         ep_costs=20))
                          },
                          outputs={
                              bel: Flow(),
                              bheat: Flow()
                          },
                          conversion_factors={
                              bel: 0.4,
                              bheat: 0.5
                          })

        self.compare_lp_files('linear_transformer_chp_invest.lp')
コード例 #6
0
ファイル: facades.py プロジェクト: schoebbe/oemof-thermal
    def build_solph_components(self):
        """
        """

        if self.expandable:
            raise NotImplementedError(
                "Investment for reservoir class is not implemented.")

        inflow = Source(
            label=self.label + "-inflow",
            outputs={
                self:
                Flow(nominal_value=self.aperture_area,
                     max=self.collectors_heat)
            },
        )

        self.conversion_factors.update({
            self.electrical_bus:
            sequence(self.electrical_consumption *
                     (1 - self.additional_losses)),
            self.heat_bus:
            sequence(1 - self.additional_losses),
            inflow:
            sequence(1)
        })

        self.inputs.update({self.electrical_bus: Flow()})
        self.outputs.update({self.heat_bus: Flow()})

        self.subnodes = (inflow, )
コード例 #7
0
ファイル: facades.py プロジェクト: schoebbe/oemof-thermal
    def build_solph_components(self):
        """
        """

        if self.expandable:
            raise NotImplementedError(
                "Investment for solar thermal collector facade has not been implemented yet."
            )

        inflow = Source(
            label=self.label + "-inflow",
            outputs={
                self:
                Flow(nominal_value=self.aperture_area,
                     max=self.collectors_heat)
            },
        )

        self.conversion_factors.update({
            self.electricity_in_bus:
            sequence(self.electrical_consumption *
                     (1 - self.peripheral_losses)),
            self.heat_out_bus:
            sequence(1 - self.peripheral_losses),
            inflow:
            sequence(1)
        })

        self.inputs.update({self.electricity_in_bus: Flow()})
        self.outputs.update({self.heat_out_bus: Flow()})

        self.subnodes = (inflow, )
コード例 #8
0
    def build_solph_components(self):
        """
        """
        self.conversion_factors.update({
            self.fuel_bus:
            sequence(1),
            self.electricity_bus:
            sequence(self.electric_efficiency),
            self.heat_bus:
            sequence(self.thermal_efficiency),
        })

        self.inputs.update({
            self.fuel_bus:
            Flow(variable_costs=self.carrier_cost, **self.input_parameters)
        })

        self.outputs.update({
            self.electricity_bus:
            Flow(
                nominal_value=self._nominal_value(),
                investment=self._investment(),
            ),
            self.heat_bus:
            Flow(),
        })
コード例 #9
0
def add_decentralised_heating_systems(table_collection, nodes, extra_regions):
    logging.debug("Add decentralised_heating_systems to nodes dictionary.")
    cs = table_collection["commodity_source"]["DE"]
    dts = table_collection["demand_series"]
    dh = table_collection["decentralised_heat"]
    demand_regions = list({"DE_demand"}.union(set(extra_regions)))

    for d_region in demand_regions:
        region_name = d_region.replace("_demand", "")

        if region_name not in dh:
            data_name = "DE_demand"
        else:
            data_name = d_region

        fuels = [f for f in dh[data_name].columns if f in dts[d_region]]
        for fuel in fuels:
            src = dh.loc["source", (data_name, fuel)]
            bus_label = Label("bus", "commodity", src.replace(" ", "_"),
                              region_name)

            # Check if source bus exists
            if bus_label not in nodes:
                create_fuel_bus_with_source(nodes, src, region_name, cs)

            # Create heating bus as Bus
            heat_bus_label = Label("bus", "heat", fuel.replace(" ", "_"),
                                   region_name)
            nodes[heat_bus_label] = Bus(label=heat_bus_label)

            # Create heating system as Transformer
            trsf_label = Label("trsf", "heat", fuel.replace(" ", "_"),
                               region_name)

            efficiency = float(dh.loc["efficiency", (data_name, fuel)])

            nodes[trsf_label] = Transformer(
                label=trsf_label,
                inputs={nodes[bus_label]: Flow()},
                outputs={nodes[heat_bus_label]: Flow()},
                conversion_factors={nodes[heat_bus_label]: efficiency},
            )

            # Create demand as Sink
            d_heat_demand_label = Label("demand", "heat",
                                        fuel.replace(" ", "_"), region_name)
            nodes[d_heat_demand_label] = Sink(
                label=d_heat_demand_label,
                inputs={
                    nodes[heat_bus_label]:
                    Flow(
                        actual_value=dts[d_region, fuel],
                        nominal_value=1,
                        fixed=True,
                    )
                },
            )
コード例 #10
0
def test_generic_storage_with_convex_invest_offset():
    """Offset value is given and nonconvex is False."""
    with pytest.raises(AttributeError,
                       match=r"If `nonconvex` is `False`, the `offset`"):
        bel = Bus()
        components.GenericStorage(label='storage6',
                                  inputs={bel: Flow()},
                                  outputs={bel: Flow()},
                                  invest_relation_input_capacity=1 / 6,
                                  invest_relation_output_capacity=1 / 6,
                                  investment=Investment(offset=10))
コード例 #11
0
def add_shortage_excess(nodes):
    bus_keys = [key for key in nodes.keys() if "bus" in key.cat]
    for key in bus_keys:
        excess_label = Label("excess", key.tag, key.subtag, key.region)
        nodes[excess_label] = Sink(label=excess_label,
                                   inputs={nodes[key]: Flow()})
        shortage_label = Label("shortage", key.tag, key.subtag, key.region)
        nodes[shortage_label] = Source(
            label=shortage_label,
            outputs={nodes[key]: Flow(variable_costs=900)},
        )
コード例 #12
0
def test_generic_storage_with_non_convex_invest_maximum():
    """No investment maximum at nonconvex investment."""
    with pytest.raises(AttributeError,
                       match=r"Please provide an maximum investment value"):
        bel = Bus()
        components.GenericStorage(label='storage6',
                                  inputs={bel: Flow()},
                                  outputs={bel: Flow()},
                                  invest_relation_input_capacity=1 / 6,
                                  invest_relation_output_capacity=1 / 6,
                                  investment=Investment(nonconvex=True))
コード例 #13
0
def test_generic_storage_3():
    """Nominal value defined with investment model."""
    bel = Bus()
    components.GenericStorage(
        label='storage4',
        nominal_storage_capacity=45,
        inputs={bel: Flow(nominal_value=23, variable_costs=10e10)},
        outputs={bel: Flow(nominal_value=7.5, variable_costs=10e10)},
        loss_rate=0.00,
        initial_storage_level=0,
        inflow_conversion_factor=1,
        outflow_conversion_factor=0.8)
コード例 #14
0
def test_generic_storage_with_non_convex_investment():
    """Tests error if `offset` and `existing` attribute are given."""
    with pytest.raises(AttributeError,
                       match=r"Values for 'offset' and 'existing' are given"):
        bel = Bus()
        components.GenericStorage(label='storage4',
                                  inputs={bel: Flow()},
                                  outputs={bel: Flow()},
                                  invest_relation_input_capacity=1 / 6,
                                  invest_relation_output_capacity=1 / 6,
                                  investment=Investment(nonconvex=True,
                                                        existing=5,
                                                        maximum=25))
コード例 #15
0
ファイル: test_processing.py プロジェクト: xiaojielin/oemof
    def setUpClass(cls):
        cls.period = 24
        cls.es = EnergySystem(timeindex=pandas.date_range(
            '2016-01-01', periods=cls.period, freq='H'))

        # BUSSES
        b_el1 = Bus(label="b_el1")
        b_el2 = Bus(label="b_el2")
        b_diesel = Bus(label='b_diesel', balanced=False)
        cls.es.add(b_el1, b_el2, b_diesel)

        # TEST DIESEL:
        dg = Transformer(
            label='diesel',
            inputs={b_diesel: Flow(variable_costs=2)},
            outputs={
                b_el1: Flow(variable_costs=1,
                            investment=Investment(ep_costs=0.5))
            },
            conversion_factors={b_el1: 2},
        )

        batt = GenericStorage(
            label='storage',
            inputs={b_el1: Flow(variable_costs=3)},
            outputs={b_el2: Flow(variable_costs=2.5)},
            capacity_loss=0.00,
            initial_capacity=0,
            invest_relation_input_capacity=1 / 6,
            invest_relation_output_capacity=1 / 6,
            inflow_conversion_factor=1,
            outflow_conversion_factor=0.8,
            fixed_costs=35,
            investment=Investment(ep_costs=0.4),
        )

        cls.demand_values = [100] * 8760
        cls.demand_values[0] = 0.0
        demand = Sink(label="demand_el",
                      inputs={
                          b_el2:
                          Flow(nominal_value=1,
                               actual_value=cls.demand_values,
                               fixed=True)
                      })
        cls.es.add(dg, batt, demand)
        cls.om = Model(cls.es)
        cls.om.receive_duals()
        cls.om.solve()
        cls.mod = Model(cls.es)
        cls.mod.solve()
コード例 #16
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_linear_transformer(self):
        """Constraint test of a LinearTransformer without Investment.
        """
        bgas = Bus(label='gas')

        bel = Bus(label='electricity')

        LinearTransformer(
            label='powerplantGas',
            inputs={bgas: Flow()},
            outputs={bel: Flow(nominal_value=10e10, variable_costs=50)},
            conversion_factors={bel: 0.58})

        self.compare_lp_files('linear_transformer.lp')
コード例 #17
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):

        super().__init__(*args,
                         **kwargs,
                         _facade_requires_=['bus', 'inflow', 'efficiency'])

        self.storage_capacity = kwargs.get('storage_capacity')

        self.capacity = kwargs.get('capacity')

        self.efficiency = kwargs.get('efficiency')

        self.nominal_capacity = self.storage_capacity

        self.capacity_cost = kwargs.get('capacity_cost')

        self.storage_capacity_cost = kwargs.get('storage_capacity_cost')

        self.spillage = kwargs.get('spillage', True)

        self.input_edge_parameters = kwargs.get('input_edge_parameters', {})

        self.output_edge_parameters = kwargs.get('output_edge_parameters', {})

        investment = self._investment()

        reservoir_bus = Bus(label="reservoir-bus-" + self.label)
        inflow = Source(label="inflow" + self.label,
                        outputs={
                            reservoir_bus:
                            Flow(nominal_value=1,
                                 actual_value=self.inflow,
                                 fixed=True)
                        })
        if self.spillage:
            f = Flow()
        else:
            f = Flow(actual_value=0, fixed=True)

        spillage = Sink(label="spillage" + self.label,
                        inputs={reservoir_bus: f})
        self.inputs.update({reservoir_bus: Flow(**self.input_edge_parameters)})

        self.outputs.update({
            self.bus:
            Flow(investment=investment, **self.output_edge_parameters)
        })

        self.subnodes = (reservoir_bus, inflow, spillage)
コード例 #18
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):
        super().__init__(conversion_factor_full_condensation={},
                         *args,
                         **kwargs,
                         _facade_requires_=[
                             'carrier', 'electricity_bus', 'heat_bus',
                             'thermal_efficiency', 'electric_efficiency',
                             'condensing_efficiency'
                         ])

        self.carrier = kwargs.get('carrier')

        self.carrier_cost = kwargs.get('carrier_cost', 0)

        self.capacity = kwargs.get('capacity')

        self.condensing_efficiency = sequence(self.condensing_efficiency)

        self.marginal_cost = kwargs.get('marginal_cost', 0)

        self.capacity_cost = kwargs.get('capacity_cost')

        self.electricity_bus = kwargs.get('electricity_bus')

        self.heat_bus = kwargs.get('heat_bus')

        self.conversion_factors.update({
            self.carrier:
            sequence(1),
            self.electricity_bus:
            sequence(self.electric_efficiency),
            self.heat_bus:
            sequence(self.thermal_efficiency)
        })

        self.inputs.update(
            {self.carrier: Flow(variable_cost=self.carrier_cost)})

        self.outputs.update({
            self.electricity_bus:
            Flow(nominal_value=self.capacity,
                 variable_costs=self.marginal_cost,
                 investment=self._investment()),
            self.heat_bus:
            Flow()
        })

        self.conversion_factor_full_condensation.update(
            {self.electricity_bus: self.condensing_efficiency})
コード例 #19
0
def test_generic_storage_1():
    """Duplicate definition inflow."""
    bel = Bus()
    with pytest.raises(AttributeError, match="Overdetermined."):
        components.GenericStorage(label='storage1',
                                  inputs={bel: Flow(variable_costs=10e10)},
                                  outputs={bel: Flow(variable_costs=10e10)},
                                  loss_rate=0.00,
                                  initial_storage_level=0,
                                  invest_relation_input_output=1,
                                  invest_relation_output_capacity=1,
                                  invest_relation_input_capacity=1,
                                  investment=Investment(),
                                  inflow_conversion_factor=1,
                                  outflow_conversion_factor=0.8)
コード例 #20
0
def test_generic_storage_2():
    """Nominal value defined with investment model."""
    bel = Bus()
    with pytest.raises(AttributeError, match="If an investment object"):
        components.GenericStorage(label='storage3',
                                  nominal_storage_capacity=45,
                                  inputs={bel: Flow(variable_costs=10e10)},
                                  outputs={bel: Flow(variable_costs=10e10)},
                                  loss_rate=0.00,
                                  initial_storage_level=0,
                                  invest_relation_input_capacity=1 / 6,
                                  invest_relation_output_capacity=1 / 6,
                                  inflow_conversion_factor=1,
                                  outflow_conversion_factor=0.8,
                                  investment=Investment(ep_costs=23))
コード例 #21
0
ファイル: main.py プロジェクト: Py-micrOgridS/micrOgridS
def add_inverter(i, o, name, eta=1):
    """
     The function returns an inverter with defined input i and output o flows a certain
     label/name and an assigned efficiency Transfromer object
     :param cost:   i   input flows
                    o   output flows
                    name label of inverter as str
                    eta efficiency takes float values from 0-1

     :return: sim_params dict parameter inputs for the energy system model
     """
    return Transformer( label=name,
                        inputs={i: Flow()},
                        outputs={o: Flow()},
                        conversion_factors={o: eta} )
コード例 #22
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_max_source_min_sink(self):
        """
        """
        bel = Bus(label='electricityBus')

        Source(label='wind',
               outputs={bel: Flow(nominal_value=54, max=(.85, .95, .61))})

        Sink(label='minDemand',
             inputs={
                 bel:
                 Flow(nominal_value=54, min=(.84, .94, .59), variable_costs=14)
             })

        self.compare_lp_files('max_source_min_sink.lp')
コード例 #23
0
def initialize_basic_energysystem():
    # initialize and provide data
    datetimeindex = pd.date_range('1/1/2016', periods=24, freq='H')
    filename = 'input_data.csv'
    data = pd.read_csv(filename, sep=",")
    energysystem = EnergySystem(timeindex=datetimeindex)

    # buses
    bcoal = Bus(label='coal', balanced=False)
    bgas = Bus(label='gas', balanced=False)
    bel = Bus(label='electricity')
    energysystem.add(bcoal, bgas, bel)

    # sources
    energysystem.add(
        Source(label='wind',
               outputs={
                   bel:
                   Flow(actual_value=data['wind'],
                        nominal_value=66.3,
                        fixed=True)
               }))

    energysystem.add(
        Source(label='pv',
               outputs={
                   bel:
                   Flow(actual_value=data['pv'],
                        nominal_value=65.3,
                        fixed=True)
               }))

    # excess and shortage to avoid infeasibilies
    energysystem.add(Sink(label='excess_el', inputs={bel: Flow()}))
    energysystem.add(
        Source(label='shortage_el', outputs={bel: Flow(variable_costs=200)}))

    # demands (electricity/heat)
    energysystem.add(
        Sink(label='demand_el',
             inputs={
                 bel:
                 Flow(nominal_value=85,
                      actual_value=data['demand_el'],
                      fixed=True)
             }))

    return bcoal, bgas, bel, energysystem
コード例 #24
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):
        super().__init__(*args,
                         **kwargs,
                         _facade_requires_=['bus', 'carrier', 'tech'])

        self.carrier = kwargs.get('carrier')

        self.profile = kwargs.get('profile')

        self.capacity = kwargs.get('capacity')

        self.capacity_potential = kwargs.get('capacity_potential')

        self.marginal_cost = kwargs.get('marginal_cost', 0)

        self.capacity_cost = kwargs.get('capacity_cost')

        self.edge_parameters = kwargs.get('edge_parameters', {})

        f = Flow(nominal_value=self.capacity,
                 variable_costs=self.marginal_cost,
                 actual_value=self.profile,
                 investment=self._investment(),
                 fixed=True,
                 **self.edge_parameters)

        self.outputs.update({self.bus: f})
コード例 #25
0
def add_conventional_mobility(table_collection, nodes):
    """

    Parameters
    ----------
    table_collection
    nodes

    Returns
    -------

    """
    mileage = table_collection["mobility_mileage"]["DE"]
    spec_demand = table_collection["mobility_spec_demand"]["DE"]
    energy_content = table_collection["mobility_energy_content"]["DE"]
    energy_tp = mileage.mul(spec_demand).mul(energy_content.iloc[0]) / 10**6
    energy = energy_tp.sum()
    idx = table_collection["demand_series"].index
    oil_key = Label("bus", "commodity", "oil", "DE")
    for fuel in ["diesel", "petrol"]:
        fix_value = pd.Series(energy / len(idx), index=idx, dtype=float)
        fuel_label = Label("Usage", "mobility", fuel, "DE")
        nodes[fuel_label] = Sink(
            label=fuel_label,
            inputs={nodes[oil_key]: Flow(actual_value=fix_value)},
        )

    return nodes
コード例 #26
0
    def build_solph_components(self):
        """
        """
        self.nominal_storage_capacity = self.storage_capacity

        self.inflow_conversion_factor = sequence(self.efficiency)

        self.outflow_conversion_factor = sequence(self.efficiency)

        # make it investment but don't set costs (set below for flow (power))
        self.investment = self._investment()

        if self.investment:
            self.invest_relation_input_output = 1

            for attr in ["invest_relation_input_output"]:
                if getattr(self, attr) is None:
                    raise AttributeError(
                        ("You need to set attr "
                         "`{}` "
                         "for component {}").format(attr, self.label))

            # set capacity costs at one of the flows
            fi = Flow(investment=Investment(
                ep_costs=self.capacity_cost,
                maximum=self.capacity_potential,
                existing=self.capacity,
            ),
                      **self.input_parameters)
            # set investment, but no costs (as relation input / output = 1)
            fo = Flow(investment=Investment(),
                      variable_costs=self.marginal_cost,
                      **self.output_parameters)
            # required for correct grouping in oemof.solph.components
            self._invest_group = True
        else:
            fi = Flow(nominal_value=self._nominal_value(),
                      **self.input_parameters)
            fo = Flow(nominal_value=self._nominal_value(),
                      variable_costs=self.marginal_cost,
                      **self.output_parameters)

        self.inputs.update({self.bus: fi})

        self.outputs.update({self.bus: fo})

        self._set_flows()
コード例 #27
0
ファイル: facades.py プロジェクト: FranziPl/oemof-tabular
    def build_solph_components(self):
        """
        """
        self.conversion_factors.update({
            self.from_bus: sequence(1),
            self.to_bus: sequence(self.efficiency),
        })

        self.inputs.update({self.from_bus: Flow(**self.input_parameters)})

        self.outputs.update({
            self.to_bus:
            Flow(nominal_value=self._nominal_value(),
                 variable_costs=self.marginal_cost,
                 investment=self._investment(),
                 **self.output_parameters)
        })
コード例 #28
0
ファイル: constraint_tests.py プロジェクト: ulfmueller/oemof
    def test_storage(self):
        """
        """
        bel = Bus(label='electricityBus')

        Storage(label='storage',
                inputs={bel: Flow(variable_costs=56)},
                outputs={bel: Flow(variable_costs=24)},
                nominal_capacity=10e4,
                capacity_loss=0.13,
                nominal_input_capacity_ratio=1 / 6,
                nominal_output_capacity_ratio=1 / 6,
                inflow_conversion_factor=0.97,
                outflow_conversion_factor=0.86,
                fixed_costs=35)

        self.compare_lp_files('storage.lp')
コード例 #29
0
ファイル: facades.py プロジェクト: znes/renpass
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs, _facade_requires_=['bus'])

        self.bus = kwargs.get('bus')

        self.marginal_cost = kwargs.get('marginal_cost')

        self.inputs.update({self.bus: Flow(variable_costs=self.marginal_cost)})
コード例 #30
0
    def __init__(self, *args, **kwargs):
        super().__init__(_facade_requires_=["bus"], *args, **kwargs)

        self.bus = kwargs.get("bus")

        self.marginal_cost = kwargs.get("marginal_cost")

        self.inputs.update({self.bus: Flow(variable_costs=self.marginal_cost)})