Record Class SimulationSnapshot<T>

java.lang.Object
java.lang.Record
edu.cnu.mdi.mdi3D.view3D.kineticsDemo.SimulationSnapshot<T>
Type Parameters:
T - the entity type, if entities() is populated
Record Components:
entities - optional per-entity data corresponding to coords(); may be null
coords - packed particle positions as [x1, y1, z1, x2, y2, z2, ...]
time - simulation time at which the snapshot was taken
entropy - entropy value at the time of the snapshot

public record SimulationSnapshot<T>(List<T> entities, float[] coords, float time, float entropy) extends Record
Optimized snapshot containing raw coordinates for OpenGL.

Rendering uses only coords(); entities() is not currently populated by KineticsModel.getSnapshot() (callers pass null) but is retained as a typed hook for a future renderer that needs per-particle data rather than just packed positions.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SimulationSnapshot(List<T> entities, float[] coords, float time, float entropy)
    Creates an instance of a SimulationSnapshot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    Returns the value of the coords record component.
    Returns the value of the entities record component.
    float
    Returns the value of the entropy record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the time record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SimulationSnapshot

      public SimulationSnapshot(List<T> entities, float[] coords, float time, float entropy)
      Creates an instance of a SimulationSnapshot record class.
      Parameters:
      entities - the value for the entities record component
      coords - the value for the coords record component
      time - the value for the time record component
      entropy - the value for the entropy record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entities

      public List<T> entities()
      Returns the value of the entities record component.
      Returns:
      the value of the entities record component
    • coords

      public float[] coords()
      Returns the value of the coords record component.
      Returns:
      the value of the coords record component
    • time

      public float time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • entropy

      public float entropy()
      Returns the value of the entropy record component.
      Returns:
      the value of the entropy record component