Ejemplo n.º 1
0
    def next_value(self):
        """ Make a merw step """
        if self.is_merw:
            # Probabilism
            probabilities = self.S[self.current_id, :]

            # Get next ID
            next_id = up.randomly_draw(self.id_space, probabilities)
            self.current_id = next_id
        else:
            # Determinism
            self.current_id = self.cyclic_ids.next()

        # Update histogram
        # Here is the only change wrt parent next_value() function
        global_current_id = self.global_id(self.current_id)
        self.histogram[global_current_id] += 1

        # Return value
        return self.values[self.current_id]
Ejemplo n.º 2
0
    def next_value(self):
        """ Make a merw step """
        if self.is_merw:
            # Probabilism
            probabilities = self.S[self.current_id, :]

            # Get next ID
            next_id = up.randomly_draw(self.id_space, probabilities)
            self.current_id = next_id
        else:
            # Determinism
            self.current_id = self.cyclic_ids.next()

        # Update histogram
        # Here is the only change wrt parent next_value() function
        global_current_id = self.global_id(self.current_id)
        self.histogram[global_current_id] += 1

        # Return value
        return self.values[self.current_id]
Ejemplo n.º 3
0
    def next_value(self):
        """ Make a merw step """
        if self.is_merw:
            # Probabilism
            # self.update_S()
            # probabilities = self.S[:, self.current_id]
            probabilities = self.S[self.current_id, :]

            # Get next ID
            next_id = up.randomly_draw(self.id_space, probabilities)
            self.current_id = next_id
        else:
            # Determinism
            self.current_id = self.cyclic_ids.next()

        # Update histogram
        self.histogram[self.current_id] += 1

        # Return value
        return self.values[self.current_id]
Ejemplo n.º 4
0
    def next_value(self):
        """ Make a merw step """
        if self.is_merw:
            # Probabilism
            # self.update_S()
            # probabilities = self.S[:, self.current_id]
            probabilities = self.S[self.current_id, :]

            # Get next ID
            next_id = up.randomly_draw(self.id_space, probabilities)
            self.current_id = next_id
        else:
            # Determinism
            self.current_id = self.cyclic_ids.next()

        # Update histogram
        self.histogram[self.current_id] += 1

        # Return value
        return self.values[self.current_id]