Esempio n. 1
0
 def add_specified_stock_measures(self):
     self.specified_stocks = {}
     specified_stock_ids = self.scenario.get_measures('DemandStockMeasures', self.subsector_id, self.id)
     for specified_stock_id in specified_stock_ids:
         self.specified_stocks[specified_stock_id] = SpecifiedStock(id=specified_stock_id,
                                                                 sql_id_table='DemandStockMeasures',
                                                                 sql_data_table='DemandStockMeasuresData',
                                                                 scenario=self.scenario)
 def add_specified_stock_measures(self, package_id):
     self.specified_stocks = {}
     measure_ids = util.sql_read_table('DemandStockMeasurePackagesData', 'measure_id', package_id=package_id,
                                       return_iterable=True)
     for measure_id in measure_ids:
         specified_stocks = util.sql_read_table('DemandStockMeasures', 'id', demand_tech_id=self.id,
                                                subsector_id=self.subsector_id, package_id=package_id,
                                                return_iterable=True)
         for specified_stock in specified_stocks:
             self.specified_stocks[specified_stock] = SpecifiedStock(id=specified_stock,
                                                                     subsector_id=self.subsector_id,
                                                                     sql_id_table='DemandStockMeasures',
                                                                     sql_data_table='DemandStockMeasuresData')
Esempio n. 3
0
 def __init__(self, id, sql_id_table, sql_data_table):
     SpecifiedStock.__init__(self, id, sql_id_table, sql_data_table)
Esempio n. 4
0
 def __init__(self, id, sql_id_table, sql_data_table):
     SpecifiedStock.__init__(self, id, sql_id_table, sql_data_table)