Loading...
Searching...
No Matches
benders_2stage Namespace Reference

Variables

str GAMS_DATA
 
str GAMS_MASTER_MODEL
 
str GAMS_SUB_MODEL
 
sys sys_dir = sys.argv[1] if len(sys.argv) > 1 else None
 
GamsWorkspace ws = GamsWorkspace(system_directory=sys_dir)
 
GamsWorkspace data = ws.add_job_from_string(GAMS_DATA)
 
GamsWorkspace opt_data = ws.add_options()
 
GamsWorkspace scenario_data = data.out_db["ScenarioData"]
 
GamsWorkspace opt = ws.add_options()
 
int max_iter = 40
 
 all_model_types
 
GamsWorkspace cp_master = ws.add_checkpoint()
 
GamsWorkspace cp_sub = ws.add_checkpoint()
 
GamsWorkspace master = ws.add_job_from_string(GAMS_MASTER_MODEL)
 
 databases
 
GamsWorkspace mi_master = cp_master.add_modelinstance()
 
GamsWorkspace cutconst
 
GamsWorkspace cutcoeff
 
GamsWorkspace theta
 
GamsWorkspace theta_fix = mi_master.sync_db.add_parameter("thetaFix", 0)
 
GamsWorkspace sub = ws.add_job_from_string(GAMS_SUB_MODEL)
 
GamsWorkspace mi_sub = cp_sub.add_modelinstance()
 
GamsWorkspace received = mi_sub.sync_db.add_parameter("received", 1, "units received from master")
 
GamsWorkspace demand = mi_sub.sync_db.add_parameter("demand", 1, "stochastic demand")
 
float lower_bound = float("-inf")
 
float upper_bound = float("inf")
 
float obj_master = float("inf")
 
int it = 1
 
 value
 
float obj_sub = 0.0
 
GamsWorkspace probability = scenario_data.find_record((s.key(0), "prob")).value
 

Variable Documentation

◆ all_model_types

benders_2stage.all_model_types

Definition at line 173 of file benders_2stage.py.

◆ cp_master

benders_2stage.cp_master = ws.add_checkpoint()

Definition at line 175 of file benders_2stage.py.

◆ cp_sub

benders_2stage.cp_sub = ws.add_checkpoint()

Definition at line 176 of file benders_2stage.py.

◆ cutcoeff

GamsWorkspace benders_2stage.cutcoeff
Initial value:
1= mi_master.sync_db.add_parameter(
2 "cutcoeff", 2, "Benders optimality coefficients"
3 )

Definition at line 185 of file benders_2stage.py.

◆ cutconst

GamsWorkspace benders_2stage.cutconst
Initial value:
1= mi_master.sync_db.add_parameter(
2 "cutconst", 1, "Benders optimality cut constant"
3 )

Definition at line 182 of file benders_2stage.py.

◆ data

GamsWorkspace benders_2stage.data = ws.add_job_from_string(GAMS_DATA)

Definition at line 161 of file benders_2stage.py.

◆ databases

benders_2stage.databases

Definition at line 179 of file benders_2stage.py.

◆ demand

GamsWorkspace benders_2stage.demand = mi_sub.sync_db.add_parameter("demand", 1, "stochastic demand")

Definition at line 206 of file benders_2stage.py.

◆ GAMS_DATA

str benders_2stage.GAMS_DATA

Definition at line 20 of file benders_2stage.py.

◆ GAMS_MASTER_MODEL

str benders_2stage.GAMS_MASTER_MODEL

Definition at line 58 of file benders_2stage.py.

◆ GAMS_SUB_MODEL

str benders_2stage.GAMS_SUB_MODEL

Definition at line 116 of file benders_2stage.py.

◆ it

int benders_2stage.it = 1

Definition at line 216 of file benders_2stage.py.

◆ lower_bound

max benders_2stage.lower_bound = float("-inf")

Definition at line 213 of file benders_2stage.py.

◆ master

GamsWorkspace benders_2stage.master = ws.add_job_from_string(GAMS_MASTER_MODEL)

Definition at line 178 of file benders_2stage.py.

◆ max_iter

int benders_2stage.max_iter = 40

Definition at line 171 of file benders_2stage.py.

◆ mi_master

GamsWorkspace benders_2stage.mi_master = cp_master.add_modelinstance()

Definition at line 181 of file benders_2stage.py.

◆ mi_sub

GamsWorkspace benders_2stage.mi_sub = cp_sub.add_modelinstance()

Definition at line 204 of file benders_2stage.py.

◆ obj_master

tuple benders_2stage.obj_master = float("inf")

Definition at line 215 of file benders_2stage.py.

◆ obj_sub

float benders_2stage.obj_sub = 0.0

Definition at line 244 of file benders_2stage.py.

◆ opt

benders_2stage.opt = ws.add_options()

Definition at line 169 of file benders_2stage.py.

◆ opt_data

GamsWorkspace benders_2stage.opt_data = ws.add_options()

Definition at line 163 of file benders_2stage.py.

◆ probability

GamsWorkspace benders_2stage.probability = scenario_data.find_record((s.key(0), "prob")).value

Definition at line 255 of file benders_2stage.py.

◆ received

GamsWorkspace benders_2stage.received = mi_sub.sync_db.add_parameter("received", 1, "units received from master")

Definition at line 205 of file benders_2stage.py.

◆ scenario_data

GamsWorkspace benders_2stage.scenario_data = data.out_db["ScenarioData"]

Definition at line 168 of file benders_2stage.py.

◆ sub

GamsWorkspace benders_2stage.sub = ws.add_job_from_string(GAMS_SUB_MODEL)

Definition at line 202 of file benders_2stage.py.

◆ sys_dir

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

Definition at line 158 of file benders_2stage.py.

◆ theta

GamsWorkspace benders_2stage.theta
Initial value:
1= mi_master.sync_db.add_variable(
2 "theta", 0, VarType.Free, "Future profit function variable"
3 )

Definition at line 188 of file benders_2stage.py.

◆ theta_fix

GamsWorkspace benders_2stage.theta_fix = mi_master.sync_db.add_parameter("thetaFix", 0)

Definition at line 191 of file benders_2stage.py.

◆ upper_bound

GamsWorkspace benders_2stage.upper_bound = float("inf")

Definition at line 214 of file benders_2stage.py.

◆ value

benders_2stage.value

Definition at line 217 of file benders_2stage.py.

◆ ws

GamsWorkspace benders_2stage.ws = GamsWorkspace(system_directory=sys_dir)

Definition at line 159 of file benders_2stage.py.