Beispiel #1
0
    def simBirth(self, which_agents):
        '''
        Makes new consumers for the given indices.  Slightly extends base method by also setting
        pLvlErrNow = 1.0 for new agents, indicating that they correctly perceive their productivity.

        Parameters
        ----------
        which_agents : np.array(Bool)
            Boolean array of size self.AgentCount indicating which agents should be "born".

        Returns
        -------
        None
        '''
        AggShockConsumerType.simBirth(self, which_agents)
        if hasattr(self, 'pLvlErrNow'):
            self.pLvlErrNow[which_agents] = 1.0
        else:
            self.pLvlErrNow = np.ones(self.AgentCount)
Beispiel #2
0
    def simBirth(self, which_agents):
        '''
        Makes new consumers for the given indices.  Slightly extends base method by also setting
        pLvlErrNow = 1.0 for new agents, indicating that they correctly perceive their productivity.

        Parameters
        ----------
        which_agents : np.array(Bool)
            Boolean array of size self.AgentCount indicating which agents should be "born".

        Returns
        -------
        None
        '''
        AggShockConsumerType.simBirth(self, which_agents)
        if hasattr(self, 'pLvlErrNow'):
            self.pLvlErrNow[which_agents] = 1.0
        else:  # This only triggers at the beginning of the very first simulated period
            self.pLvlErrNow = np.ones(self.AgentCount)
            self.t_since_update = np.zeros(self.AgentCount, dtype=int)