Interface SnapshotWriter

  • All Known Implementing Classes:
    KmlSnapshotWriter, TransimsSnapshotWriter

    public interface SnapshotWriter
    Interface to implement custom snapshot writers. A snapshot contains information about agents (location, speed) at a specific moment in time. Depending on the format, multiple snapshots can be stored in one file. A snapshot writer should implement a custom constructor to initialize it. For each snapshot, first the method beginSnapshot() will be called, followed by several calls to addAgent() and a final call to endSnapshot(). When no more snapshots will have to be written, finish() is called.
    Author:
    mrieser
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAgent​(AgentSnapshotInfo position)
      Adds an agent to the current snapshot.
      void beginSnapshot​(double time)
      Tells the snapshot writer that a new snapshot begins at the specified time.
      void endSnapshot()
      Tells the snapshot writer that no more vehicles will be added to the current snapshot.
      void finish()
      Tells the snapshot writer that no more snapshots will be added ("destructor").
    • Method Detail

      • beginSnapshot

        void beginSnapshot​(double time)
        Tells the snapshot writer that a new snapshot begins at the specified time.
        Parameters:
        time - The time of the snapshot.
      • endSnapshot

        void endSnapshot()
        Tells the snapshot writer that no more vehicles will be added to the current snapshot.
      • addAgent

        void addAgent​(AgentSnapshotInfo position)
        Adds an agent to the current snapshot.
        Parameters:
        position - The position, id, and speed of the agent.
      • finish

        void finish()
        Tells the snapshot writer that no more snapshots will be added ("destructor").