Generate the next sample for the condorcet model. This algorithm is described in "Computing
        Optimal Bayesian Decisions for Rank Aggregation via MCMC Sampling," and is adapted from 
        code written by Lirong Xia.
        
        :ivar list<list<int> V: A two-dimensional list that for every pair of candidates cand1 and 
            cand2, V[cand1][cand2] contains 1 if cand1 is ranked above cand2 more times than cand2
            is ranked above cand1 and 0 otherwise.

def getNextSample(self, V):
        """
        Generate the next sample for the condorcet model. This algorithm is described in "Computing
        Optimal Bayesian Decisions for Rank Aggregation via MCMC Sampling," and is adapted from 
        code written by Lirong Xia.
        
        :ivar list<list<int> V: A two-dimensional list that for every pair of candidates cand1 and 
            cand2, V[cand1][cand2] contains 1 if cand1 is ranked above cand2 more times than cand2
            is ranked above cand1 and 0 otherwise.
        """

        cands = range(len(self.wmg))
        W = copy.deepcopy(V)
        allPairs = itertools.combinations(cands, 2)
        for pair in allPairs:
            a = pair[0]
            b = pair[1]
            if random.random() < 1.0/(1.0+pow(self.phi,self.wmg[a+1][b+1])):
                W[a][b] = 1
                W[b][a] = 0
            else:
                W[a][b] = 0
                W[b][a] = 1
        prMW = 1
        prMV = 1
        prob = min(1.0, prMW/prMV)
        if random.random() <= prob:
            V = W
        return V