domain_checking Namespace Reference

Functions

def get_data_text ()
 

Variables

 ws = GamsWorkspace(system_directory = sys.argv[1])
 
list plants = [ "Seattle", "San-Diego" ]
 
list markets = [ "New-York", "Chicago", "Topeka" ]
 
dictionary capacity = { "Seattle": 350.0, "San-Diego": 600.0 }
 
dictionary demand = { "New-York": 325.0, "Chicago": 300.0, "Topeka": 275.0 }
 
dictionary distance
 
 db = ws.add_database()
 
 i = db.add_set("i", 1, "canning plants")
 
 j = GamsSet(db, "j", 1, "markets")
 
 a = db.add_parameter_dc("a", [i], "capacity at plant")
 
 value
 
 b = db.add_parameter_dc("b", ["j"], "demand at market j in cases")
 
 d = db.add_parameter_dc("d",[i,j], "distance in thousands of miles")
 
int dv_cnt = 0
 
 end
 
 vi
 
 keys
 
bool saw_exception = False
 
 suppress_auto_domain_checking
 
 db2 = ws.add_database_from_gdx("test.gdx")
 
 d2 = db2.get_parameter("d")
 
 j_alias = ws.add_job_from_string(get_data_text())
 
 ii = j_alias.out_db.get_set("ii")
 
 test_db = ws.add_database()
 
 test_set = test_db.add_set("test", 1)
 
 text
 
 Text
 

Function Documentation

◆ get_data_text()

def domain_checking.get_data_text ( )

Definition at line 26 of file domain_checking.py.

26def get_data_text():
27 return '''
28 Sets
29 i canning plants / seattle, san-diego /;
30
31 Alias (i,ii);'''
32

Variable Documentation

◆ a

domain_checking.a = db.add_parameter_dc("a", [i], "capacity at plant")

Definition at line 65 of file domain_checking.py.

◆ b

domain_checking.b = db.add_parameter_dc("b", ["j"], "demand at market j in cases")

Definition at line 74 of file domain_checking.py.

◆ capacity

dictionary domain_checking.capacity = { "Seattle": 350.0, "San-Diego": 600.0 }

Definition at line 42 of file domain_checking.py.

◆ d

domain_checking.d = db.add_parameter_dc("d",[i,j], "distance in thousands of miles")

Definition at line 83 of file domain_checking.py.

◆ d2

domain_checking.d2 = db2.get_parameter("d")

Definition at line 213 of file domain_checking.py.

◆ db

domain_checking.db = ws.add_database()

Definition at line 53 of file domain_checking.py.

◆ db2

domain_checking.db2 = ws.add_database_from_gdx("test.gdx")

Definition at line 212 of file domain_checking.py.

◆ demand

dictionary domain_checking.demand = { "New-York": 325.0, "Chicago": 300.0, "Topeka": 275.0 }

Definition at line 43 of file domain_checking.py.

◆ distance

dictionary domain_checking.distance
Initial value:
1= { ("Seattle", "New-York") : 2.5,
2 ("Seattle", "Chicago") : 1.7,
3 ("Seattle", "Topeka") : 1.8,
4 ("San-Diego", "New-York") : 2.5,
5 ("San-Diego", "Chicago") : 1.8,
6 ("San-Diego", "Topeka") : 1.4
7 }

Definition at line 44 of file domain_checking.py.

◆ dv_cnt

int domain_checking.dv_cnt = 0

Definition at line 118 of file domain_checking.py.

◆ end

domain_checking.end

Definition at line 121 of file domain_checking.py.

◆ i

domain_checking.i = db.add_set("i", 1, "canning plants")

Definition at line 56 of file domain_checking.py.

◆ ii

domain_checking.ii = j_alias.out_db.get_set("ii")

Definition at line 241 of file domain_checking.py.

◆ j

domain_checking.j = GamsSet(db, "j", 1, "markets")

Definition at line 60 of file domain_checking.py.

◆ j_alias

domain_checking.j_alias = ws.add_job_from_string(get_data_text())

Definition at line 239 of file domain_checking.py.

◆ keys

domain_checking.keys

Definition at line 125 of file domain_checking.py.

◆ markets

list domain_checking.markets = [ "New-York", "Chicago", "Topeka" ]

Definition at line 41 of file domain_checking.py.

◆ plants

list domain_checking.plants = [ "Seattle", "San-Diego" ]

Definition at line 40 of file domain_checking.py.

◆ saw_exception

bool domain_checking.saw_exception = False

Definition at line 201 of file domain_checking.py.

◆ suppress_auto_domain_checking

domain_checking.suppress_auto_domain_checking

Definition at line 206 of file domain_checking.py.

◆ test_db

domain_checking.test_db = ws.add_database()

Definition at line 246 of file domain_checking.py.

◆ test_set

domain_checking.test_set = test_db.add_set("test", 1)

Definition at line 247 of file domain_checking.py.

◆ text

domain_checking.text

Definition at line 255 of file domain_checking.py.

◆ Text

domain_checking.Text

Definition at line 285 of file domain_checking.py.

◆ value

domain_checking.value

Definition at line 67 of file domain_checking.py.

◆ vi

domain_checking.vi

Definition at line 123 of file domain_checking.py.

◆ ws

domain_checking.ws = GamsWorkspace(system_directory = sys.argv[1])

Definition at line 35 of file domain_checking.py.