[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Calculate model parameter in a for loop in GMPL
From: |
OYO1 |
Subject: |
[Help-glpk] Calculate model parameter in a for loop in GMPL |
Date: |
Sat, 04 Jun 2011 15:55:21 -0400 |
User-agent: |
SquirrelMail/1.4.19 |
Hi All,
How can I calculate a model parameter in a for loop in GMPL? I tried the
code below but id did not work.
set T := 1..10;
set D := 1..20;
param s{T} := 0;
param g{D} := trunc(Uniform(1, 11));
# compute the size
forall{d in D}: s[g[d]] = s[g[d]]+1;
After the for loop the value of the s[] parameter is still zero for all
indices.
Osman Y. Ozaltin
PhD Candidate
1048 Benedum Hall
Department of Industrial Engineering
University of Pittsburgh
Pittsburgh PA 15261
URL. www.pitt.edu/~oyo1
E-mail. address@hidden
Phone. 724-234-8490
- [Help-glpk] Calculate model parameter in a for loop in GMPL,
OYO1 <=