java.lang.Object
simpa.core.api.track.TrajectoryObserver
- All Implemented Interfaces:
TrackingObserver
Object that can be added as an observer to a
ParticleTrackerTask
. It
writes the coordinates of the particle every steps to a file.-
Nested Class Summary
Nested classes/interfaces inherited from interface simpa.core.api.track.TrackingObserver
TrackingObserver.ObserverBehaviour
-
Constructor Summary
ConstructorsConstructorDescriptionTrajectoryObserver
(TrackingObserver.ObserverBehaviour behaviour, boolean debugFields) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Finishes the tracking of the given particle.boolean
boolean
Gets the printStepNumbers boolean.void
Observe the particle using this observer.void
setPrintStepNumbers
(boolean printStepNumbers) Sets the boolean whether step numbers should be printed to the console.
-
Constructor Details
-
TrajectoryObserver
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
Description copied from interface:TrackingObserver
Observe the particle using this observer.- Specified by:
observe
in interfaceTrackingObserver
- Parameters:
p
- - Particle to observe
-
finish
Description copied from interface:TrackingObserver
Finishes the tracking of the given particle.- Specified by:
finish
in interfaceTrackingObserver
- 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
- Returns:
- List of the trajectory steps.
-