help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Problem with min command


From: Andrew Makhorin
Subject: Re: [Help-glpk] Problem with min command
Date: Mon, 02 Jul 2012 21:41:58 +0400

> 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. 

The card built-in function returns the cardinality of a set (that is,
the number of elements the set consists of).

> 
> Where can I find a documentation or list of commands?
> 

Please see the language reference included in the glpk distribution
(doc/gmpl.pdf).


> 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);
> 

Hmm... Try the following:

param index1 := if card(SCHEDULES) = 0 then 1 else 
(min{k in (SCHEDULES union { 0 }): index[k] != 0} k);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]