Loading...
Searching...
No Matches
run_engine Namespace Reference

Variables

str GAMS_DATA
 
str GAMS_MODEL
 
sys sys_dir = sys.argv[1] if len(sys.argv) > 1 else None
 
GamsWorkspace ws = GamsWorkspace(system_directory=sys_dir)
 
GamsEngineConfiguration engine_configuration
 
GamsWorkspace job = ws.add_job_from_string(GAMS_DATA)
 
os gdx_file_path = os.path.join(ws.working_directory, "tdata.gdx")
 
GamsWorkspace opt = ws.add_options()
 
 all_model_types
 
 extra_model_files
 
 engine_options
 
 gams_options
 
dict expected_levels
 
GamsWorkspace cp = ws.add_checkpoint()
 
GamsWorkspace job_a = ws.add_job_from_string(GAMS_DATA)
 
GamsWorkspace job_b = ws.add_job_from_string(GAMS_MODEL)
 
 databases
 
 out_db
 
 checkpoint
 
list expected_bmult
 
os option_file1_path = os.path.join(ws.working_directory, "cplex.opt")
 
os option_file2_path = os.path.join(ws.working_directory, "cplex.op2")
 
 mip
 
 optfile
 
 solvelink
 
StringIO sw = StringIO()
 
Thread opt_thread
 
StringIO log = sw.getvalue()
 

Variable Documentation

◆ all_model_types

run_engine.all_model_types

Definition at line 119 of file run_engine.py.

◆ checkpoint

run_engine.checkpoint

Definition at line 155 of file run_engine.py.

◆ cp

GamsWorkspace run_engine.cp = ws.add_checkpoint()

Definition at line 147 of file run_engine.py.

◆ databases

run_engine.databases

Definition at line 155 of file run_engine.py.

◆ engine_configuration

run_engine.engine_configuration
Initial value:
1= GamsEngineConfiguration(
2 host=os.environ["ENGINE_URL"],
3 username=os.environ["ENGINE_USER"],
4 password=os.environ["ENGINE_PASSWORD"],
5 namespace=os.environ["ENGINE_NAMESPACE"],
6 )

Definition at line 104 of file run_engine.py.

◆ engine_options

run_engine.engine_options

Definition at line 123 of file run_engine.py.

◆ expected_bmult

list run_engine.expected_bmult
Initial value:
1= [
2 {"bmult": 0.9, "ms": 1, "ss": 1, "obj": 138.31},
3 {"bmult": 1.2, "ms": 4, "ss": 1, "obj": 184.41},
4 ]

Definition at line 162 of file run_engine.py.

◆ expected_levels

dict run_engine.expected_levels
Initial value:
1= {
2 ("seattle", "new-york"): 0.0,
3 ("seattle", "chicago"): 300.0,
4 ("seattle", "topeka"): 0.0,
5 ("san-diego", "new-york"): 325.0,
6 ("san-diego", "chicago"): 0.0,
7 ("san-diego", "topeka"): 275.0,
8 }

Definition at line 128 of file run_engine.py.

◆ extra_model_files

run_engine.extra_model_files

Definition at line 122 of file run_engine.py.

◆ GAMS_DATA

str run_engine.GAMS_DATA
Initial value:
1= """
2Set
3 i 'canning plants' / seattle, san-diego /
4 j 'markets' / new-york, chicago, topeka /;
5
6Parameter
7 a(i) 'capacity of plant i in cases'
8 / seattle 350
9 san-diego 600 /
10
11 b(j) 'demand at market j in cases'
12 / new-york 325
13 chicago 300
14 topeka 275 /;
15
16Table d(i,j) 'distance in thousands of miles'
17 new-york chicago topeka
18 seattle 2.5 1.7 1.8
19 san-diego 2.5 1.8 1.4;
20
21Scalar
22 f 'freight in dollars per case per thousand miles' / 90 /
23 bmult 'demand multiplier' / 1 /;
24"""

Definition at line 21 of file run_engine.py.

◆ GAMS_MODEL

str run_engine.GAMS_MODEL

Definition at line 46 of file run_engine.py.

◆ gams_options

run_engine.gams_options

Definition at line 126 of file run_engine.py.

◆ gdx_file_path

os run_engine.gdx_file_path = os.path.join(ws.working_directory, "tdata.gdx")

Definition at line 113 of file run_engine.py.

◆ job

GamsWorkspace run_engine.job = ws.add_job_from_string(GAMS_DATA)

Definition at line 111 of file run_engine.py.

◆ job_a

GamsWorkspace run_engine.job_a = ws.add_job_from_string(GAMS_DATA)

Definition at line 149 of file run_engine.py.

◆ job_b

GamsWorkspace run_engine.job_b = ws.add_job_from_string(GAMS_MODEL)

Definition at line 153 of file run_engine.py.

◆ log

StringIO run_engine.log = sw.getvalue()

Definition at line 239 of file run_engine.py.

◆ mip

run_engine.mip

Definition at line 209 of file run_engine.py.

◆ opt

GamsWorkspace run_engine.opt = ws.add_options()

Definition at line 117 of file run_engine.py.

◆ opt_thread

Thread run_engine.opt_thread
Initial value:
1= Thread(
2 target=job.run_engine,
3 args=(engine_configuration,),
4 kwargs={
5 "output": sw,
6 "extra_model_files": [option_file1_path, option_file2_path, "claddat.gdx"],
7 "gams_options": opt,
8 },
9 )

Definition at line 216 of file run_engine.py.

◆ optfile

run_engine.optfile

Definition at line 210 of file run_engine.py.

◆ option_file1_path

os run_engine.option_file1_path = os.path.join(ws.working_directory, "cplex.opt")

Definition at line 194 of file run_engine.py.

◆ option_file2_path

os run_engine.option_file2_path = os.path.join(ws.working_directory, "cplex.op2")

Definition at line 204 of file run_engine.py.

◆ out_db

run_engine.out_db

Definition at line 155 of file run_engine.py.

◆ solvelink

run_engine.solvelink

Definition at line 211 of file run_engine.py.

◆ sw

StringIO run_engine.sw = StringIO()

Definition at line 213 of file run_engine.py.

◆ sys_dir

sys run_engine.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None

Definition at line 99 of file run_engine.py.

◆ ws

GamsWorkspace run_engine.ws = GamsWorkspace(system_directory=sys_dir)

Definition at line 100 of file run_engine.py.