I have an optmodel run that really considers a larger number of different experiements and solves them using PROBLEM. To do that I have combinations of constraints that are setup as a problem like this:
use problem A;
solve with milp / distributed=true relobjgap=&relobjgap. maxtime=&maxruntime.;
create data ("fac_output_a") from [i j k]={<i,j,k> in ARCS: Assign[i,j,k].sol > 0.5} distance[i,j] Assign pct_sdu[j] n_AFCS200[i] n_CIOSS[i] n_LCREM2[i] n_AFSM100[i] n_DBCS[i] n_DIOSS[i] n_TrayInductions[i] PackageSqFt[i,j,k] building_sq_feet[i];
use problem B;
solve with milp / distributed=true relobjgap=&relobjgap. maxtime=&maxruntime.;
create data ("fac_output_b") from [i j k]={<i,j,k> in ARCS: Assign[i,j,k].sol > 0.5} distance[i,j] Assign pct_sdu[j] n_AFCS200[i] n_CIOSS[i] n_LCREM2[i] n_AFSM100[i] n_DBCS[i] n_DIOSS[i] n_TrayInductions[i] PackageSqFt[i,j,k] building_sq_feet[i];
Then just before I get to my solve statements I setup the final problems I want to solve like this:
problem A from base include total_packages force_model_det;
problem B from base include force_plant force_zip3_atl state_con total_packages force_model_det;
and then solve them like this:
use problem A;
solve with milp / distributed=true relobjgap=&relobjgap. maxtime=&maxruntime.;
create data ("fac_output_a") from [i j k]={<i,j,k> in ARCS: Assign[i,j,k].sol > 0.5} distance[i,j] Assign pct_sdu[j] n_AFCS200[i] n_CIOSS[i] n_LCREM2[i] n_AFSM100[i] n_DBCS[i] n_DIOSS[i] n_TrayInductions[i] PackageSqFt[i,j,k] building_sq_feet[i];
use problem B;
solve with milp / distributed=true relobjgap=&relobjgap. maxtime=&maxruntime.;
create data ("fac_output_b") from [i j k]={<i,j,k> in ARCS: Assign[i,j,k].sol > 0.5} distance[i,j] Assign pct_sdu[j] n_AFCS200[i] n_CIOSS[i] n_LCREM2[i] n_AFSM100[i] n_DBCS[i] n_DIOSS[i] n_TrayInductions[i] PackageSqFt[i,j,k] building_sq_feet[i];
I have a new experiment to add that I need to break out some of the constraints, so I added:
problem tx_zip3;
use problem tx_zip3;
con force_zip3_dallas_exe {i in PLANT, k in ZIP3:<i,k> in ARCS2 and i='1435750'}:
Assign2[i,k] = (if k in {'710','711','717','718','750','751','752','753','754','755','756','757','758','759','760','761','762','763','764','766','767','768','769','795','796'} then 1 else 0);
con force_zip3_amarillo_exe {i in PLANT, k in ZIP3:<i,k> in ARCS2 and i='1441177'}:
Assign2[i,k] = (if k in {'678','679','739','790','791','792','793','794','797','881','882','884'} then 1 else 0);
con force_zip3_nhouston_exe {i in PLANT, k in ZIP3:<i,k> in ARCS2 and i='1441192'}:
Assign2[i,k] = (if k in {'770','772','773','774','775','776','777','778'} then 1 else 0);
con force_zip3_sanantonio_exe {i in PLANT, k in ZIP3:<i,k> in ARCS2 and i='1441198'}:
Assign2[i,k] = (if k in {'765','779','780','781','782','783','784','785','786','787','788','789'} then 1 else 0);
But then when I try to use that problem like I have in the examples above I get an error message that tx_zip3 does not contain a variable, objective or constraint:
376 problem sol_m_tx from final_zip3_assign include tx_zip3;
-
787
ERROR 787-782: The name 'tx_zip3' does not specify an objective, variable, or constraint.
... View more