Class StreamContract
java.lang.Object
neqsim.util.validation.contracts.StreamContract
- All Implemented Interfaces:
ModuleContract<StreamInterface>
Contract for process streams.
Defines requirements and guarantees for StreamInterface implementations. AI agents can
use this contract to validate stream setup before connecting to equipment.
Preconditions (what the stream needs):
- Valid thermodynamic system attached
- Flow rate > 0
- Valid name for identification
Postconditions (what run() provides):
- Calculated outlet conditions
- Phase equilibrium (if flash performed)
- Stream properties accessible via getFluid()
- Version:
- 1.0
- Author:
- NeqSim
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StreamContractSingleton instance.private static final doubleMinimum valid flow rate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckPostconditions(StreamInterface stream) Check postconditions after execution.checkPreconditions(StreamInterface stream) Check preconditions before execution.Get the name of this contract.static StreamContractGet the singleton instance.Get a description of what this module provides.Get a description of what this module requires.
-
Field Details
-
INSTANCE
Singleton instance. -
MIN_FLOW_RATE
private static final double MIN_FLOW_RATEMinimum valid flow rate.- See Also:
-
-
Constructor Details
-
StreamContract
private StreamContract()
-
-
Method Details
-
getInstance
-
getContractName
Description copied from interface:ModuleContractGet the name of this contract.- Specified by:
getContractNamein interfaceModuleContract<StreamInterface>- Returns:
- contract name for logging/debugging
-
checkPreconditions
Description copied from interface:ModuleContractCheck preconditions before execution.Validates that all requirements are met before running the module.
- Specified by:
checkPreconditionsin interfaceModuleContract<StreamInterface>- Parameters:
stream- object to validate- Returns:
- validation result with any precondition failures
-
checkPostconditions
Description copied from interface:ModuleContractCheck postconditions after execution.Validates that the module produced valid output.
- Specified by:
checkPostconditionsin interfaceModuleContract<StreamInterface>- Parameters:
stream- object to validate- Returns:
- validation result with any postcondition failures
-
getRequirementsDescription
Description copied from interface:ModuleContractGet a description of what this module requires.AI agents can use this to understand setup requirements.
- Specified by:
getRequirementsDescriptionin interfaceModuleContract<StreamInterface>- Returns:
- human-readable requirements description
-
getProvidesDescription
Description copied from interface:ModuleContractGet a description of what this module provides.AI agents can use this to understand available outputs.
- Specified by:
getProvidesDescriptionin interfaceModuleContract<StreamInterface>- Returns:
- human-readable outputs description
-