Representation of a variable symbol in GAMS. More...
Public Member Functions | |
gams.control.VariableRecord | addRecord (varargin) |
Add record to Symbol. | |
gams.control.VariableRecord | findRecord (varargin) |
Find record in Symbol. | |
gams.control.VariableRecord | getFirstRecord (varargin) |
Get the first record of Symbol. | |
gams.control.VariableRecord | getLastRecord (varargin) |
Get the last record of Symbol. | |
Iterator | iterator () |
Returns an iterator over a set of SymbolRecord instances. | |
gams.control.VariableRecord | mergeRecord (varargin) |
Find record with specified keys in Symbol. | |
Public Member Functions inherited from matlab.gams.control.Symbol | |
gams.control.SymbolRecord | addRecord (varargin) |
Add record to Symbol. | |
logical | checkDomains () |
Check domains of all SymbolRecord instances of the symbol. | |
logical | clear () |
Clear symbol by removing all records of this symbol. | |
void | copySymbol (gams.control.Symbol target) |
Copy all records of this Symbol to target Symbol. | |
logical | deleteRecord (varargin) |
Delete record from Symbol. | |
logical | equals (any object) |
Indicates whether some other object is "equal to" this one. | |
gams.control.SymbolRecord | findRecord (varargin) |
Find record in Symbol. | |
gams.control.SymbolRecord | getFirstRecord (varargin) |
Get the first record of Symbol. | |
gams.control.SymbolRecord | getLastRecord (varargin) |
Get the last record of Symbol. | |
cell | getSymbolDomainViolations (integer maxNoViolation) |
Check domains of all SymbolRecord instances in the Symbol. | |
integer | hashCode () |
Returns a hash code value for the object. | |
Iterator | iterator () |
Returns an iterator over a set of SymbolRecord instances. | |
gams.control.SymbolRecord | mergeRecord (varargin) |
Find record with specified keys in Symbol. | |
Public Attributes | |
gams.control.globals.VarType | varType |
(read only) subtype of this Variable | |
Public Attributes inherited from matlab.gams.control.Symbol | |
gams.control.Database | database |
(read only) Database containing Symbol | |
integer | dimension |
(read only) Symbol dimension | |
cell | domains |
(read only) Domains of Symbol, each element is either a Set (real domain) or a string (relaxed domain) | |
cell | domainsAsStrings |
(read only) Domains of Symbol, each element is a string | |
gams.control.SymbolRecord | firstRecord |
(read only) first record of Symbol | |
gams.control.SymbolRecord | lastRecord |
(read only) last record of Symbol | |
string | name |
(read only) Symbol name | |
integer | numberOfRecords |
(read only) Number of records of the Symbol | |
gams.control.SymbolRecord | record |
(read only) record of Symbol | |
cell | records |
(read only) list of SymbolRecord instances contained in Symbol | |
string | text |
(read only) Symbol explanatory text | |
Detailed Description
Representation of a variable symbol in GAMS.
A Symbol exists in a Database and contains VariableRecord instances which one can iterate through.
- See also
- Database, VariableRecord, globals.VarType
Member Function Documentation
◆ addRecord()
gams.control.VariableRecord matlab.gams.control.Variable.addRecord | ( | varargin | ) |
Add record to Symbol.
Valid VARARGIN signatures:
- {string key1, ..., string keyN}
- string key1, ..., string keyN
Arguments:
- key1,...,keyN: Keys of record. Empty string is not a valid key.
Return: instance of SymbolRecord
- See also
- SymbolRecord
Reimplemented from matlab.gams.control.Symbol.
◆ findRecord()
gams.control.VariableRecord matlab.gams.control.Variable.findRecord | ( | varargin | ) |
Find record in Symbol.
Valid VARARGIN signatures:
- {string key1, ..., string keyN}
- string key1, ..., string keyN
Arguments:
- key1,...,keyN: Keys of record. Empty string is not a valid key.
Reimplemented from matlab.gams.control.Symbol.
◆ getFirstRecord()
gams.control.VariableRecord matlab.gams.control.Variable.getFirstRecord | ( | varargin | ) |
Get the first record of Symbol.
Retrieve the first record in Symbol that meets the slice criteria. For example:
* try * fprintf('Transportation costs to chicago\n'); * slice = {' ', 'chicago'}; * c = t1.outDB.getParameter('c'); * x1 = c.getFirstRecord(slice); * while true * fprintf('from %s to %s\n', x1.key(1), x1.key(2)); * if ~x1.moveNext() * break; * end * end * catch * fprintf('No records found\n'); * end *
Valid VARARGIN signatures:
- {string slice1, ..., string sliceN}
- string slice1, ..., string sliceN
Arguments:
- slice1,...,sliceN: Define filter for elements whose record should be retrieved
Return: instance of first SymbolRecord found
- See also
- SymbolRecord
Reimplemented from matlab.gams.control.Symbol.
◆ getLastRecord()
gams.control.VariableRecord matlab.gams.control.Variable.getLastRecord | ( | varargin | ) |
Get the last record of Symbol.
Retrieve the first record in Symbol that meets the slice criteria.
Valid VARARGIN signatures:
- {string slice1, ..., string sliceN}
- string slice1, ..., string sliceN
Arguments:
- slice1,...,sliceN: Define filter for elements whose record should be retrieved
Return: instance of first SymbolRecord found
- See also
- SymbolRecord
Reimplemented from matlab.gams.control.Symbol.
◆ iterator()
Iterator matlab.gams.control.Variable.iterator | ( | ) |
Returns an iterator over a set of SymbolRecord instances.
Return: an iterator over a set of SymbolRecord instances
Reimplemented from matlab.gams.control.Symbol.
◆ mergeRecord()
gams.control.VariableRecord matlab.gams.control.Variable.mergeRecord | ( | varargin | ) |
Find record with specified keys in Symbol.
In case the record is not found, the record with the specified keys will be added and returned the call.
Valid VARARGIN signatures:
- {string key1, ..., string keyN}
- string key1, ..., string keyN
Arguments:
- key1,...,keyN: Keys of record. Empty string is not a valid key.
Return: Reference to record that is found or added
Reimplemented from matlab.gams.control.Symbol.