예제 #1
0
    def generate_mc(self, states, window, T):
        # set transition
        p = np.array([[0.2, 0.8], [0.6, 0.4]])
        mc = MarkovChain(p, states)

        # set of transions
        transitions = mc.walk(int(T / window))
        data = []
        for i in range(len(transitions)):
            for c in self.generate_zipf(float(transitions[i]), window):
                data.append(c)
        return data
예제 #2
0
    def generate_mc(self, states, window, T, available=False):
        # set transition
        p = np.array([[0.4, 0.6], [0.75, 0.25]])
        mc = MarkovChain(p, states)

        # set of transions
        transitions = mc.walk(int(T / window))
        data = [];
        for transition in range(len(transitions)):
            for c in self.generate_zipf(float(transitions[transition]), window, transition=transition,
                                        available=available):
                data.append(c)
        return data