help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Subscipted Param In Max() Function


From: Andrew Makhorin
Subject: Re: [Help-glpk] Subscipted Param In Max() Function
Date: Fri, 29 Oct 2010 20:13:50 +0400

On Fri, 2010-10-29 at 08:21 -0700, Mackie Conscious wrote:
> Is it possible to use a subscripted parameter in the max() function?
> 
> param topSpeed := max(1,2,5,8);
> 
> ...works fine. However, I am struggling to find a way to use this with
> subscripted data. The following does not work, for example:
> 
> param speeds {x in 1..4};
> param topSpeed := max({x in 1..4}speeds[x]);
> ...
> data;
> param speeds := [1] 1 [2] 2 [3] 5 [4] 8;
> 
> I want to use the maximum and minimum speeds in my model. Can anyone think
> of a way I can get those, please?

param speeds {x in 1..4};
param topSpeed := max{x in 1..4} speeds[x];
...
data;
param speeds := [1] 1 [2] 2 [3] 5 [4] 8;





reply via email to

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