Interface EquipmentCapacityStrategy

All Known Implementing Classes:
CompressorCapacityStrategy, DistillationColumnCapacityStrategy, EjectorCapacityStrategy, ExpanderCapacityStrategy, HeatExchangerCapacityStrategy, MixerCapacityStrategy, PipeCapacityStrategy, PumpCapacityStrategy, SeparatorCapacityStrategy, SplitterCapacityStrategy, TankCapacityStrategy, ValveCapacityStrategy

public interface EquipmentCapacityStrategy
Strategy interface for equipment-specific capacity evaluation.

This interface enables a plugin-based architecture for evaluating capacity constraints across different equipment types. Each equipment type can have its own strategy implementation that understands the specific physics and constraints of that equipment.

Strategy implementations should be registered with EquipmentCapacityStrategyRegistry for automatic discovery during optimization.

Example Implementation

public class CompressorCapacityStrategy implements EquipmentCapacityStrategy {
  @Override
  public boolean supports(ProcessEquipmentInterface equipment) {
    return equipment instanceof Compressor;
  }

  @Override
  public double evaluateCapacity(ProcessEquipmentInterface equipment) {
    Compressor comp = (Compressor) equipment;
    return comp.getMaxUtilization();
  }
}
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Method Details

    • supports

      boolean supports(ProcessEquipmentInterface equipment)
      Checks if this strategy supports the given equipment.
      Parameters:
      equipment - the equipment to check
      Returns:
      true if this strategy can evaluate the equipment
    • getPriority

      default int getPriority()
      Gets the priority of this strategy.

      When multiple strategies support the same equipment, the one with higher priority is used. Default priority is 0. Use positive values for more specific strategies.

      Returns:
      the priority value (higher = more preferred)
    • evaluateCapacity

      double evaluateCapacity(ProcessEquipmentInterface equipment)
      Evaluates the current capacity utilization of the equipment.

      Returns a value between 0 and 1+ where:

      • 0.0 = no load
      • 1.0 = at design capacity
      • >1.0 = over capacity
      Parameters:
      equipment - the equipment to evaluate
      Returns:
      capacity utilization as a fraction
    • evaluateMaxCapacity

      double evaluateMaxCapacity(ProcessEquipmentInterface equipment)
      Evaluates the maximum capacity of the equipment.

      Returns the maximum capacity in the equipment's natural units (e.g., flow rate, power, duty).

      Parameters:
      equipment - the equipment to evaluate
      Returns:
      maximum capacity
    • getConstraints

      Gets all capacity constraints for this equipment.

      Returns a map of constraint name to constraint object. The constraints include both the current value and the design/limit values.

      Parameters:
      equipment - the equipment to get constraints for
      Returns:
      map of constraint name to CapacityConstraint
    • getViolations

      Gets the list of constraint violations for this equipment.

      Returns only the constraints that are currently violated (utilization > 1.0 or outside limits).

      Parameters:
      equipment - the equipment to check
      Returns:
      list of violated constraints
    • getBottleneckConstraint

      CapacityConstraint getBottleneckConstraint(ProcessEquipmentInterface equipment)
      Gets the bottleneck constraint (highest utilization).
      Parameters:
      equipment - the equipment to evaluate
      Returns:
      the constraint with highest utilization, or null if none
    • isWithinHardLimits

      boolean isWithinHardLimits(ProcessEquipmentInterface equipment)
      Checks if the equipment is operating within all hard limits.
      Parameters:
      equipment - the equipment to check
      Returns:
      true if no hard limits are violated
    • isWithinSoftLimits

      boolean isWithinSoftLimits(ProcessEquipmentInterface equipment)
      Checks if the equipment is operating within all soft limits (design values).
      Parameters:
      equipment - the equipment to check
      Returns:
      true if no soft limits are violated
    • getAvailableMargin

      default double getAvailableMargin(ProcessEquipmentInterface equipment)
      Gets the available margin before hitting the bottleneck constraint.
      Parameters:
      equipment - the equipment to evaluate
      Returns:
      available margin as a fraction (0.2 = 20% headroom)
    • getName

      String getName()
      Gets a descriptive name for this strategy.
      Returns:
      strategy name
    • getEquipmentClass

      Class<? extends ProcessEquipmentInterface> getEquipmentClass()
      Gets the equipment class this strategy handles.
      Returns:
      the equipment class