Class ResultProvenance

java.lang.Object
neqsim.mcp.model.ResultProvenance

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

    • engine

      private String engine
      The computation engine and version.
    • thermodynamicModel

      private String thermodynamicModel
      The equation of state or thermodynamic model used.
    • mixingRule

      private String mixingRule
      The mixing rule applied (e.g., "classic", "HV", "WS").
    • calculationType

      private String calculationType
      The type of calculation performed (e.g., "TP flash", "process simulation").
    • resultOrigin

      private String resultOrigin
      Whether the result is a direct computation or derived/interpreted.
    • converged

      private boolean converged
      Whether the calculation converged successfully.
    • validationsPassed

      private List<String> validationsPassed
      Validation checks that were applied and their results.
    • assumptions

      private List<String> assumptions
      Key assumptions made during the calculation.
    • limitations

      private List<String> limitations
      Known limitations that apply to this result.
    • timestamp

      private String timestamp
      Timestamp of the calculation (ISO-8601).
    • computationTimeMs

      private long computationTimeMs
      Computation time in milliseconds.
  • Constructor Details

    • ResultProvenance

      public ResultProvenance()
      Creates a new provenance instance with default values.
  • Method Details

    • forFlash

      public static ResultProvenance forFlash(String model, String flashType, String mixingRule)
      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

      public static ResultProvenance forProcess(String model, String mixingRule, int equipmentCount)
      Creates a provenance for a process simulation.
      Parameters:
      model - the EOS model name
      mixingRule - the mixing rule used
      equipmentCount - the number of equipment units
      Returns:
      the configured provenance
    • forPropertyTable

      public static ResultProvenance forPropertyTable(String model, String sweepVariable, int pointCount)
      Creates a provenance for a property table calculation.
      Parameters:
      model - the EOS model name
      sweepVariable - the variable being swept (e.g., "temperature", "pressure")
      pointCount - the number of data points
      Returns:
      the configured provenance
    • forPhaseEnvelope

      public static ResultProvenance forPhaseEnvelope(String model)
      Creates a provenance for a phase envelope calculation.
      Parameters:
      model - the EOS model name
      Returns:
      the configured provenance
    • forBatch

      public static ResultProvenance forBatch(String model, int totalCases, int succeededCases)
      Creates a provenance for a batch calculation.
      Parameters:
      model - the EOS model name
      totalCases - the total number of cases in the batch
      succeededCases - the number of cases that succeeded
      Returns:
      the configured provenance
    • addAssumption

      public void addAssumption(String assumption)
      Adds an assumption to the provenance.
      Parameters:
      assumption - the assumption description
    • addLimitation

      public void addLimitation(String limitation)
      Adds a limitation to the provenance.
      Parameters:
      limitation - the limitation description
    • addValidationPassed

      public void addValidationPassed(String validation)
      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

      public void setResultOrigin(String origin)
      Sets the result origin.
      Parameters:
      origin - "direct_computation", "interpolated", or "extrapolated"
    • setThermodynamicModel

      public void setThermodynamicModel(String model)
      Sets the thermodynamic model name.
      Parameters:
      model - the EOS model name
    • setMixingRule

      public void setMixingRule(String rule)
      Sets the mixing rule.
      Parameters:
      rule - the mixing rule name
    • setCalculationType

      public void setCalculationType(String type)
      Sets the calculation type.
      Parameters:
      type - the calculation type description
    • getEngine

      public String getEngine()
      Gets the engine name.
      Returns:
      the engine name
    • getThermodynamicModel

      public String getThermodynamicModel()
      Gets the thermodynamic model.
      Returns:
      the model name
    • getCalculationType

      public String getCalculationType()
      Gets the calculation type.
      Returns:
      the calculation type description
    • isConverged

      public boolean isConverged()
      Returns whether the calculation converged.
      Returns:
      true if converged
    • getAssumptions

      public List<String> getAssumptions()
      Gets the assumptions list.
      Returns:
      the assumptions
    • getLimitations

      public List<String> getLimitations()
      Gets the limitations list.
      Returns:
      the limitations
    • getResultOrigin

      public String getResultOrigin()
      Gets the result origin.
      Returns:
      the result origin
    • getValidationsPassed

      public List<String> getValidationsPassed()
      Gets the passed validations.
      Returns:
      the validations passed
    • getTimestamp

      public String getTimestamp()
      Gets the timestamp.
      Returns:
      the ISO-8601 timestamp
    • getComputationTimeMs

      public long getComputationTimeMs()
      Gets the computation time.
      Returns:
      the computation time in milliseconds
    • getMixingRule

      public String getMixingRule()
      Gets the mixing rule.
      Returns:
      the mixing rule name