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')
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')
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
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
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
def __init__(self, uuid, name: str): super(Model, self).__init__(uuid, name) self.inputs['data'] = Input(name='Data', unit='any', info='Data to be published must be convertible to json') self.properties['host'] = Property(default='iot.eclipse.org', data_type=str, name='Broker Address', unit='-', info='string') self.properties['port'] = Property(default=1883, data_type=int, name='Broker Port', unit='-', info='int, usually 1883 for MQTT') self.properties['topic'] = Property(default='pyjamas.db', data_type=str, name='Topic', unit='-', info='string') self.client = None self.host = None self.port = None self.topic = None self.keepalive = 60
def __init__(self, uuid, name: str): super(Model, self).__init__(uuid, name) self.outputs['text'] = Output('Text') self.properties['slide_amount'] = Property('Slide Amount', default=1, data_type=int) self.properties['window_size'] = Property('Window Size', default=10, data_type=int) self.properties['full_text'] = Property('Text', default="Hello World! ", data_type=str) self.curr_pos = 0
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
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs self.inputs['Futures'] = Input(name='Futures', unit='s', info="Futures") self.inputs['Staos'] = Input(name='Distribution networks', unit='-', info="Distribution networks") self.inputs['Market_price'] = Input(name='Market price', unit='€/J', info="Market price") self.inputs['KW_data'] = Input(name='KW data', unit='-', info="KW data") self.inputs['Tiers_prices'] = Input(name='Tiers prices', unit='€/J', info="Tiers prices") # define outputs #self.outputs['KW_weather'] = Output(name='Weather data of KWs', unit='dict{id, windspeed, radiation, windmesshoehe}', info='weather data of KWs') # define properties 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') # Define persistent variables self.date_start = None self.date_delta = None self.date_end = None
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')
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
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')
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')
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')
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')
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='-')
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
def __init__(self, uuid, name: str): super(Model, self).__init__(uuid, name) self.elapsed = 0 self.outputs['num_elapsed'] = Output('Number Elapsed', unit='int') self.properties["number_of_exec"] = Property('Number of Executions', default=-1, data_type=float, unit='int') self.properties["peri_interval"] = Property('Peri Interval', default=0, data_type=float, unit='num') self.properties["prep_lead"] = Property('Prep lead', default=0, data_type=float, unit='num') self.properties["post_delay"] = Property('Post delay', default=0, data_type=float, unit='num')
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs self.inputs['Futures'] = Input(name='Futures', unit='s', info="Futures") #self.inputs['Weather'] = Input(name='Weather', unit='-', info="Weather") self.inputs['Demand'] = Input(name='Demand', unit='W', info="Demand") self.inputs['Power'] = Input(name='Power', unit='W', info="Power loads of KW's") # define outputs #self.outputs['KW_weather'] = Output(name='Weather data of KWs', unit='dict{id, windspeed, radiation, windmesshoehe}', info='weather data of KWs') # define properties 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') # Define persistent variables self.date_start = None self.date_delta = None self.date_end = None
def __init__(self, uuid, name: str): super(Model, self).__init__(uuid, name) self.step = 0 self.current_time = 0 self.future = 0 self.async_future = None self.outputs['time'] = Output('Time', unit='s', info='utc time in seconds since epoch') self.outputs['step'] = Output('Step', unit='-', info='step number, starts with 0') self.properties["mode"] = Property(name='Mode', default='live', data_type=str, unit='-', info='live or simulation') self.properties["time_increase"] = Property('Time increase', default=1, data_type=float, unit='s', info='Time increase with each iteration') # Live # Simulation self.properties["sim_speed"] = Property('Simulation speed', default=0, data_type=float, unit='s', info='Time between iteration, simulation mode only, 0 = as fast as possible') self.properties["sim_start"] = Property('Simulation Start (UTC)', default="2018-01-01 00:00", data_type=str, unit='YYYY-MM-DD hh:mm')
def __init__(self, model_id, name: str): # instantiate supermodel super(Model, self).__init__(model_id, name) # define inputs self.inputs['KWData'] = Input(name='Power Plant', unit='-', info='European Power Plant') self.inputs['Locations'] = Input(name='Locations', unit='-', info='Locations with geographical coordinates') # define outputs self.outputs['DistanceFactor'] = Output(name='DistanceFactor', unit='[€/km*MWh]', info='Distance factor') # define properties self.properties['NetworkCost'] = Property(default=148E9, data_type=float, name='Network cost', unit='€', info="Network cost * annual amount of energy", example='148*10^9 € (Mittelspannung, Churwalden 2017)') # define persistent variables self.NetworkCost = None
def __init__(self, model_id, name: str): # instantiate supermodel super(Model, self).__init__(model_id, name) # define inputs self.inputs['Standorte'] = Input('SPGLocations', info='dict containing location names and coordinates [lat/lon] of SPGs') self.inputs['KWDaten'] = Input('PowerPlantsData', info='dict containing power plant information, including coordinates') # define outputs self.outputs['Distanzkosten'] = Output('DistanceCost', unit='[€/m*J]') # define properties self.properties['dis_factor'] = Property('DistanceFactor', default=0.021, data_type=float, unit='[€/km*MWh]') self.DistanzFaktor = None
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='-', info='distribution networks') self.inputs['futures'] = Input(name='futures networks', unit='s', info='futures') # define outputs self.outputs['dist_cost'] = Output(name='distribution cost', unit='undet', info='distribution cost') # define properties cost_constant_def = [100] 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='-', info='constant distribution costs', example='[100, 110, 120]') # persistent variables self.cost_constant = None
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs # define outputs self.outputs['taxes'] = Output(name='Taxes', unit='€/J', info='Taxes') # define properties self.properties['tax'] = Property(default=3600, data_type=float, name='taxes', unit='€/km*MWh', info="taxes", example='3600') # define persistent variables self.taxes = None
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs # define outputs self.outputs['distNets'] = Output(name='Distribution Networks', unit='{Location: [], Latidude: [], Longitude []}', info='Distribution Networks with their location, latitude and longitude') # define properties # - distribution network self.properties['distNets'] = Property(default='{"Baden": {"Lat": 47.47256, "Lon": 8.30850}}', data_type=str, name='distribution network', unit='-', info="Distribution network with lon and lat", example='{"Baden": {"Lat": 47.47256, "Lon": 8.30850}, ' '"Brugg": {"Lat": 47.48420, "Lon": 8.20706}, ' '"Olten": {"Lat": 47.35212, "Lon": 7.90801}}') # define persistent variables self.distNets = None
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs # define outputs self.outputs['service_cost'] = Output(name='Service costs', unit='€/J', info='Service costs') # define properties self.properties['serv_cost'] = Property(default=7200, data_type=float, name='service costs', unit='€/km*MWh', info="service costs", example='7200') # define persistent variables self.service_cost = None
def __init__(self, id, name: str): # instantiate supermodel super(Model, self).__init__(id, name) # define inputs self.inputs['futures'] = Input(name='Futures', unit='s', info="time array in utc [s]") # define outputs self.outputs['p_dem'] = Output(name='Power demand', unit='W', info="power demand of UCTE in W") # define properties self.properties['offset'] = Property(default=0, data_type=float, name='demand offset', unit='%', info="offset of demand in %", example='100: doubles the value') # define persistent variables self.model_para = None
def __init__(self, uuid, name: str): super(Model, self).__init__(uuid, name) self.properties['stop_after'] = Property('Number of runs', default=1, data_type=int)
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['is_live'] = Output( 'Is live', info='True if the current mode is live') self.outputs['step'] = Output('Step', unit='-', info='step number, starts with 0') self.outputs['times'] = Output( 'Futures', unit='s', info='utc time array in seconds since epoch') self.properties['mode'] = Property('Mode', default='live', data_type=str, unit='-', info='live or simulation') # 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['real_time_increase'] = Property( 'Real time between each interval run', default=1, data_type=int, unit='s', info='Real time between iteration, 0 = as fast as possible') # Simulation self.properties['simu_time_increase'] = Property( 'Simulation time increase', default=1, data_type=float, unit='s', info= 'Amount of seconds the simulation time increases with each iteration' ) self.properties['simu_start_time'] = Property( 'Simulation Start (UTC)', default="2018-01-01 00:00", data_type=str, unit='YYYY-MM-DD hh:mm') # futures self.properties['future_steps_amount'] = Property( 'Number of Future steps', default=1, data_type=int, unit='-', info='Number of time stamps') self.properties['future_time_increase'] = Property( 'Time increase with each Future', default=0, data_type=float, unit='s', info='Time increase with each iteration') # stop self.properties['simu_stop_time'] = Property( 'Simulation Stop (UTC)', default="2999-01-01 00:00", data_type=str, unit='YYYY-MM-DD hh:mm') self.properties['simu_number_of_intervals'] = Property( 'Number of Simulation intervals', default=-1, data_type=int)