我知道我们可以使用animatemonitor来同步监视器对象值的实时值,并在内置的display/gui上显示为图形,但我需要在浏览器的另一个图形中使用这些值/plot。所以我需要那些实时同步的原始数据。有可能吗?
您可以启动动画(可能有一个最小化的窗口,没有进一步的功能(,并创建自己的Environment.animation_pre_tick()
方法,该方法会以另一种方式发出您想要显示的值。
类似于:
import salabim as sim
class RealTimeEnvironment(sim.Environment):
def animation_pre_tick(self, t):
... # put your emitting code here at time=t
env = RealTimeEnvironment()
env.animate(True)
env.run(sim.inf)