コード例 #1
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.start_time_of_curr_interval = 0
        self.start_time_of_next_interval = 0
        self.async_future = None

        self.outputs['step'] = Output('Step',
                                      unit='-',
                                      info='step number, starts with 0')
        self.outputs['time'] = Output('Future',
                                      unit='s',
                                      info='utc time in seconds since epoch')

        # control
        self.properties['prep_lead'] = Property(
            'Time lead of Preperation step',
            default=0,
            data_type=int,
            unit='s',
            info=
            'Amount of seconds the preparation step is started before the actual interval'
        )
        self.properties['delta_time'] = Property(
            'Real time between each interval run',
            default=1,
            data_type=int,
            unit='s',
            info='Real time between iteration, 0 = as fast as possible')
コード例 #2
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name :str):
        super(Model, self).__init__(uuid,name)

        self.inputs['times'] = Input(name='Times', unit='s', info='utc time array')
        self.inputs['values'] = Input(name='Values', unit='any', info='value array')

        self.outputs['data_histfore'] = Output(name='Historical and forecast data', unit='div',
                                               info='{time_hist, time_forecast, value_hist, value_forecast}')
        self.outputs['y_scaling'] = Output(name='Scaling of y axis', unit='', info='Scaling of y axis')
        self.outputs['y_label'] = Output(name='y label', unit='', info='Label of y axis')

        self.properties["filter"] = Property(default='', data_type=str, name='Filter',
                                             unit='-', info='comma separated dict keys and array indexes',
                                             example='"speed", 2')
        self.properties["num_hist"] = Property(default=0, data_type=int, name='Number historical data', unit='-',
                                               info='Number of historical data to be saved (0=unlimited)', example='100')
        self.properties["scaling"] = Property(default=1, data_type=float, name='Scaling factor', unit='-',
                                              info='Scaling factor for y axis', example='1e-9')
        self.properties["y_labeling"] = Property(default='Property', data_type=str, name='y label', unit='-',
                                                 info='Label for y axis', example='Demand [GW]')

        self.data_hist_forecast = {"historic": {}, "forecast": {}}
        self.data_hist_forecast["historic"]["time"] = []
        self.data_hist_forecast["historic"]["value"] = []
        self.data_hist_forecast["forecast"]["time"] = []
        self.data_hist_forecast["forecast"]["value"] = []

        self.y_scaling = None
        self.y_labeling = None
コード例 #3
0
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['KW'] = Input(name='KW info', unit='-', info="KW information (u.a. id, lat, lon)")
        self.inputs['date'] = Input(name='Futures', unit='s', info="Time vector of futures in utc timestamp [s]")
        self.inputs['Demand_loc'] = Input(name='Demand locations', unit='id, lat, long', info="Demand locations (one location per country)")

        # define outputs
        self.outputs['KW_weather'] = Output(name='Weather data of KWs', unit='dict{id, windspeed, radiation, windmesshoehe}', info='weather data of KWs')
        self.outputs['Demand_weather'] = Output(name='Weather data for demand', unit='dict{id, lat, long, temperature}', info='weather data for demand calculation')
        self.outputs['Futures_weather'] = Output(name='Weather data', unit='s, °C, m/s, W/m^2', info='weather data for 25 points (time, temperature, wind speed, radiation)')
        self.outputs['Map_weather'] = Output(name='Weather data for map', unit='s, °C, m/s, W/m^2',
                                                 info='weather data interpolated on grid (time, temperature, wind speed, radiation)')

        # define properties
        self.properties['T_offset'] = Property(default=0., data_type=float, name='temperature offset', unit='%', info="offset of temperature in %", example='100: doubles the value')
        self.properties['u_offset'] = Property(default=0., data_type=float, name='wind speed offset', unit='%', info="offset of wind speed in %", example='100: doubles the value')
        self.properties['P_offset'] = Property(default=0., data_type=float, name='radiation offset', unit='%', info="offset of radiation in %", example='100: doubles the value')
        self.properties['ref_year'] = Property(default=2007, data_type=int, name='reference year', unit='-', info="reference year for modeled weather (2007-2016; provided data for 2006-2017)",
                                               example='2007')

        # define persistent variables
        self.data_hist = None
        self.ref_year = None
コード例 #4
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['dividend'] = Input('Dividend', unit='num')
        self.inputs['divisor'] = Input('Divisor', unit='num')

        self.outputs['quotient'] = Output('Quotient', unit='num')
        self.outputs['floor_quotient'] = Output('Floor Quotient', unit='num')
        self.outputs['floor_modulus'] = Output('Floor Modulus', unit='num')
コード例 #5
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['mode'] = Input(name='modus',
                                    unit='-',
                                    info="modus (is live of not")
        self.inputs['KW'] = Input(name='KW info',
                                  unit='-',
                                  info="KW informations (u.a. id, lat, lon)")
        self.inputs['date'] = Input(
            name='Futures',
            unit='s',
            info="Time vector of futures in utc timestamp [s]")

        # define outputs
        self.outputs['KW_weather'] = Output(name='weather data of KWs',
                                            unit='date, °C, m/s, W/m^2',
                                            info='weather data of KWs')
        self.outputs['Futures_weather'] = Output(
            name='weather data',
            unit='date, °C, m/s, W/m^2',
            info='(future) weather data (temperature, wind speed, radiation)')

        # define properties
        self.properties['T_offset'] = Property(
            default=0.,
            data_type=float,
            name='temperature offset',
            unit='%',
            info="offset of temperature in %")
        self.properties['u_offset'] = Property(
            default=0.,
            data_type=float,
            name='wind speed offset',
            unit='%',
            info="offset of wind speed in %")
        self.properties['P_offset'] = Property(default=0.,
                                               data_type=float,
                                               name='radiation offset',
                                               unit='%',
                                               info="offset of radiation in %")
        self.properties['ref_year'] = Property(
            default=2007,
            data_type=int,
            name='reference year',
            unit='-',
            info="reference year for modeled weather")

        # define persistent variables
        self.data_hist = None
        self.data_hist_year = None
        self.ref_year = None
コード例 #6
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name :str):
        super(Model, self).__init__(uuid,name)

        self.inputs['times'] = Input(name='Times', unit='s', info='utc time array')
        self.inputs['values'] = Input(name='Values', unit='any', info='value array')

        self.outputs['times_out'] = Output(name='Times', unit='times]', info='utc time arry')
        self.outputs['values_out'] = Output(name='Filtered values', unit='values', info='filtered value array')

        self.properties["filter"] = Property(default='', data_type=str, name='Filter',
                                             unit='-', info='comma separated dict keys and array indexes',
                                             example='"speed", 2')
コード例 #7
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['dist_net'] = Input(name='Distribution networks',
                                        unit='{-, {Grad, Grad}}',
                                        info='distribution networks')

        # define outputs
        self.outputs['dist_cost'] = Output(name='Distribution cost',
                                           unit='€/J',
                                           info='distribution cost')

        # define properties
        cost_constant_def = 36000
        cost_constant_def = json.dumps(cost_constant_def)
        self.properties['cost_const'] = Property(
            default=cost_constant_def,
            data_type=str,
            name='constant dist cost',
            unit='€/km*MWh',
            info='constant distribution costs',
            example='36000')

        # persistent variables
        self.cost_constant = None
コード例 #8
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)
        self.elapsed = 0

        self.inputs['time'] = Input(name='Time',
                                    unit='s',
                                    info='utc time in seconds since epoch')

        self.outputs['times'] = Output(
            name='Futures',
            unit='s',
            info='utc time array in seconds since epoch')

        self.properties["interval"] = Property(
            default=1,
            data_type=float,
            name='Interval time',
            unit='s',
            info='Time between each time stamps')
        self.properties["future_steps"] = Property(
            default=1,
            data_type=int,
            name='Number of intervals',
            unit='-',
            info='Number of time stamps')
コード例 #9
0
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['WTAuslastung'] = Input(
            'LoadWindTurbine', info='load of all wind turbines, value[0-1]')
        self.inputs['PVAuslastung'] = Input(
            'LoadPhotovoltaic',
            info='load of all photovoltaic power plants, value[0-1]')
        self.inputs['LaufwasserKWAuslastung'] = Input(
            'LoadRunningWaterPowerPlant',
            info='load of all running-water power plants, value[0-1]')
        self.inputs['SpeicherwasserKWAuslastung'] = Input(
            'LoadStoragePowerPlant',
            info='load of all storage power plants, value[0-1]')
        self.inputs['KWDaten'] = Input('PowerPlantsData',
                                       info='dict, power plant id required')
        self.inputs['futures'] = Input(
            'Futures', unit='s', info='utc time array in seconds since epoch')

        # define outputs
        self.outputs['GemeinsameAuslastung'] = Output(
            'CombinedLoad',
            info='combined load of all types of power plants, value[0-1]')
コード例 #10
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['to_store'] = Input('To Store')
        self.outputs['stored'] = Output('Stored')

        self.stored = 0
コード例 #11
0
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)
        # define outputs
        self.outputs['standorte'] = Output('StandorteSPG')

        # define persistent variables
        self.kw_data = None
コード例 #12
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)
        # define outputs
        self.outputs['weather'] = Output('WeatherData')

        # define persistent variables
        self.weather = None
コード例 #13
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['in1'] = Input('Number', unit='num')
        self.inputs['in2'] = Input('Number', unit='num')
        self.inputs['in3'] = Input('Number', unit='num')

        self.outputs['sum'] = Output('Sum', unit='num')
コード例 #14
0
    def __init__(self, uuid, name :str):
        super(Model, self).__init__(uuid,name)

        self.inputs['number'] = Input('Number', unit='-', info="The number that gets multiplied", example='2')

        self.properties['multiplier'] = Property('Multiplier', default=1, data_type=float, unit='float', info='The multiplier', example='2')

        self.outputs['product'] = Output('Product', unit='-', info="The resulting product", example='2')
コード例 #15
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['fut'] = Input(
            name='Futures',
            unit='s',
            info='utc time array in seconds since epoch',
            example='[1530792535, 1530792540, 1530792545]')
        self.inputs['demand'] = Input(
            name='European demand',
            unit='W',
            info='European power demand for each time step')
        self.inputs['power'] = Input(
            name='Power',
            unit='W',
            info='Power for each power plant and time step')
        self.inputs['power_plants'] = Input(name='Power Plants',
                                            unit='-',
                                            info='Power Plants')
        self.inputs['distance_costs'] = Input(
            name='Distance costs',
            unit='€/J',
            info='Distance costs for each power plant and distribution network'
        )

        self.outputs['market_prices'] = Output(
            name='Market prices',
            unit='€/J',
            info='Market prices for each distribution network and time step')
        self.outputs['power_plants2'] = Output(
            name='Power Plants',
            unit='-',
            info='Power Plants with additional information')
        self.outputs['sorted_pp_id'] = Output(
            name='Sorted power plant ids',
            unit='-',
            info='sorted power plant ids for each distribution network')
        self.outputs['fut2'] = Output(
            name='Futurs',
            unit='s',
            info='utc time array in seconds since epoch')
        self.outputs['demands2'] = Output(
            name='Demands',
            unit='W',
            info='European power demand for each time step')
コード例 #16
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, model_id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(model_id, name)

        # define inputs
        self.outputs['data'] = Output({'name': 'Data'})

        # define persistent variables
        self.data = None
コード例 #17
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['stock_ex_price'] = Input(name='Stock exchange price', unit='€/J', info="stock exchange price")
        self.inputs['distnet_costs'] = Input(name='Distribution network cost', unit='{-, €/J}', info="distribution network cost")
        self.inputs['service_cost'] = Input(name='Service cost', unit='€/J', info="service cost")
        self.inputs['taxes'] = Input(name='Taxes', unit='€/J', info="taxes")
        self.inputs['futures'] = Input(name='Futures', unit='s', info="Futures")

        # define outputs
        self.outputs['el_rate'] = Output(name='Electricity rate', unit='€/J', info='electricity rate')
        self.outputs['times'] = Output(name='Times', unit='s', info='Times')
        self.outputs['y_scaling'] = Output(name='Scaling of y axis', unit='', info='Scaling of y axis')
        self.outputs['y_unit'] = Output(name='Unit of y axis', unit='', info='Unit of y axis')
        self.outputs['y_label'] = Output(name='y label', unit='', info='Label of y axis')

        # define properties
        ET_def = {"location": ["Baden"],
                  "border": [[-1.0, -0.5, -0.2, 0.0, 0.2, 0.5, 1.0]],
                  "weight": [[-0.3, -0.6, -0.8, 1.1, 1.3, 1.5]]}
        NT_def = {"location": ["Baden"],
                  "border": [[-1.0, -0.8, -0.5, 0.0, 0.4, 0.8, 1.0]],
                  "weight": [[-0.5, -0.6, -0.8, 1.2, 1.5, 1.8]]}
        ET_def = json.dumps(ET_def)
        NT_def = json.dumps(NT_def)
        self.properties['weight_ET'] = Property(default=ET_def, data_type=str, name='energy tiers', unit='-',
                                                info='borders and weights of energy tiers', example=ET_def)
        self.properties['weight_NT'] = Property(default=NT_def, data_type=str, name='net tiers', unit='-',
                                                info='borders and weights of net tiers', example=NT_def)
        self.properties["scaling"] = Property(default=1, data_type=float, name='Scaling factor', unit='-',
                                              info='Scaling factor for y axis', example='3.6e9')
        self.properties["y_unit"] = Property(default='€/MWh', data_type=str, name='unit of y label', unit='-',
                                             info='Unit of label for y axis', example='[€/MWh]')
        self.properties["y_labeling"] = Property(default='Price', data_type=str, name='y label', unit='-',
                                                 info='Label for y axis', example='Price [€/MWh]')

        # define persistent variables
        self.weight_ET = None
        self.weight_NT = None
        self.y_scaling = None
        self.y_unit = None
        self.y_labeling = None
コード例 #18
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['in'] = Input(name='Numbers',
                                  unit='any',
                                  info='number or number array')

        self.outputs['sin'] = Output(name='Sin',
                                     unit='any',
                                     info='number or number array')
コード例 #19
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.start_time_of_curr_interval = 0
        self.start_time_of_next_interval = 0
        self.simulation_time = 0
        self.async_future = None

        self.outputs['step'] = Output('Step', unit='-', info='step number, starts with 0')
        self.outputs['time'] = Output('Future', unit='s', info='utc time in seconds since epoch')

        # control
        self.properties['prep_lead'] = Property('Time lead of Preperation step', default=0, data_type=int, unit='s', info='Amount of seconds the preparation step is started before the actual interval')
        self.properties['sim_speed'] = Property('Simulation speed', default=1, data_type=int, unit='s', info='Seconds between simulation runs, 0 = as fast as possible')

        # Simulation
        self.properties['date_start'] = Property('Simulation Start (UTC)', default="2018-01-01 00:00", data_type=str, unit='YYYY-MM-DD hh:mm')
        self.properties['date_delta_time'] = Property('Simulation time increase', default=1, data_type=float, unit='s', info='Amount of seconds the simulation time increases with each iteration')
        self.properties['date_end'] = Property('Simulation Stop (UTC)', default="2999-01-01 00:00", data_type=str, unit='YYYY-MM-DD hh:mm')
コード例 #20
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)
        self.outputs['const'] = Output('Number', unit='float')

        self.properties['number'] = Property(
            name='Number',
            default=0,
            data_type=float,
            unit='float',
            info='the constant number that gets set as output')
コード例 #21
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['weather'] = Input('WeatherData', unit='Global radiations[W/m^2]', info='dict')
        self.inputs['kwDaten'] = Input('PowerPlantsData', info='dict, power plant id required')

        # define outputs
        self.outputs['load'] = Output('Load', info='load of all photovoltaic power plants, value[0-1]')
コード例 #22
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['weather'] = Input('WeatherData', unit='Wind speed[m/s], Wind measurement height[m]', info='dict')
        self.inputs['kwDaten'] = Input('PowerPlantsData',unit='Hub-height[m], Ground roughness length[m]', info='dict')

        # define outputs
        self.outputs['load'] = Output('Load', info='load of all wind turbines, value[0-1]')
コード例 #23
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)

        self.inputs['input'] = Input('Input')

        self.outputs['output'] = Output('Output')

        self.properties['sleep_amount'] = Property('Sleep Amount',
                                                   default=1,
                                                   data_type=float,
                                                   unit='s')
コード例 #24
0
    def __init__(self, model_id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(model_id, name)

        # define inputs
        self.inputs['KWDaten'] = Input('PowerPlantsData',
                                       unit='[€/J]',
                                       info='complete power plant information')

        # define outputs
        self.outputs['Grenzkosten'] = Output('MarginalCost', unit='[€/J]')
コード例 #25
0
    def __init__(self, uuid, name: str):
        super(Model, self).__init__(uuid, name)
        self.outputs['const1'] = Output({
            'name': 'Number1',
            'unit': 'int',
            'dimensions': []
        })
        self.outputs['const2'] = Output({
            'name': 'Number2',
            'unit': 'int',
            'dimensions': []
        })

        self.properties['number1'] = Property(default=0,
                                              data_type=float,
                                              name='Number 1',
                                              unit='-')
        self.properties['number2'] = Property(default=0,
                                              data_type=float,
                                              name='Number 2',
                                              unit='-')
コード例 #26
0
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['futures'] = Input(
            'Futures', unit='s', info='utc time array in seconds since epoch')
        self.inputs['kwDaten'] = Input('PowerPlantsData',
                                       info='dict, power plant id required ')

        # define outputs
        self.outputs['load'] = Output(
            'Load', info='load of all running-water power plants, value[0-1]')
コード例 #27
0
    def __init__(self, model_id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(model_id, name)

        # define inputs
        self.inputs['t'] = Input('Zeit')

        # define outputs
        self.outputs['kw_park'] = Output('Kraftwerkspark')

        # define persistent variables
        self.db = None
        self.kwp = None
コード例 #28
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, model_id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(model_id, name)

        # define inputs
        self.inputs['v'] = Input('wind speed')
        self.inputs['dir'] = Input('wind direction')

        # define outputs
        self.outputs['p_el'] = Output('electrical power')
        self.outputs['f_rot'] = Output('rotor frequency')

        # define properties
        self.properties['h_hub'] = Property('hub height',
                                            default=10,
                                            data_type=float)
        self.properties['d'] = Property('diameter',
                                        default=10,
                                        data_type=float)

        # define persistent variables
        self.pers_variable_0 = 5
コード例 #29
0
ファイル: model.py プロジェクト: schmocker/Pyjamas
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['AuslastungallerKWs'] = Input(
            'CombinedLoad',
            info='combined load of all types of power plants, value[0-1]')
        self.inputs['KWDaten'] = Input('PowerPlantsData',
                                       unit='capex[€/W], spez_opex[1/s]',
                                       info='dict')

        # define outputs
        self.outputs['opex'] = Output('OPEX', unit='[€/J]')
コード例 #30
0
    def __init__(self, id, name: str):
        # instantiate supermodel
        super(Model, self).__init__(id, name)

        # define inputs
        self.inputs['CombinedLoad'] = Input(
            'CombinedLoad',
            info='combined load of all types of power plants, value[0-1]')
        self.inputs['KWDaten'] = Input('PowerPlantsData',
                                       unit='W',
                                       info='dict, power will be extracted')

        # define outputs
        self.outputs['scaled_power'] = Output('Power', unit='W')