Class ResultProvenance
java.lang.Object
neqsim.mcp.model.ResultProvenance
Provenance metadata for every MCP calculation result.
Provides trust-relevant context that agents and humans need to assess the credibility of a calculation result. Every MCP response envelope should include a provenance block answering:
- Which thermodynamic model (EOS) was used?
- What mixing rule was applied?
- What key assumptions were made?
- Was the result directly computed or interpreted?
- Did the calculation converge? What quality checks passed?
- What are the known limitations of this calculation?
This addresses the need for a formal trust model in agentic engineering workflows. An agent consuming NeqSim results can inspect provenance to decide whether to present results as-is, add caveats, or request a more rigorous calculation.
- Version:
- 1.0
- Author:
- Even Solbraa
-
Field Summary
FieldsModifier and TypeFieldDescriptionKey assumptions made during the calculation.private StringThe type of calculation performed (e.g., "TP flash", "process simulation").private longComputation time in milliseconds.private booleanWhether the calculation converged successfully.private StringThe computation engine and version.Known limitations that apply to this result.private StringThe mixing rule applied (e.g., "classic", "HV", "WS").private StringWhether the result is a direct computation or derived/interpreted.private StringThe equation of state or thermodynamic model used.private StringTimestamp of the calculation (ISO-8601).Validation checks that were applied and their results. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssumption(String assumption) Adds an assumption to the provenance.voidaddLimitation(String limitation) Adds a limitation to the provenance.voidaddValidationPassed(String validation) Adds a passed validation check.static ResultProvenanceCreates a provenance for a batch calculation.static ResultProvenanceCreates a provenance for a flash calculation.static ResultProvenanceforPhaseEnvelope(String model) Creates a provenance for a phase envelope calculation.static ResultProvenanceforProcess(String model, String mixingRule, int equipmentCount) Creates a provenance for a process simulation.static ResultProvenanceforPropertyTable(String model, String sweepVariable, int pointCount) Creates a provenance for a property table calculation.Gets the assumptions list.Gets the calculation type.longGets the computation time.Gets the engine name.Gets the limitations list.Gets the mixing rule.Gets the result origin.Gets the thermodynamic model.Gets the timestamp.Gets the passed validations.booleanReturns whether the calculation converged.voidsetCalculationType(String type) Sets the calculation type.voidsetComputationTimeMs(long ms) Sets the computation time.voidsetConverged(boolean converged) Sets the convergence status.voidsetMixingRule(String rule) Sets the mixing rule.voidsetResultOrigin(String origin) Sets the result origin.voidsetThermodynamicModel(String model) Sets the thermodynamic model name.
-
Field Details
-
engine
The computation engine and version. -
thermodynamicModel
The equation of state or thermodynamic model used. -
mixingRule
The mixing rule applied (e.g., "classic", "HV", "WS"). -
calculationType
The type of calculation performed (e.g., "TP flash", "process simulation"). -
resultOrigin
Whether the result is a direct computation or derived/interpreted. -
converged
private boolean convergedWhether the calculation converged successfully. -
validationsPassed
-
assumptions
-
limitations
-
timestamp
Timestamp of the calculation (ISO-8601). -
computationTimeMs
private long computationTimeMsComputation time in milliseconds.
-
-
Constructor Details
-
ResultProvenance
public ResultProvenance()Creates a new provenance instance with default values.
-
-
Method Details
-
forFlash
Creates a provenance for a flash calculation.- Parameters:
model- the EOS model name (e.g., "SRK", "PR", "CPA")flashType- the flash type (e.g., "TP", "PH", "dewPointT")mixingRule- the mixing rule used- Returns:
- the configured provenance
-
forProcess
Creates a provenance for a process simulation.- Parameters:
model- the EOS model namemixingRule- the mixing rule usedequipmentCount- the number of equipment units- Returns:
- the configured provenance
-
forPropertyTable
Creates a provenance for a property table calculation.- Parameters:
model- the EOS model namesweepVariable- the variable being swept (e.g., "temperature", "pressure")pointCount- the number of data points- Returns:
- the configured provenance
-
forPhaseEnvelope
Creates a provenance for a phase envelope calculation.- Parameters:
model- the EOS model name- Returns:
- the configured provenance
-
forBatch
Creates a provenance for a batch calculation.- Parameters:
model- the EOS model nametotalCases- the total number of cases in the batchsucceededCases- the number of cases that succeeded- Returns:
- the configured provenance
-
addAssumption
Adds an assumption to the provenance.- Parameters:
assumption- the assumption description
-
addLimitation
Adds a limitation to the provenance.- Parameters:
limitation- the limitation description
-
addValidationPassed
Adds a passed validation check.- Parameters:
validation- the validation check name
-
setConverged
public void setConverged(boolean converged) Sets the convergence status.- Parameters:
converged- true if the calculation converged
-
setComputationTimeMs
public void setComputationTimeMs(long ms) Sets the computation time.- Parameters:
ms- computation time in milliseconds
-
setResultOrigin
Sets the result origin.- Parameters:
origin- "direct_computation", "interpolated", or "extrapolated"
-
setThermodynamicModel
Sets the thermodynamic model name.- Parameters:
model- the EOS model name
-
setMixingRule
Sets the mixing rule.- Parameters:
rule- the mixing rule name
-
setCalculationType
Sets the calculation type.- Parameters:
type- the calculation type description
-
getEngine
-
getThermodynamicModel
-
getCalculationType
Gets the calculation type.- Returns:
- the calculation type description
-
isConverged
public boolean isConverged()Returns whether the calculation converged.- Returns:
- true if converged
-
getAssumptions
-
getLimitations
-
getResultOrigin
-
getValidationsPassed
-
getTimestamp
-
getComputationTimeMs
public long getComputationTimeMs()Gets the computation time.- Returns:
- the computation time in milliseconds
-
getMixingRule
-