Hi
I am going through the example on SAS's website to learn about Proc Optmodel (the link below).
https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.2&docsetId=casmopt&docsetTarget=casm...
code taken from SAS website:
proc optmodel;
/* declare sets and data indexed by sets */
set <string> Products;
set <string> Processes;
num Profit{Products};
num AvailableTime{Processes};
num RequiredTime{Products,Processes};
/* declare the variable */
var Amount{Products};
/* maximize objective function (profit) */
maximize TotalProfit = sum{p in Products} Profit[p]*Amount[p];
/* subject to constraints */
con Availability{r in Processes}:
sum{p in Products} RequiredTime[p,r]*Amount[p] <= AvailableTime[r];
/* abstract algebraic model that captures the structure of the */
/* optimization problem has been defined without referring */
/* to a single data constant */
/* populate model by reading in the specific data instance */
read data Products into Products=[name] Profit;
read data Processes into Processes=[name] AvailableTime=Available_time
{p in Products} <RequiredTime[p,name]= col(p)>;
/* solve LP using primal simplex solver */
solve with lp / solver = primal_spx;
/* display solution */
print Amount;
quit;
1- My first question is on the parameter RequiredTime that is being defined by two sets (products and processes).
num RequiredTime{Products,Processes};
Requiredtime is only available in processess data set and not in products, what is the logic for defining this parameter against two datasets one of which does not contain this attribute?
2- the next question is if anyone can help me understand the constraint which is summarizing all 4 constraints as explained in the example in one line?
Thank you