Пример #1
0
 def set_config(self, **kwargs):
     """
     Configures the ScenarioSimulation
     
     Parameters
     ----------
     scenario : a Scenario instance. By default, None selects Scenario()
     country  : a string containing the name of the country
     param_file : the socio-fiscal parameters file
     totaux_file : the totaux file
     xaxis : the revenue category along which revenue varies
     maxrev : the maximal value of the revenue
     nmen : the number of different households
     same_rev_couple : divide the revenue equally between the two partners
     mode : 'bareme' or 'castype' TODO: change this 
     """
     
     specific_kwargs = self._set_config(**kwargs)
     self.Scenario = of_import('utils', 'Scenario', country = self.country)
     
     if self.scenario is None:
         try:                
             self.scenario = kwargs['scenario']
         except:
             self.scenario = self.Scenario()
             self.scenario_seuls = self.Scenario()
             
     self.scenario.year = self.datesim.year
     self.scenario_seuls.year = self.datesim.year
     
     for key, val in specific_kwargs.iteritems(): 
         if hasattr(self, key):
             setattr(self, key, val)
Пример #2
0
 def apply_plugin_settings(self, options):
     """
     Apply configuration file's plugin settings
     """
             
     if 'data_file' in options:
         NotImplementedError
    
     if 'use_default' in options:     
         from src.lib.utils import of_import
         default_profiles_filename = of_import("","DEFAULT_PROFILES_FILENAME", self.simulation.country)
         self.simulation.load_profiles(default_profiles_filename)
         self.refresh_plugin()