Thank you for your quick response and sorry for disturb you again.
I included your statement but still the error is presented. I don't know what
the command "card" is doing. Where can I find a documentation or list of
commands?
Right now the code I have is the following, and the same error is presented:
set SCHEDULES := 1..288 ;
param Temp {k in SCHEDULES} := if k=1 then TempIN_Meas[k] else
(if (TempIN_Meas[1]<TempSPDN[1] or TempIN_Meas[1]>TempSPUP[1]) then
(Temp[k-1] + 5*(BetaAC * ActLev[k] + OutTemp[k]*GamaAC))/(1+5*GamaAC));
param index {k in SCHEDULES} := if (Temp[k]<TempSPDN[k] or Temp[k]>TempSPUP[k])
then 0 else k;
param index1 := if card(SCHEDULES) = 0 then 1 else (min{k in SCHEDULES:
index[k] != 0} k);
Thank you very much for your time
Victor
--- El lun 2-jul-12, Andrew Makhorin <[email protected]> escribió:
De: Andrew Makhorin <[email protected]>
Asunto: Re: [Help-glpk] Problem with min command
A: "Victor Gutierrez" <[email protected]>
Cc: [email protected]
Fecha: lunes, 2 de julio de 2012, 11:33
> Initially I wanted to detect the index of an array where the value is
> different of zero, you guys helped me suggested me the following
> command:
>
> param index1 := min{k in SCHEDULES: values[k] != 0} k;
>
> The problem arises because there are some cases where the whole array
> "values" has zero values, and the min command does not work, a message
> error is shown:
> "min{} over empty set; result undefined
> MathProg model processing error"
>
> and for these cases a value of index=1 will help me a lot.
> Does anybody have some suggestions?
param index1 := if card(SCHEDULES) = 0 then
0
else
(min{k in SCHEDULES: values[k] != 0} k);
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk