run_engine Namespace Reference

Functions

def get_data_text ()
 
def get_model_text ()
 

Variables

 ws = GamsWorkspace(system_directory=sys.argv[1])
 
 engine_configuration
 
 t3 = ws.add_job_from_string(get_data_text())
 
 gdx_file_path = os.path.join(ws.working_directory, "tdata.gdx")
 
 opt = ws.add_options()
 
 all_model_types
 
 extra_model_files
 
 engine_options
 
 gams_options
 
dictionary expected_levels
 
 cp = ws.add_checkpoint()
 
 t3a = ws.add_job_from_string(get_data_text())
 
 t3b = ws.add_job_from_string(get_model_text())
 
 databases
 
 out_db
 
 checkpoint
 
list bmultExpected
 
 t5
 
 j1 = ws.add_job_from_file("clad")
 
 option_file1_path = os.path.join(ws.working_directory, "cplex.opt")
 
 option_file2_path = os.path.join(ws.working_directory, "cplex.op2")
 
 mip
 
 optfile
 
 solvelink
 
 sw = StringIO()
 
 opt_thread
 
float prev_step = 0.0
 
 log = sw.getvalue()
 

Function Documentation

◆ get_data_text()

def run_engine.get_data_text ( )

Definition at line 24 of file run_engine.py.

24def get_data_text():
25  return '''
26  Sets
27  i canning plants / seattle, san-diego /
28  j markets / new-york, chicago, topeka / ;
29 
30  Parameters
31 
32  a(i) capacity of plant i in cases
33  / seattle 350
34  san-diego 600 /
35 
36  b(j) demand at market j in cases
37  / new-york 325
38  chicago 300
39  topeka 275 / ;
40 
41  Table d(i,j) distance in thousands of miles
42  new-york chicago topeka
43  seattle 2.5 1.7 1.8
44  san-diego 2.5 1.8 1.4 ;
45 
46  Scalar f freight in dollars per case per thousand miles /90/ ;
47  Scalar bmult demand multiplier /1/; '''
48 
49 

◆ get_model_text()

def run_engine.get_model_text ( )

Definition at line 50 of file run_engine.py.

Variable Documentation

◆ all_model_types

run_engine.all_model_types

Definition at line 124 of file run_engine.py.

◆ bmultExpected

list run_engine.bmultExpected
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}]

Definition at line 154 of file run_engine.py.

◆ checkpoint

run_engine.checkpoint

Definition at line 149 of file run_engine.py.

◆ cp

run_engine.cp = ws.add_checkpoint()

Definition at line 141 of file run_engine.py.

◆ databases

run_engine.databases

Definition at line 149 of file run_engine.py.

◆ engine_configuration

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

Definition at line 111 of file run_engine.py.

◆ engine_options

run_engine.engine_options

Definition at line 127 of file run_engine.py.

◆ expected_levels

dictionary run_engine.expected_levels
Initial value:
1= {"seattle.new-york": 0.0, "seattle.chicago": 300.0, "seattle.topeka": 0.0,
2  "san-diego.new-york": 325.0, "san-diego.chicago": 0.0, "san-diego.topeka": 275.0}

Definition at line 130 of file run_engine.py.

◆ extra_model_files

run_engine.extra_model_files

Definition at line 126 of file run_engine.py.

◆ gams_options

run_engine.gams_options

Definition at line 129 of file run_engine.py.

◆ gdx_file_path

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

Definition at line 118 of file run_engine.py.

◆ j1

run_engine.j1 = ws.add_job_from_file("clad")

Definition at line 177 of file run_engine.py.

◆ log

run_engine.log = sw.getvalue()

Definition at line 221 of file run_engine.py.

◆ mip

run_engine.mip

Definition at line 195 of file run_engine.py.

◆ opt

run_engine.opt = ws.add_options()

Definition at line 122 of file run_engine.py.

◆ opt_thread

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

Definition at line 202 of file run_engine.py.

◆ optfile

run_engine.optfile

Definition at line 196 of file run_engine.py.

◆ option_file1_path

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

Definition at line 180 of file run_engine.py.

◆ option_file2_path

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

Definition at line 190 of file run_engine.py.

◆ out_db

run_engine.out_db

Definition at line 149 of file run_engine.py.

◆ prev_step

float run_engine.prev_step = 0.0

Definition at line 208 of file run_engine.py.

◆ solvelink

run_engine.solvelink

Definition at line 197 of file run_engine.py.

◆ sw

run_engine.sw = StringIO()

Definition at line 199 of file run_engine.py.

◆ t3

run_engine.t3 = ws.add_job_from_string(get_data_text())

Definition at line 116 of file run_engine.py.

◆ t3a

run_engine.t3a = ws.add_job_from_string(get_data_text())

Definition at line 143 of file run_engine.py.

◆ t3b

run_engine.t3b = ws.add_job_from_string(get_model_text())

Definition at line 144 of file run_engine.py.

◆ t5

run_engine.t5
Initial value:
1= ws.add_job_from_string(
2  "bmult=" + str(scen["bmult"]) + "; solve transport min z use lp; ms=transport.modelstat; ss=transport.solvestat;", cp)

Definition at line 160 of file run_engine.py.

◆ ws

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

Definition at line 102 of file run_engine.py.

def get_data_text()
Definition: run_engine.py:24