Class GTUDumper


  • public class GTUDumper
    extends java.lang.Object
    GTUDUmper; create a text file with the locations, directions and speeds of all GTUs at regular intervals.

    Copyright (c) 2019-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version July 5, 2019
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Summary

      Constructors 
      Constructor Description
      GTUDumper​(Time firstDumpTime, Duration interval, OTSNetwork network, java.lang.String fileNamePrefix)
      Construct a new GTUDumper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump()
      Write all GTU positions in a file.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GTUDumper

        public GTUDumper​(Time firstDumpTime,
                         Duration interval,
                         OTSNetwork network,
                         java.lang.String fileNamePrefix)
                  throws SimRuntimeException
        Construct a new GTUDumper.
        Parameters:
        firstDumpTime - Time; the time of the first dump
        interval - Duration; the interval until each subsequent dump
        network - OTSNetwork; the network (that will contain the GTUs to dump)
        fileNamePrefix - String; directory and first part if the file names; the simulation time of the dump will be appended to the file name. The file type will be .txt
        Throws:
        SimRuntimeException - when scheduling the first dump time fails
    • Method Detail

      • dump

        public void dump()
        Write all GTU positions in a file.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object