Loading...
Searching...
No Matches
matlab.gams.control.Set Class Reference

Representation of a set symbol in GAMS. More...

Inheritance diagram for matlab.gams.control.Set:
matlab.gams.control.Symbol

Public Member Functions

gams.control.SetRecord addRecord (varargin)
 Add record to Symbol.
 
gams.control.SetRecord findRecord (varargin)
 Find record in Symbol.
 
gams.control.SetRecord getFirstRecord (varargin)
 Get the first record of Symbol.
 
gams.control.SetRecord getLastRecord (varargin)
 Get the last record of Symbol.
 
Iterator iterator ()
 Returns an iterator over a set of SymbolRecord instances.
 
gams.control.SetRecord 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.SetType setType
 (read only) subtype of this Set
 
- 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 set symbol in GAMS.

A Symbol exists in a Database and contains SetRecord instances which one can iterate through.

See also
Database, SetRecord

Member Function Documentation

◆ addRecord()

gams.control.SetRecord matlab.gams.control.Set.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.SetRecord matlab.gams.control.Set.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.SetRecord matlab.gams.control.Set.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.SetRecord matlab.gams.control.Set.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.Set.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.SetRecord matlab.gams.control.Set.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.