def _sim_function(self, queue):
"""Simulation function to be started as a separate process.
Args:
queue: Instance of multiprocessing.Queue that is used to transfer data between
simulation and visualization process.
"""
for ii in range(int(self.field.t.samples / self.steps_per_frame)):
self.field.simulate(self.steps_per_frame)
queue.put((self.field.t.vector[self.field.step],
getattr(self.field, self.observed_component).values))
# return field when simulation finishes to get output signals
queue.put(self.field)
评论列表
文章目录