[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Indexing a subset from 1..n
From: |
Michael Hennebry |
Subject: |
Re: [Help-glpk] Indexing a subset from 1..n |
Date: |
Tue, 27 Nov 2012 15:31:59 -0600 (CST) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
On Wed, 28 Nov 2012, joel mortyn wrote:
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.
Define an array that tells you the n-th open period.
--
Michael address@hidden
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily