Ejemplo n.º 1
0
 def __init__(self, country, code, long_name='', treasury=None):
     if long_name == '':
         long_name = 'Central Bank {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name, has_F=True)
     self.Treasury = treasury
     # Demand for deposits = F + Supply of money (Central bank net worth plus money supply)
     self.AddVariable('DEM_DEP', 'Demand for deposits', 'F + SUP_MON')
Ejemplo n.º 2
0
 def __init__(self,
              external_sector,
              code='FX',
              long_name='Foreign Exchange Transactions'):
     Sector.__init__(self,
                     country=external_sector,
                     code=code,
                     long_name=long_name,
                     has_F=False)
Ejemplo n.º 3
0
 def __init__(self, country, code, long_name=''):
     if long_name == '':
         long_name = 'Government {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name)
     self.AddVariable('DEM_GOOD', 'Government Consumption of Goods', '0.0')
     self.AddVariable('PRIM_BAL', 'Government Primary Fiscal Balance',
                      'T - DEM_GOOD')
     self.AddVariable('FISC_BAL', 'Government Fiscal Balance', 'INC')
     self.AddVariable('T', 'Government Taxes', '0.')
Ejemplo n.º 4
0
 def __init__(self, country, code, long_name=''):
     if long_name == '':
         long_name = 'Treasury {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name)
     self.AddVariable('DEM_GOOD', 'Government Consumption of Goods', '0.0')
     self.AddVariable('PRIM_BAL', 'Government Primary Fiscal Balance',
                      'T - DEM_GOOD')
     # Treasury has no money holdings
     self.AddVariable('DEM_MON', 'Demand for Money', '0.0')
     self.AddVariable('T', 'Taxes received', '0.0')
Ejemplo n.º 5
0
 def __init__(self,
              country,
              code,
              long_name='',
              taxrate=0.0,
              taxes_paid_to='GOV'):
     if long_name == '':
         long_name = 'TaxFlow Object {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name, has_F=False)
     self.AddVariable('TaxRate', 'Tax rate', '%0.4f' % (taxrate, ))
     self.AddVariable('T', 'Taxes Paid', '')
     self.TaxingSector = taxes_paid_to
     self.TaxRate = taxrate
Ejemplo n.º 6
0
 def __init__(self,
              country,
              code,
              long_name='',
              profit_margin=0.0,
              labour_input_name='LAB',
              output_name='GOOD'):
     if long_name == '':
         long_name = 'Business {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name, has_F=True)
     self.ProfitMargin = profit_margin
     self.LabourInputName = labour_input_name
     self.OutputName = output_name
     self.AddVariable('SUP_' + output_name, 'Supply of goods', '')
     self.AddVariable('PROF', 'Profits',
                      'SUP_GOOD - DEM_' + labour_input_name)
Ejemplo n.º 7
0
 def __init__(self,
              country,
              code,
              long_name='',
              profit_margin=0.0,
              labour_input_name='LAB',
              market_list=()):
     if long_name == '':
         long_name = 'Multi-Output Business {0} in Country {1}'.format(
             code, country.Code)
     Sector.__init__(self, country, code, long_name=long_name, has_F=True)
     self.ProfitMargin = profit_margin
     self.LabourInputName = labour_input_name
     self.MarketList = market_list
     self.AddVariable('SUP', 'Total supply', '')
     for market in market_list:
         self.AddMarket(market)
     self.AddVariable('PROF', 'Profits',
                      'SUP - DEM_{0}'.format(labour_input_name))
     self.AddVariable('DEM_' + labour_input_name, 'Demand for labour.', '')
Ejemplo n.º 8
0
    def __init__(self,
                 external_sector,
                 code='GOLD',
                 long_name='International Gold Market'):
        """
        Object to handle international Gold transactions.

        It pushes variables onto transacting sectors; the only variables embedded in
        this object is PRICE (the price of 1 oz of gold in NUMERAIRE), and NET_OZ,
        which are the net transactions in OZ (should be zero normally).

        These variables are only created if SetGoldPurchases is called; so as to not
        clog the equation space of models that do not contain gold transactions.

        If users want to use this object without calling SetGoldSales, they can call
        SetUpVariables()
        :param code:
        """
        Sector.__init__(self,
                        country=external_sector,
                        code=code,
                        long_name=long_name,
                        has_F=False)
        self.Owner = 'Gnomes of Zurich'
Ejemplo n.º 9
0
    def __init__(self,
                 country,
                 code,
                 long_name='',
                 alpha_income=.6,
                 alpha_fin=.4,
                 consumption_good_name='GOOD'):
        """
        Describes SFC model typical household sector. Subclasses are need to specify
        income source.

        :param country: Country
        :param long_name: str
        :param code: str
        """
        if long_name == '':
            long_name = 'Household {0} in Country {1}'.format(
                code, country.Code)
        Sector.__init__(self, country, code, long_name=long_name, has_F=True)
        self.AlphaIncome = alpha_income
        self.AlphaFin = alpha_fin
        self.IsTaxable = True
        self.GetModel().AddCashFlowIncomeExclusion(
            self, 'DEM_' + consumption_good_name)
        self.AddVariable('AlphaIncome',
                         'Parameter for consumption out of income',
                         '%0.4f' % (self.AlphaIncome, ))
        self.AddVariable('AlphaFin',
                         'Parameter for consumption out of financial assets',
                         '%0.4f' % (self.AlphaFin, ))
        self.AddVariable('DEM_' + consumption_good_name,
                         'Expenditure on goods consumption',
                         'AlphaIncome * AfterTax + AlphaFin * LAG_F')
        # self.AddVariable('PreTax', 'Pretax income', 'SET IN DERIVED CLASSES')
        self.AddVariable('AfterTax', 'Aftertax income', 'INC - T')
        self.AddVariable('T', 'Taxes paid.', '')
Ejemplo n.º 10
0
 def __init__(self, external_sector):
     Sector.__init__(self,
                     country=external_sector,
                     code='XR',
                     long_name='Exchange Rate Info',
                     has_F=False)