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()
评论列表
文章目录