Functions | |
def | scen_solve (i, mi_sub, cutconst, cutcoeff, dem_queue, obj_sub, queue_lock, io_lock) |
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) |
int | num_threads = 2 |
list | mi_sub = [] |
Queue | dem_queue = Queue() |
list | received |
list | demand = mi_sub[0].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 | |
dict | dem_dict |
Lock | queue_lock = Lock() |
Lock | io_lock = Lock() |
list | obj_sub = [0.0] * num_threads |
list | cons = [0.0] * num_threads |
dict | coef |
dict | threads = {} |
target | |
args | |
float | obj_sub_sum = 0.0 |
Function Documentation
◆ scen_solve()
def benders_2stage_mt.scen_solve | ( | i, | |
mi_sub, | |||
cutconst, | |||
cutcoeff, | |||
dem_queue, | |||
obj_sub, | |||
queue_lock, | |||
io_lock | |||
) |
Definition at line 163 of file benders_2stage_mt.py.
Variable Documentation
◆ all_model_types
benders_2stage_mt.all_model_types |
Definition at line 211 of file benders_2stage_mt.py.
◆ args
benders_2stage_mt.args |
Definition at line 316 of file benders_2stage_mt.py.
◆ coef
dict benders_2stage_mt.coef |
Definition at line 307 of file benders_2stage_mt.py.
◆ cons
list benders_2stage_mt.cons = [0.0] * num_threads |
Definition at line 306 of file benders_2stage_mt.py.
◆ cp_master
benders_2stage_mt.cp_master = ws.add_checkpoint() |
Definition at line 213 of file benders_2stage_mt.py.
◆ cp_sub
benders_2stage_mt.cp_sub = ws.add_checkpoint() |
Definition at line 214 of file benders_2stage_mt.py.
◆ cutcoeff
GamsWorkspace benders_2stage_mt.cutcoeff |
Definition at line 223 of file benders_2stage_mt.py.
◆ cutconst
GamsWorkspace benders_2stage_mt.cutconst |
Definition at line 220 of file benders_2stage_mt.py.
◆ data
GamsWorkspace benders_2stage_mt.data = ws.add_job_from_string(GAMS_DATA) |
Definition at line 199 of file benders_2stage_mt.py.
◆ databases
benders_2stage_mt.databases |
Definition at line 217 of file benders_2stage_mt.py.
◆ dem_dict
dict benders_2stage_mt.dem_dict |
Definition at line 282 of file benders_2stage_mt.py.
◆ dem_queue
Queue benders_2stage_mt.dem_queue = Queue() |
Definition at line 244 of file benders_2stage_mt.py.
◆ demand
list benders_2stage_mt.demand = mi_sub[0].sync_db.add_parameter("demand", 1, "stochastic demand") |
Definition at line 249 of file benders_2stage_mt.py.
◆ GAMS_DATA
str benders_2stage_mt.GAMS_DATA |
Definition at line 25 of file benders_2stage_mt.py.
◆ GAMS_MASTER_MODEL
str benders_2stage_mt.GAMS_MASTER_MODEL |
Definition at line 63 of file benders_2stage_mt.py.
◆ GAMS_SUB_MODEL
str benders_2stage_mt.GAMS_SUB_MODEL |
Definition at line 121 of file benders_2stage_mt.py.
◆ io_lock
Lock benders_2stage_mt.io_lock = Lock() |
Definition at line 304 of file benders_2stage_mt.py.
◆ it
int benders_2stage_mt.it = 1 |
Definition at line 261 of file benders_2stage_mt.py.
◆ lower_bound
max benders_2stage_mt.lower_bound = float("-inf") |
Definition at line 258 of file benders_2stage_mt.py.
◆ master
GamsWorkspace benders_2stage_mt.master = ws.add_job_from_string(GAMS_MASTER_MODEL) |
Definition at line 216 of file benders_2stage_mt.py.
◆ max_iter
int benders_2stage_mt.max_iter = 40 |
Definition at line 209 of file benders_2stage_mt.py.
◆ mi_master
GamsWorkspace benders_2stage_mt.mi_master = cp_master.add_modelinstance() |
Definition at line 219 of file benders_2stage_mt.py.
◆ mi_sub
list benders_2stage_mt.mi_sub = [] |
Definition at line 243 of file benders_2stage_mt.py.
◆ num_threads
int benders_2stage_mt.num_threads = 2 |
Definition at line 242 of file benders_2stage_mt.py.
◆ obj_master
tuple benders_2stage_mt.obj_master = float("inf") |
Definition at line 260 of file benders_2stage_mt.py.
◆ obj_sub
list benders_2stage_mt.obj_sub = [0.0] * num_threads |
Definition at line 305 of file benders_2stage_mt.py.
◆ obj_sub_sum
float benders_2stage_mt.obj_sub_sum = 0.0 |
Definition at line 322 of file benders_2stage_mt.py.
◆ opt
benders_2stage_mt.opt = ws.add_options() |
Definition at line 207 of file benders_2stage_mt.py.
◆ opt_data
GamsWorkspace benders_2stage_mt.opt_data = ws.add_options() |
Definition at line 201 of file benders_2stage_mt.py.
◆ queue_lock
Lock benders_2stage_mt.queue_lock = Lock() |
Definition at line 303 of file benders_2stage_mt.py.
◆ received
list benders_2stage_mt.received |
Definition at line 246 of file benders_2stage_mt.py.
◆ scenario_data
GamsWorkspace benders_2stage_mt.scenario_data = data.out_db["ScenarioData"] |
Definition at line 206 of file benders_2stage_mt.py.
◆ sub
GamsWorkspace benders_2stage_mt.sub = ws.add_job_from_string(GAMS_SUB_MODEL) |
Definition at line 240 of file benders_2stage_mt.py.
◆ sys_dir
sys benders_2stage_mt.sys_dir = sys.argv[1] if len(sys.argv) > 1 else None |
Definition at line 196 of file benders_2stage_mt.py.
◆ target
benders_2stage_mt.target |
Definition at line 315 of file benders_2stage_mt.py.
◆ theta
GamsWorkspace benders_2stage_mt.theta |
Definition at line 226 of file benders_2stage_mt.py.
◆ theta_fix
GamsWorkspace benders_2stage_mt.theta_fix = mi_master.sync_db.add_parameter("thetaFix", 0) |
Definition at line 229 of file benders_2stage_mt.py.
◆ threads
dict benders_2stage_mt.threads = {} |
Definition at line 312 of file benders_2stage_mt.py.
◆ upper_bound
GamsWorkspace benders_2stage_mt.upper_bound = float("inf") |
Definition at line 259 of file benders_2stage_mt.py.
◆ value
benders_2stage_mt.value |
Definition at line 262 of file benders_2stage_mt.py.
◆ ws
GamsWorkspace benders_2stage_mt.ws = GamsWorkspace(system_directory=sys_dir) |
Definition at line 197 of file benders_2stage_mt.py.