Class StateVector
java.lang.Object
neqsim.process.ml.StateVector
- All Implemented Interfaces:
Serializable
Standardized state vector for physics-grounded world models and RL integration.
Provides a flat, normalized representation of process equipment state suitable for:
- Reinforcement Learning observations
- Neural network surrogate models
- Multi-agent coordination
- Real-time control systems
Design principles:
- All values normalized to [0, 1] or [-1, 1] for ML compatibility
- Physical bounds preserved for constraint checking
- Named features for explainability
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a state variable with bounds.Add a state variable without explicit bounds (uses value as reference).String[]Get feature names in order.double[]Get lower bounds array.doublegetNormalized(String name) Get normalized value in [0, 1] range.longGet timestamp when this state was captured.double[]Get upper bounds array.doubleGet raw value in physical units.intsize()Get number of features.double[]toArray()Get all values as a flat array (for neural networks).toMap()Convert to JSON-like map for serialization.double[]Get all normalized values as a flat array.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
values
-
lowerBounds
-
upperBounds
-
units
-
timestampMs
private final long timestampMs
-
-
Constructor Details
-
StateVector
public StateVector()Create an empty state vector.
-
-
Method Details
-
add
public StateVector add(String name, double value, double lowerBound, double upperBound, String unit) Add a state variable with bounds.- Parameters:
name- variable name (e.g., "temperature", "pressure")value- current value in physical unitslowerBound- physical lower boundupperBound- physical upper boundunit- unit string (e.g., "K", "bar", "kg/s")- Returns:
- this StateVector for chaining
-
add
Add a state variable without explicit bounds (uses value as reference).- Parameters:
name- variable namevalue- current valueunit- unit string- Returns:
- this StateVector for chaining
-
getValue
Get raw value in physical units.- Parameters:
name- variable name- Returns:
- value in physical units
-
getNormalized
Get normalized value in [0, 1] range.- Parameters:
name- variable name- Returns:
- normalized value
-
toArray
public double[] toArray()Get all values as a flat array (for neural networks).- Returns:
- array of raw values in insertion order
-
toNormalizedArray
public double[] toNormalizedArray()Get all normalized values as a flat array.- Returns:
- array of normalized values in [0, 1]
-
getFeatureNames
-
size
public int size()Get number of features.- Returns:
- feature count
-
getLowerBounds
public double[] getLowerBounds()Get lower bounds array.- Returns:
- array of lower bounds
-
getUpperBounds
public double[] getUpperBounds()Get upper bounds array.- Returns:
- array of upper bounds
-
getTimestampMs
public long getTimestampMs()Get timestamp when this state was captured.- Returns:
- timestamp in milliseconds
-
toMap
-
toString
-