This is the representation of a symbol in GAMS. More...

Public Member Functions | |
__len__ (self) | |
Retrieve the number of records of the GamsSymbol. | |
copy_symbol (self, target) | |
Copys all records from the GamsSymbol to the target GamsSymbol (if target had records, they will be deleted) | |
delete_record (self, keys=None) | |
Delete GamsSymbol record. | |
clear (self) | |
Clear symbol. | |
find_record (self, keys=None) | |
Find record in GamsSymbol. | |
add_record (self, keys=None) | |
Add record to GamsSymbol. | |
merge_record (self, keys=None) | |
Finds record in GamsSymbol if it exists, adds it if not. | |
first_record (self, slice=None) | |
Retrieve first record in GamsSymbol. | |
check_domains (self) | |
Check if all records are within the specified domain of the symbol. | |
get_symbol_dvs (self, max_viol=0) | |
return all GamsSymbolDomainViolations | |
Properties | |
domains = property(get_domains) | |
Domains of Symbol, each element is either a GamsSet (real domain) or a string (relaxed domain) | |
domains_as_strings = property(get_domains_as_strings) | |
Domains of Symbol, each element is a string. | |
dimension = property(get_dimension) | |
Get GamsSymbol dimension. | |
text = property(get_text) | |
Get explanatory text of GamsSymbol. | |
name = property(get_name) | |
Get GamsSymbol name. | |
database = property(get_database) | |
Get GamsDatabase containing GamsSymbol. | |
number_records = property(get_number_records) | |
Retrieve the number of records of the GamsSymbol. | |
Detailed Description
This is the representation of a symbol in GAMS.
It exists in a GamsDatabase and contains GamsSymbolRecords which one can iterate through. Derived classes are GamsEquation, GamsParameter, GamsSet and GamsVariable.
Member Function Documentation
◆ add_record()
gams.control.database._GamsSymbol.add_record | ( | self, | |
keys = None ) |
Add record to GamsSymbol.
- Parameters
-
keys List of keys
- Returns
- Reference to added record
◆ check_domains()
gams.control.database._GamsSymbol.check_domains | ( | self | ) |
Check if all records are within the specified domain of the symbol.
- Returns
- True: Everything is correct, False: There is a domain violation
◆ clear()
gams.control.database._GamsSymbol.clear | ( | self | ) |
Clear symbol.
- Returns
- True if everything worked, else False
◆ copy_symbol()
gams.control.database._GamsSymbol.copy_symbol | ( | self, | |
target ) |
Copys all records from the GamsSymbol to the target GamsSymbol (if target had records, they will be deleted)
- Parameters
-
target Target GamsSymbol
- Returns
- True if everything worked, else false
◆ delete_record()
gams.control.database._GamsSymbol.delete_record | ( | self, | |
keys = None ) |
Delete GamsSymbol record.
- Parameters
-
keys List of keys
- Returns
- True if everything worked, else False
◆ find_record()
gams.control.database._GamsSymbol.find_record | ( | self, | |
keys = None ) |
Find record in GamsSymbol.
- Parameters
-
keys List of keys
- Returns
- Reference to found record
◆ first_record()
gams.control.database._GamsSymbol.first_record | ( | self, | |
slice = None ) |
Retrieve first record in GamsSymbol.
- Parameters
-
slice Define filter for elements whose record should be retrieved print("Transportation costs from Seattle")record = job.out_db.get_parameter("c").first_record(["seattle", " "])
- Returns
- Reference to record
◆ get_symbol_dvs()
gams.control.database._GamsSymbol.get_symbol_dvs | ( | self, | |
max_viol = 0 ) |
return all GamsSymbolDomainViolations
- Parameters
-
max_viol The maximum number of domain violations which should be stored (0 for no limit)
- Returns
- List containing GamsSymbolDomainViolation objects
◆ merge_record()
gams.control.database._GamsSymbol.merge_record | ( | self, | |
keys = None ) |
Finds record in GamsSymbol if it exists, adds it if not.
- Parameters
-
keys List of keys
- Returns
- Reference to found or added record
Property Documentation
◆ domains_as_strings
|
static |
Domains of Symbol, each element is a string.
Note: If the domains is as alias in GAMS, this call will return the name of the alias, not the name of the aliased set
◆ number_records
|
static |
Retrieve the number of records of the GamsSymbol.
- Note
- This is the same as calling len(symbol)