Class ReconciliationResult
java.lang.Object
neqsim.process.util.reconciliation.ReconciliationResult
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate doubleChi-square test statistic for the global test.private longComputation time in milliseconds.private double[]Constraint residuals after reconciliation.private double[]Constraint residuals before reconciliation.private booleanWhether the reconciliation converged successfully.private intDegrees of freedom = number of redundant measurements.private StringError message if reconciliation failed.private booleanWhether the global chi-square test passed.private final List<ReconciliationVariable> Variables flagged as gross errors.private doubleWeighted sum of squared adjustments (objective function value).private static final longprivate final List<ReconciliationVariable> All reconciliation variables with their adjusted values. -
Constructor Summary
ConstructorsConstructorDescriptionReconciliationResult(List<ReconciliationVariable> variables) Creates a reconciliation result. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGrossError(ReconciliationVariable variable) Adds a variable to the gross errors list.doubleReturns the chi-square test statistic.longReturns the computation time.double[]Returns constraint residuals after reconciliation.double[]Returns constraint residuals before reconciliation.intReturns the degrees of freedom (number of constraints / redundant measurements).Returns the error message if reconciliation failed.Returns variables flagged as gross errors.doubleReturns the weighted sum of squared adjustments (objective value).Returns all reconciliation variables.booleanReturns whether any gross errors were detected.booleanReturns whether the reconciliation converged successfully.booleanReturns whether the global chi-square test passed.voidsetChiSquareStatistic(double chiSquareStatistic) Sets the chi-square test statistic.voidsetComputeTimeMs(long computeTimeMs) Sets the computation time.voidsetConstraintResidualsAfter(double[] residuals) Sets constraint residuals after reconciliation.voidsetConstraintResidualsBefore(double[] residuals) Sets constraint residuals before reconciliation.voidsetConverged(boolean converged) Sets the convergence flag.voidsetDegreesOfFreedom(int degreesOfFreedom) Sets the degrees of freedom.voidsetErrorMessage(String errorMessage) Sets the error message.voidsetGlobalTestPassed(boolean globalTestPassed) Sets the global test result.voidsetObjectiveValue(double objectiveValue) Sets the objective value.toJson()Returns a JSON representation of the reconciliation result.toReport()Returns a human-readable summary report.toString()Returns a summary string.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
variables
All reconciliation variables with their adjusted values. -
objectiveValue
private double objectiveValueWeighted sum of squared adjustments (objective function value). -
chiSquareStatistic
private double chiSquareStatisticChi-square test statistic for the global test. -
degreesOfFreedom
private int degreesOfFreedomDegrees of freedom = number of redundant measurements. -
globalTestPassed
private boolean globalTestPassedWhether the global chi-square test passed. True means no evidence of gross errors at the specified confidence level. -
grossErrors
Variables flagged as gross errors. -
constraintResidualsBefore
private double[] constraintResidualsBeforeConstraint residuals before reconciliation. -
constraintResidualsAfter
private double[] constraintResidualsAfterConstraint residuals after reconciliation. -
computeTimeMs
private long computeTimeMsComputation time in milliseconds. -
converged
private boolean convergedWhether the reconciliation converged successfully. -
errorMessage
Error message if reconciliation failed.
-
-
Constructor Details
-
ReconciliationResult
Creates a reconciliation result.- Parameters:
variables- the list of reconciled variables
-
-
Method Details
-
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
Returns variables flagged as gross errors.- Returns:
- unmodifiable list of gross error variables
-
addGrossError
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
Returns the error message if reconciliation failed.- Returns:
- error message, or empty string if successful
-
setErrorMessage
Sets the error message.- Parameters:
errorMessage- the error description
-
toJson
Returns a JSON representation of the reconciliation result.- Returns:
- JSON string with all variables, statistics, and gross errors
-
toReport
-
toString
-