Loading...
Searching...
No Matches
com.gams.examples.domain.DomainCheck Class Reference

The example enforces referential integrity also known in the GAMS lingo as domain checking. More...

Detailed Description

The example enforces 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.

Definition at line 36 of file DomainCheck.java.