Class ProcessConstraintEvaluator

java.lang.Object
neqsim.process.util.optimizer.ProcessConstraintEvaluator
All Implemented Interfaces:
Serializable

public class ProcessConstraintEvaluator extends Object implements Serializable
Composite constraint evaluator for process-wide constraint evaluation.

This class provides:

  • Unified evaluation of all constraints across a process system
  • Constraint normalization for comparable utilization metrics
  • Caching of constraint values for performance
  • Sensitivity analysis through finite-difference calculations
  • Bottleneck identification across all equipment

Example Usage

ProcessConstraintEvaluator evaluator = new ProcessConstraintEvaluator(processSystem);

// Evaluate all constraints
ConstraintEvaluationResult result = evaluator.evaluate();
System.out.println("Bottleneck: " + result.getBottleneckEquipment());
System.out.println("Utilization: " + result.getOverallUtilization());

// Calculate sensitivities
Map<String, Double> sensitivities = evaluator.calculateFlowSensitivities(5000.0, "kg/hr");

// Estimate max flow
double maxFlow = evaluator.estimateMaxFlow(5000.0, "kg/hr");
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger.
    • strategyRegistry

      private transient EquipmentCapacityStrategyRegistry strategyRegistry
      Strategy registry for equipment constraint evaluation.
    • constraintCache

      Cache for constraint values.
    • processSystem

      private ProcessSystem processSystem
      The process system to evaluate.
    • cacheTTLMillis

      private long cacheTTLMillis
      Cache TTL in milliseconds.
    • cachingEnabled

      private boolean cachingEnabled
      Whether caching is enabled.
    • sensitivityStepSize

      private double sensitivityStepSize
      Step size for finite difference sensitivity calculations.
  • Constructor Details

    • ProcessConstraintEvaluator

      public ProcessConstraintEvaluator()
      Default constructor.
    • ProcessConstraintEvaluator

      public ProcessConstraintEvaluator(ProcessSystem processSystem)
      Constructor with process system.
      Parameters:
      processSystem - the process system to evaluate
  • Method Details

    • evaluate

      Evaluates all constraints using the stored process system.
      Returns:
      constraint evaluation result
    • evaluate

      Evaluates all constraints across the process system.
      Parameters:
      processSystem - the process system to evaluate
      Returns:
      constraint evaluation result
    • calculateFlowSensitivities

      public Map<String,Double> calculateFlowSensitivities(double flowRateKgPerHr, String flowUnit)
      Calculates sensitivity of constraints to flow rate changes.
      Parameters:
      flowRateKgPerHr - current flow rate in kg/hr
      flowUnit - flow unit (for documentation purposes)
      Returns:
      map of constraint name to sensitivity (d_utilization / d_flow)
    • calculateFlowSensitivities

      public Map<String,Double> calculateFlowSensitivities(ProcessSystem processSystem, double flowRateKgPerHr)
      Calculates sensitivity of constraints to flow rate changes.
      Parameters:
      processSystem - the process system
      flowRateKgPerHr - current flow rate in kg/hr
      Returns:
      map of constraint name to sensitivity (d_utilization / d_flow)
    • estimateMaxFlow

      public double estimateMaxFlow(double currentFlowKgPerHr, String flowUnit)
      Estimates the maximum flow rate before hitting the bottleneck constraint.
      Parameters:
      currentFlowKgPerHr - current flow rate
      flowUnit - flow unit (for documentation purposes)
      Returns:
      estimated maximum flow rate in kg/hr
    • estimateMaxFlow

      public double estimateMaxFlow(ProcessSystem processSystem, double currentFlowKgPerHr)
      Estimates the maximum flow rate before hitting the bottleneck constraint.
      Parameters:
      processSystem - the process system
      currentFlowKgPerHr - current flow rate
      Returns:
      estimated maximum flow rate in kg/hr
    • getConstraintsWithCaching

      private Map<String, CapacityConstraint> getConstraintsWithCaching(ProcessEquipmentInterface equipment, EquipmentCapacityStrategy strategy, int processRunCount)
      Gets constraints with caching support.
    • getProcessRunCount

      private int getProcessRunCount(ProcessSystem processSystem)
      Gets process run count (approximate) for cache invalidation.
    • setFeedFlowRate

      private void setFeedFlowRate(ProcessSystem processSystem, double flowKgPerHr)
      Sets the feed flow rate on the process system.
    • clearCache

      public void clearCache()
      Clears the constraint cache.
    • getProcessSystem

      public ProcessSystem getProcessSystem()
      Gets the process system.
      Returns:
      process system
    • setProcessSystem

      public void setProcessSystem(ProcessSystem processSystem)
      Sets the process system.
      Parameters:
      processSystem - process system
    • getCacheTTLMillis

      public long getCacheTTLMillis()
      Gets the cache TTL in milliseconds.
      Returns:
      TTL in milliseconds
    • setCacheTTLMillis

      public void setCacheTTLMillis(long cacheTTLMillis)
      Sets the cache TTL in milliseconds.
      Parameters:
      cacheTTLMillis - TTL in milliseconds
    • isCachingEnabled

      public boolean isCachingEnabled()
      Checks if caching is enabled.
      Returns:
      true if caching enabled
    • setCachingEnabled

      public void setCachingEnabled(boolean cachingEnabled)
      Sets whether caching is enabled.
      Parameters:
      cachingEnabled - caching flag
    • getSensitivityStepSize

      public double getSensitivityStepSize()
      Gets the sensitivity step size.
      Returns:
      step size as fraction
    • setSensitivityStepSize

      public void setSensitivityStepSize(double sensitivityStepSize)
      Sets the sensitivity step size.
      Parameters:
      sensitivityStepSize - step size as fraction