Class ReconciliationResult

java.lang.Object
neqsim.process.util.reconciliation.ReconciliationResult
All Implemented Interfaces:
Serializable

public class ReconciliationResult extends Object implements Serializable
Result of a data reconciliation run.

Contains the reconciled variable values, constraint residuals, global and per-variable statistical tests, and gross error detection results. Produced by DataReconciliationEngine.reconcile().

Version:
1.0
Author:
Process Optimization Team
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • variables

      private final List<ReconciliationVariable> variables
      All reconciliation variables with their adjusted values.
    • objectiveValue

      private double objectiveValue
      Weighted sum of squared adjustments (objective function value).
    • chiSquareStatistic

      private double chiSquareStatistic
      Chi-square test statistic for the global test.
    • degreesOfFreedom

      private int degreesOfFreedom
      Degrees of freedom = number of redundant measurements.
    • globalTestPassed

      private boolean globalTestPassed
      Whether the global chi-square test passed. True means no evidence of gross errors at the specified confidence level.
    • grossErrors

      private final List<ReconciliationVariable> grossErrors
      Variables flagged as gross errors.
    • constraintResidualsBefore

      private double[] constraintResidualsBefore
      Constraint residuals before reconciliation.
    • constraintResidualsAfter

      private double[] constraintResidualsAfter
      Constraint residuals after reconciliation.
    • computeTimeMs

      private long computeTimeMs
      Computation time in milliseconds.
    • converged

      private boolean converged
      Whether the reconciliation converged successfully.
    • errorMessage

      private String errorMessage
      Error message if reconciliation failed.
  • Constructor Details

    • ReconciliationResult

      public ReconciliationResult(List<ReconciliationVariable> variables)
      Creates a reconciliation result.
      Parameters:
      variables - the list of reconciled variables
  • Method Details

    • getVariables

      public List<ReconciliationVariable> getVariables()
      Returns all reconciliation variables.
      Returns:
      unmodifiable list of variables with reconciled values
    • getObjectiveValue

      public double getObjectiveValue()
      Returns the weighted sum of squared adjustments (objective value).
      Returns:
      the objective, should be close to degrees of freedom if no gross errors
    • setObjectiveValue

      public void setObjectiveValue(double objectiveValue)
      Sets the objective value.
      Parameters:
      objectiveValue - the weighted sum of squares
    • getChiSquareStatistic

      public double getChiSquareStatistic()
      Returns the chi-square test statistic.
      Returns:
      chi-square value for the global test
    • setChiSquareStatistic

      public void setChiSquareStatistic(double chiSquareStatistic)
      Sets the chi-square test statistic.
      Parameters:
      chiSquareStatistic - the computed statistic
    • getDegreesOfFreedom

      public int getDegreesOfFreedom()
      Returns the degrees of freedom (number of constraints / redundant measurements).
      Returns:
      degrees of freedom
    • setDegreesOfFreedom

      public void setDegreesOfFreedom(int degreesOfFreedom)
      Sets the degrees of freedom.
      Parameters:
      degreesOfFreedom - number of constraints
    • isGlobalTestPassed

      public boolean isGlobalTestPassed()
      Returns whether the global chi-square test passed.
      Returns:
      true if no evidence of gross errors at the specified confidence
    • setGlobalTestPassed

      public void setGlobalTestPassed(boolean globalTestPassed)
      Sets the global test result.
      Parameters:
      globalTestPassed - true if passed
    • getGrossErrors

      public List<ReconciliationVariable> getGrossErrors()
      Returns variables flagged as gross errors.
      Returns:
      unmodifiable list of gross error variables
    • addGrossError

      public void addGrossError(ReconciliationVariable variable)
      Adds a variable to the gross errors list.
      Parameters:
      variable - the variable flagged as a gross error
    • hasGrossErrors

      public boolean hasGrossErrors()
      Returns whether any gross errors were detected.
      Returns:
      true if at least one variable was flagged
    • getConstraintResidualsBefore

      public double[] getConstraintResidualsBefore()
      Returns constraint residuals before reconciliation.
      Returns:
      array of A*y values (should be non-zero if balances don't close)
    • setConstraintResidualsBefore

      public void setConstraintResidualsBefore(double[] residuals)
      Sets constraint residuals before reconciliation.
      Parameters:
      residuals - the pre-reconciliation residuals
    • getConstraintResidualsAfter

      public double[] getConstraintResidualsAfter()
      Returns constraint residuals after reconciliation.
      Returns:
      array of A*x_adj values (should be near-zero)
    • setConstraintResidualsAfter

      public void setConstraintResidualsAfter(double[] residuals)
      Sets constraint residuals after reconciliation.
      Parameters:
      residuals - the post-reconciliation residuals
    • getComputeTimeMs

      public long getComputeTimeMs()
      Returns the computation time.
      Returns:
      time in milliseconds
    • setComputeTimeMs

      public void setComputeTimeMs(long computeTimeMs)
      Sets the computation time.
      Parameters:
      computeTimeMs - time in milliseconds
    • isConverged

      public boolean isConverged()
      Returns whether the reconciliation converged successfully.
      Returns:
      true if converged
    • setConverged

      public void setConverged(boolean converged)
      Sets the convergence flag.
      Parameters:
      converged - true if converged
    • getErrorMessage

      public String getErrorMessage()
      Returns the error message if reconciliation failed.
      Returns:
      error message, or empty string if successful
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      Sets the error message.
      Parameters:
      errorMessage - the error description
    • toJson

      public String toJson()
      Returns a JSON representation of the reconciliation result.
      Returns:
      JSON string with all variables, statistics, and gross errors
    • toReport

      public String toReport()
      Returns a human-readable summary report.
      Returns:
      formatted text report
    • toString

      public String toString()
      Returns a summary string.
      Overrides:
      toString in class Object
      Returns:
      brief summary of the result