Error message unkown source

Hello,

I am trying to formulate a program but I keep on getting this error message eventhough I feel like my program is right “timeavai is not a subscripted param
context: param: timeavai >>> := <<< 120”
here is my mod file
set car;

param timepc {car}; #factory time required per car

param profitpc {car}; #profit produced per car

param orders {car}; #orders for a car

param timeavai;

var produce {car};

maximize profit:

sum {c in car} profitpc[c] * produce[c];

subject to time_constraint:

sum {c in car} timepc[c] * produce[c] <= timeavai;

subject to Orders{c in car}:

produce[c] >= orders[c];
and here is my data file
set car := T C L;

param: timepc profitpc orders :=
T 1 200 10
C 2 500 20
L 3 700 15 ;

param: timeavai := 120 ;

1 Like

Hi @bruna,

You can set the value for timeavai with param timeavai := 120 ;. The : before is just when the data is in table form.

Thank you very much!

1 Like