Class TaskState<T extends Serializable>
java.lang.Object
org.episteme.core.distributed.TaskState<T>
- Type Parameters:
T- the type of the high-precision (REAL) state
- All Implemented Interfaces:
Serializable
Manages data state across different precision modes (FLOAT, DOUBLE, REAL).
This class ensures that modifications in one precision mode are correctly propagated to others when needed, while minimizing expensive conversions.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]float[]getFloat()getReal()voidsetDouble(double[] buffer) voidsetFloat(float[] buffer) voidvoidMarks the current buffer as the new authority and syncs back to Real.voidsyncTo(TaskRegistry.PrecisionMode target) Synchronizes all buffers to the target mode.
-
Constructor Details
-
TaskState
-
-
Method Details
-
syncTo
Synchronizes all buffers to the target mode.- Parameters:
target- the mode that needs to be up-to-date
-
syncFrom
Marks the current buffer as the new authority and syncs back to Real. Call this after manual modifications to a primitive buffer.- Parameters:
mode- the mode that was modified
-
getReal
-
getDouble
public double[] getDouble() -
getFloat
public float[] getFloat() -
setReal
-
setDouble
public void setDouble(double[] buffer) -
setFloat
public void setFloat(float[] buffer)
-