Record Class SimulationSnapshot<T>
java.lang.Object
java.lang.Record
edu.cnu.mdi.mdi3D.view3D.kineticsDemo.SimulationSnapshot<T>
- Type Parameters:
T- the entity type, ifentities()is populated- Record Components:
entities- optional per-entity data corresponding tocoords(); may benullcoords- packed particle positions as[x1, y1, z1, x2, y2, z2, ...]time- simulation time at which the snapshot was takenentropy- 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
ConstructorsConstructorDescriptionSimulationSnapshot(List<T> entities, float[] coords, float time, float entropy) Creates an instance of aSimulationSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloat[]coords()Returns the value of thecoordsrecord component.entities()Returns the value of theentitiesrecord component.floatentropy()Returns the value of theentropyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floattime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
entities
Returns the value of theentitiesrecord component.- Returns:
- the value of the
entitiesrecord component
-
coords
public float[] coords()Returns the value of thecoordsrecord component.- Returns:
- the value of the
coordsrecord component
-
time
public float time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
entropy
public float entropy()Returns the value of theentropyrecord component.- Returns:
- the value of the
entropyrecord component
-