Class ProcessDelta
java.lang.Object
neqsim.process.util.export.ProcessDelta
- All Implemented Interfaces:
Serializable
Represents the difference between two process snapshots.
Process deltas enable efficient synchronization of state changes between NeqSim and external systems, transmitting only changed values rather than full state.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProcessDelta(ProcessSnapshot from, ProcessSnapshot to) Creates a delta between two snapshots. -
Method Summary
Modifier and TypeMethodDescriptionapply(ProcessSnapshot base, String newId) Applies this delta to a snapshot to produce a new snapshot.private voidcomputeDifferences(ProcessSnapshot from, ProcessSnapshot to) Gets all changes as a map.doubleGets the change (delta) for a measurement.intGets the number of changed measurements.Gets all changed measurement names.Gets the source snapshot ID.doublegetNewValue(String name) Gets the new value for a measurement.doublegetPreviousValue(String name) Gets the previous value for a measurement.doublegetRelativeChange(String name) Gets the relative change for a measurement.Gets the target snapshot ID.Gets the unit for a changed measurement.booleanChecks if there are any changes.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
fromSnapshotId
-
toSnapshotId
-
changedValues
-
previousValues
-
units
-
-
Constructor Details
-
ProcessDelta
Creates a delta between two snapshots.- Parameters:
from- the baseline snapshotto- the current snapshot
-
-
Method Details
-
computeDifferences
-
getChangedMeasurements
-
getNewValue
Gets the new value for a measurement.- Parameters:
name- measurement name- Returns:
- new value or NaN if not changed
-
getPreviousValue
Gets the previous value for a measurement.- Parameters:
name- measurement name- Returns:
- previous value or NaN if not tracked
-
getChange
Gets the change (delta) for a measurement.- Parameters:
name- measurement name- Returns:
- change in value (new - previous) or NaN
-
getRelativeChange
Gets the relative change for a measurement.- Parameters:
name- measurement name- Returns:
- relative change (new - previous) / previous, or NaN
-
getUnit
-
hasChanges
public boolean hasChanges()Checks if there are any changes.- Returns:
- true if at least one value changed
-
getChangeCount
public int getChangeCount()Gets the number of changed measurements.- Returns:
- count of changes
-
getAllChanges
-
getFromSnapshotId
-
getToSnapshotId
-
apply
Applies this delta to a snapshot to produce a new snapshot.- Parameters:
base- the base snapshotnewId- ID for the new snapshot- Returns:
- updated snapshot
-
toString
-