[docs]classTrajectoryWriter(metaclass=abc.ABCMeta):"""Interface for trajectory serialization"""@abc.abstractmethod
[docs]defbegin_writing(self,simulation)->None:"""Begin writing trajectory data. This method is intended to handle all data writing that has to be done once before the trajectory data can be written. E.g. Meta information such as frame rate etc... """raiseNotImplementedError
@abc.abstractmethod
[docs]defwrite_iteration_state(self,simulation)->None:"""Write trajectory data of one simulation iteration. This method is intended to handle serialization of the trajectory data of a single iteration. """raiseNotImplementedError
@abc.abstractmethod
[docs]defevery_nth_frame(self)->int:"""Returns the interval of this writer in frames between writes. 1 indicates all frames are written, 10 indicates every 10th frame is writen and so on. Returns: Number of frames between writes as int """
classException(Exception):"""Represents exceptions specific to the trajectory writer."""pass