GAMS Java API - Tutorial and Examples
The example enfores referential integrity also known in the GAMS lingo as domain checking. More...
The example enfores referential integrity also known in the GAMS lingo as domain checking.
The Java API does a delayed domain checking of symbols. So you can add records to a domain controlled parameter (e.g. p(i)) even though the GAMSSet i does not contain the label (yet). The user can trigger an explicit check of the referential integrity by calling the GAMSDatabase.checkDomains (or GAMSSymbol.checkDomains) method. The Java API provides methods to access the records that violate the referential integrity (see GAMSDatabaseDomainViolation for details). Domain checking is implicitly done when the GAMSDatabase is exported to a GDX file via the GAMSDatabase.export method or for databases provided in the GAMSJob.run The implicit domain check can be suppressed (and left to GAMS when importing data) via the GAMSDatabase.suppressAutoDomainChecking property. This example demonstrates how to trigger domain checking and how to access the records that violate the referential integrity.