OFSP.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PyME 作者: vikramsunkara 项目源码 文件源码
def plot_checked(self):
        import pylab as pl
        pl.ioff()
        from statistics import expectation
        exp = []

        # The expectation plotter
        if len(self._stored_t) != 0:
            pl.figure(2)
            pl.title(" Method %s"%("OFSP"))
            pl.xlabel("Time, t")
            pl.ylabel("Expectation")

            for i in range(len(self._stored_t)):
                exp.append(expectation((self._stored_domain_states[i],self._stored_p[i])))

            EXP = np.array(exp).T

            for i in range(EXP.shape[0]):
                pl.plot(self._stored_t,EXP[i,:],'x-',label=self.model.species[i])
            pl.legend()

        # The probability plotter
        if len(self._probed_t) != 0:
            pl.figure(3)
            pl.title(" Method %s | Probing States over Time "%("OFSP"))
            pl.xlabel("Time, t")
            pl.ylabel("Probability")

            probs = np.array(self._probed_probs).T

            for i in range(probs.shape[0]):
                pl.plot(self._probed_t,probs[i,:],'x-',label=str(self._probed_states[0][:,i]))
            pl.legend()

        pl.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号