Module simpa.core

Class TrajectoryObserver

java.lang.Object
simpa.core.api.track.TrajectoryObserver
All Implemented Interfaces:
TrackingObserver

public class TrajectoryObserver extends Object implements TrackingObserver
Object that can be added as an observer to a ParticleTrackerTask. It writes the coordinates of the particle every steps to a file.
  • Constructor Details

    • TrajectoryObserver

      public TrajectoryObserver(TrackingObserver.ObserverBehaviour behaviour, boolean debugFields)
      Constructor. Writes the trajectory of the particle to a file.
      Parameters:
      behaviour - Determines how the observer behaves.
      debugFields - If true, the magnetic and electric field values are also written to the file.
  • Method Details

    • observe

      public void observe(Particle p)
      Description copied from interface: TrackingObserver
      Observe the particle using this observer.
      Specified by:
      observe in interface TrackingObserver
      Parameters:
      p - - Particle to observe
    • finish

      public void finish(Particle p)
      Description copied from interface: TrackingObserver
      Finishes the tracking of the given particle.
      Specified by:
      finish in interface TrackingObserver
      Parameters:
      p - the particle to stop tracking
    • isPrintStepNumbers

      public boolean isPrintStepNumbers()
      Gets the printStepNumbers boolean.
      Returns:
      The printStepNumbers boolean
    • setPrintStepNumbers

      public void setPrintStepNumbers(boolean printStepNumbers)
      Sets the boolean whether step numbers should be printed to the console.
      Parameters:
      printStepNumbers - if step numbers should be printed, set this to true.
    • isDebugFields

      public boolean isDebugFields()
      Returns:
      True if the debug fields option is enabled.
    • getTrajectoryDatas

      public List<TrajectoryData> getTrajectoryDatas()
      Returns:
      List of the trajectory steps.