Run the sampler, store the history of visited points into
        the member variable ``self.samples`` and the importance weights
        into ``self.weights``.

        .. seealso::
            :py:class:`pypmc.tools.History`

        :param N:

            Integer; the number of samples to be drawn.

        :param trace_sort:

            Bool; if True, return an array containing the responsible
            component of ``self.proposal`` for each sample generated
            during this run.

            .. note::

                This option only works for proposals of type
                :py:class:`pypmc.density.mixture.MixtureDensity`

            .. note::

                If True, the samples will be ordered by the components.

def run(self, N=1, trace_sort=False):
        '''Run the sampler, store the history of visited points into
        the member variable ``self.samples`` and the importance weights
        into ``self.weights``.

        .. seealso::
            :py:class:`pypmc.tools.History`

        :param N:

            Integer; the number of samples to be drawn.

        :param trace_sort:

            Bool; if True, return an array containing the responsible
            component of ``self.proposal`` for each sample generated
            during this run.

            .. note::

                This option only works for proposals of type
                :py:class:`pypmc.density.mixture.MixtureDensity`

            .. note::

                If True, the samples will be ordered by the components.

        '''
        if N == 0:
            return 0

        if trace_sort:
            this_samples, origin = self._get_samples(N, trace_sort=True)
            self._calculate_weights(this_samples, N)
            return origin
        else:
            this_samples = self._get_samples(N, trace_sort=False)
            self._calculate_weights(this_samples, N)