Class ProcessSystemContract

java.lang.Object
neqsim.util.validation.contracts.ProcessSystemContract
All Implemented Interfaces:
ModuleContract<ProcessSystem>

public class ProcessSystemContract extends Object implements ModuleContract<ProcessSystem>
Contract for process systems (flowsheets).

Defines requirements and guarantees for ProcessSystem implementations. AI agents can use this contract to validate entire process flowsheets before running simulations.

Preconditions (what the process system needs):

  • At least one unit operation
  • All equipment properly connected
  • Feed streams defined
  • No circular dependencies without recycle blocks

Postconditions (what run() provides):

  • All equipment calculated
  • Recycles converged (if any)
  • Material/energy balances satisfied
Version:
1.0
Author:
NeqSim
  • Field Details

  • Constructor Details

    • ProcessSystemContract

      private ProcessSystemContract()
  • Method Details

    • getInstance

      public static ProcessSystemContract getInstance()
      Get the singleton instance.
      Returns:
      contract instance
    • getContractName

      public String getContractName()
      Description copied from interface: ModuleContract
      Get the name of this contract.
      Specified by:
      getContractName in interface ModuleContract<ProcessSystem>
      Returns:
      contract name for logging/debugging
    • checkPreconditions

      public ValidationResult checkPreconditions(ProcessSystem processSystem)
      Description copied from interface: ModuleContract
      Check preconditions before execution.

      Validates that all requirements are met before running the module.

      Specified by:
      checkPreconditions in interface ModuleContract<ProcessSystem>
      Parameters:
      processSystem - object to validate
      Returns:
      validation result with any precondition failures
    • checkPostconditions

      public ValidationResult checkPostconditions(ProcessSystem processSystem)
      Description copied from interface: ModuleContract
      Check postconditions after execution.

      Validates that the module produced valid output.

      Specified by:
      checkPostconditions in interface ModuleContract<ProcessSystem>
      Parameters:
      processSystem - object to validate
      Returns:
      validation result with any postcondition failures
    • getRequirementsDescription

      public String getRequirementsDescription()
      Description copied from interface: ModuleContract
      Get a description of what this module requires.

      AI agents can use this to understand setup requirements.

      Specified by:
      getRequirementsDescription in interface ModuleContract<ProcessSystem>
      Returns:
      human-readable requirements description
    • getProvidesDescription

      public String getProvidesDescription()
      Description copied from interface: ModuleContract
      Get a description of what this module provides.

      AI agents can use this to understand available outputs.

      Specified by:
      getProvidesDescription in interface ModuleContract<ProcessSystem>
      Returns:
      human-readable outputs description
    • validateConnectivity

      public ValidationResult validateConnectivity(ProcessSystem processSystem)
      Validate equipment connectivity.

      Checks that equipment is properly connected via streams.

      Parameters:
      processSystem - the process system to validate
      Returns:
      validation result