Class StateVector

java.lang.Object
neqsim.process.ml.StateVector
All Implemented Interfaces:
Serializable

public class StateVector extends Object implements 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 Details

  • 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 units
      lowerBound - physical lower bound
      upperBound - physical upper bound
      unit - unit string (e.g., "K", "bar", "kg/s")
      Returns:
      this StateVector for chaining
    • add

      public StateVector add(String name, double value, String unit)
      Add a state variable without explicit bounds (uses value as reference).
      Parameters:
      name - variable name
      value - current value
      unit - unit string
      Returns:
      this StateVector for chaining
    • getValue

      public double getValue(String name)
      Get raw value in physical units.
      Parameters:
      name - variable name
      Returns:
      value in physical units
    • getNormalized

      public double getNormalized(String name)
      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

      public String[] getFeatureNames()
      Get feature names in order.
      Returns:
      array of feature names
    • 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

      public Map<String,Object> toMap()
      Convert to JSON-like map for serialization.
      Returns:
      map representation
    • toString

      public String toString()
      Overrides:
      toString in class Object