help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] [Fwd: One Dimensional Set Ordering]


From: Meketon, Marc
Subject: Re: [Help-glpk] [Fwd: One Dimensional Set Ordering]
Date: Mon, 2 May 2016 07:24:22 -0500

Use an indexed parameter:

In your model section declare:

set IdxWeeks;
param weeks[IdxWeeks];

and in your data section have:

param : IdxWeeks : weeks :=
 1  1
 2  4
 3  8
 4  11
;


-----Original Message-----
From: Help-glpk [mailto:address@hidden On Behalf Of Andrew Makhorin
Sent: Sunday, May 01, 2016 12:19 PM
To: address@hidden
Subject: [Help-glpk] [Fwd: One Dimensional Set Ordering]

-------- Forwarded Message --------
From: Curtis Passorelli <address@hidden>
To: address@hidden
Subject: One Dimensional Set Ordering
Date: Sun, 1 May 2016 11:36:39 -0400

Hello,


I have a discrete set.


set weeks:={1,4,8,11};


What I want to do is create a parameter to access the i-th element of the set.
weeks[1] = 1, weeks[2] = 4, weeks[3] = 8 and weeks[4] = 11.


I want to do this assignment dynamically because these week numbers will change 
each time new data is entered into the model.


Do you have any suggestions or code?



_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk


This e-mail and any attachments may be confidential or legally privileged. If 
you received this message in error or are not the intended recipient, you 
should destroy the e-mail message and any attachments or copies, and you are 
prohibited from retaining, distributing, disclosing or using any information 
contained herein.  Please inform us of the erroneous delivery by return e-mail. 
Thank you for your cooperation.



reply via email to

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