Class PredictionResult

java.lang.Object
neqsim.process.advisory.PredictionResult
All Implemented Interfaces:
Serializable

public class PredictionResult extends Object implements Serializable
Represents the result of a look-ahead prediction for advisory systems.

This class provides structured output for predictive simulations that support real-time advisory systems. Key features:

  • Time Horizon: Predictions from minutes to days ahead
  • Uncertainty Bounds: Confidence intervals for predicted values
  • Constraint Checking: Which limits may be violated and when
  • Explanation: Human-readable description of prediction drivers

Usage Example:

// Run look-ahead simulation
PredictionResult prediction = processSystem.predictAhead(Duration.ofHours(2));

// Check for issues
if (prediction.hasViolations()) {
  System.out.println("Warning: " + prediction.getViolationSummary());
}

// Get predicted values with uncertainty
PredictedValue pressure = prediction.getValue("separator.pressure");
System.out.println("Predicted pressure: " + pressure.getMean() + " ± "
    + pressure.getStandardDeviation() + " " + pressure.getUnit());

// Use in advisory system
String advice = prediction.getAdvisoryRecommendation();
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

  • Constructor Details

    • PredictionResult

      public PredictionResult(Duration horizon, String scenarioName)
      Creates a new prediction result.
      Parameters:
      horizon - the prediction time horizon
      scenarioName - name of the scenario being predicted
    • PredictionResult

      public PredictionResult(Duration horizon)
      Creates a simple prediction result with default settings.
      Parameters:
      horizon - the prediction time horizon
  • Method Details

    • addPredictedValue

      public void addPredictedValue(String variableName, PredictionResult.PredictedValue value)
      Adds a predicted value to the result.
      Parameters:
      variableName - the variable name (e.g., "separator.pressure")
      value - the predicted value with uncertainty
    • addViolation

      public void addViolation(PredictionResult.ConstraintViolation violation)
      Records a constraint violation prediction.
      Parameters:
      violation - the predicted violation
    • addAssumption

      public void addAssumption(String assumption)
      Adds an assumption used in the prediction.
      Parameters:
      assumption - description of the assumption
    • getValue

      public PredictionResult.PredictedValue getValue(String variableName)
      Gets a predicted value by variable name.
      Parameters:
      variableName - the variable to retrieve
      Returns:
      the predicted value, or null if not found
    • hasViolations

      public boolean hasViolations()
      Checks if any constraint violations are predicted.
      Returns:
      true if violations are expected
    • getViolationSummary

      public String getViolationSummary()
      Gets a summary of predicted violations.
      Returns:
      human-readable summary
    • getAdvisoryRecommendation

      public String getAdvisoryRecommendation()
      Gets an advisory recommendation based on the prediction.
      Returns:
      recommendation for operators
    • formatDuration

      private String formatDuration(Duration d)
    • getPredictionTime

      public Instant getPredictionTime()
    • getHorizon

      public Duration getHorizon()
    • getScenarioName

      public String getScenarioName()
    • getAllPredictedValues

      public Map<String, PredictionResult.PredictedValue> getAllPredictedValues()
    • getViolations

      public List<PredictionResult.ConstraintViolation> getViolations()
    • getAssumptions

      public List<String> getAssumptions()
    • getExplanation

      public String getExplanation()
    • setExplanation

      public void setExplanation(String explanation)
    • getOverallConfidence

      public double getOverallConfidence()
    • setOverallConfidence

      public void setOverallConfidence(double confidence)
    • getStatus

    • setStatus

      public void setStatus(PredictionResult.PredictionStatus status)