help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Indexing a subset from 1..n


From: joel mortyn
Subject: [Help-glpk] Indexing a subset from 1..n
Date: Wed, 28 Nov 2012 08:15:46 +1100

Hello all,

I have a set of Periods from which I create the subset OpenPeriods when the facility is open.

param nPeriods;
set Periods, default{1.. nPeriods};
param FacilityOpen{p in Periods}, binary;
set OpenPeriods:= setof{p in Periods: FacilityOpen[p] = 1}  (p);

The facility is not open during all periods and I have a constraint that considers the configuration of the facility the previous time it was open. So I am trying to index the set of OpenPeriods from 1...card(OpenPeriods) rather than with p but so far without any luck.

Any help would be much appreciated.

Thanks,

Joel








reply via email to

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