@@ -77,7 +77,107 @@ ValidationResult post = contract.checkPostconditions(system);
7777- ` SeparatorContract ` - Validates Separator equipment
7878- ` ProcessSystemContract ` - Validates ProcessSystem
7979
80- ### 4. AIIntegrationHelper
80+ ### 4. Equipment-Level Validation
81+
82+ All process equipment classes implement ` validateSetup() ` to check equipment-specific configuration:
83+
84+ ``` java
85+ // Validate individual equipment
86+ Separator separator = new Separator (" V-100" );
87+ ValidationResult result = separator. validateSetup();
88+
89+ if (! result. isValid()) {
90+ System . out. println(" Configuration issues:" );
91+ result. getErrors(). forEach(System . out:: println);
92+ }
93+ ```
94+
95+ ** Equipment Validation Checks:**
96+
97+ | Equipment | Validations |
98+ | -----------| -------------|
99+ | ** Stream** | Fluid set, temperature > 0 K |
100+ | ** Separator** | Inlet stream connected |
101+ | ** Mixer** | At least one inlet stream added |
102+ | ** Splitter** | Inlet stream connected, split fractions sum to 1.0 |
103+ | ** Tank** | Has fluid or input stream connected |
104+ | ** DistillationColumn** | Feed streams connected, condenser/reboiler configured |
105+ | ** Recycle** | Inlet and outlet streams set, tolerance > 0 |
106+ | ** Adjuster** | Target and adjustment variables set, tolerance > 0 |
107+ | ** TwoPortEquipment** | Inlet stream connected |
108+
109+ ### 5. ProcessSystem Validation
110+
111+ ProcessSystem provides aggregate validation across all equipment:
112+
113+ ``` java
114+ ProcessSystem process = new ProcessSystem ();
115+ process. add(feed);
116+ process. add(separator);
117+ process. add(compressor);
118+
119+ // Quick check before running
120+ if (process. isReadyToRun()) {
121+ process. run();
122+ } else {
123+ // Get combined validation result
124+ ValidationResult result = process. validateSetup();
125+ System . out. println(result. getReport());
126+ }
127+
128+ // Get per-equipment validation
129+ Map<String , ValidationResult > allResults = process. validateAll();
130+ for (Map . Entry<String , ValidationResult > entry : allResults. entrySet()) {
131+ if (! entry. getValue(). isValid()) {
132+ System . out. println(entry. getKey() + " : " + entry. getValue(). getErrors());
133+ }
134+ }
135+ ```
136+
137+ ** ProcessSystem Validation Methods:**
138+
139+ | Method | Returns | Description |
140+ | --------| ---------| -------------|
141+ | ` validateSetup() ` | ` ValidationResult ` | Combined result for all equipment |
142+ | ` validateAll() ` | ` Map<String, ValidationResult> ` | Per-equipment results |
143+ | ` isReadyToRun() ` | ` boolean ` | True if no CRITICAL errors |
144+
145+ ### 5b. ProcessModel Validation
146+
147+ ProcessModel provides aggregate validation across all contained ProcessSystems:
148+
149+ ``` java
150+ ProcessModel model = new ProcessModel ();
151+ model. add(" GasProcessing" , gasProcess);
152+ model. add(" OilProcessing" , oilProcess);
153+
154+ // Quick check before running
155+ if (model. isReadyToRun()) {
156+ model. run();
157+ } else {
158+ // Get formatted validation report
159+ System . out. println(model. getValidationReport());
160+ }
161+
162+ // Get per-process validation
163+ Map<String , ValidationResult > allResults = model. validateAll();
164+ for (Map . Entry<String , ValidationResult > entry : allResults. entrySet()) {
165+ if (! entry. getValue(). isValid()) {
166+ System . out. println(entry. getKey() + " : " + entry. getValue(). getErrors());
167+ }
168+ }
169+ ```
170+
171+ ** ProcessModel Validation Methods:**
172+
173+ | Method | Returns | Description |
174+ | --------| ---------| -------------|
175+ | ` validateSetup() ` | ` ValidationResult ` | Combined result for all processes |
176+ | ` validateAll() ` | ` Map<String, ValidationResult> ` | Per-process results |
177+ | ` isReadyToRun() ` | ` boolean ` | True if no CRITICAL errors |
178+ | ` getValidationReport() ` | ` String ` | Human-readable formatted report |
179+
180+ ### 6. AIIntegrationHelper
81181
82182Unified entry point connecting validation with RL/ML infrastructure:
83183
@@ -97,7 +197,7 @@ String docs = helper.getAPIDocumentation();
97197RLEnvironment env = helper. createRLEnvironment();
98198```
99199
100- ### 5 . AI Annotations
200+ ### 7 . AI Annotations
101201
102202Annotations for exposing methods to AI agents:
103203
@@ -115,7 +215,7 @@ public void addComponent(
115215) { ... }
116216```
117217
118- ### 6 . AISchemaDiscovery
218+ ### 8 . AISchemaDiscovery
119219
120220Discovers annotated methods via reflection:
121221
@@ -240,16 +340,18 @@ All components have comprehensive unit tests:
240340| ModuleContractTest | 14 | Contract implementations |
241341| AISchemaDiscoveryTest | 13 | Annotation discovery |
242342| AIIntegrationHelperTest | 15 | Integration helper |
343+ | EquipmentValidationTest | 41 | Equipment and ProcessModel validateSetup() methods |
243344
244345Run tests:
245346``` bash
246- ./mvnw test -Dtest=" ValidationResultTest,SimulationValidatorTest,ModuleContractTest,AISchemaDiscoveryTest,AIIntegrationHelperTest"
347+ ./mvnw test -Dtest=" ValidationResultTest,SimulationValidatorTest,ModuleContractTest,AISchemaDiscoveryTest,AIIntegrationHelperTest,EquipmentValidationTest "
247348```
248349
249350## Future Enhancements
250351
251- 1 . ** Apply @AIExposable annotations** to core NeqSim methods (addComponent, setMixingRule, TPflash, etc.)
252- 2 . ** MPC validation contracts** for ProcessLinkedMPC
253- 3 . ** Surrogate model validation** integration with SurrogateModelRegistry
254- 4 . ** Real-time validation** during simulation stepping
255- 5 . ** Custom validation rules** via pluggable validators
352+ 1 . ~~ ** Standardize validateSetup()** across all ProcessEquipmentBaseClass subclasses~~ ✅ Implemented
353+ 2 . ** Apply @AIExposable annotations** to core NeqSim methods (addComponent, setMixingRule, TPflash, etc.)
354+ 3 . ** MPC validation contracts** for ProcessLinkedMPC
355+ 4 . ** Surrogate model validation** integration with SurrogateModelRegistry
356+ 5 . ** Real-time validation** during simulation stepping
357+ 6 . ** Custom validation rules** via pluggable validators
0 commit comments