[Top][All Lists]

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

Re: [Help-glpk] GNU MathProg Question

From: Suleyman Demirel
Subject: Re: [Help-glpk] GNU MathProg Question
Date: Fri, 15 Oct 2010 14:21:25 -0400

Thank you very much Andrew. I see the logic.

In some other circumstances, however, it is so convenient to keep changing the value of a parameter (or variable). My understanding is that this is not possible with MathProg. If I am wrong, I would appreciate your response. If I am not wrong, just ignore this message.


On Fri, Oct 15, 2010 at 2:19 PM, Andrew Makhorin <address@hidden> wrote:

> I am new to MathProg, and a former user of Ampl. I have been trying to
> create an auxiliary variable that has nothing to do the model, but to
> use for reporting output. For example, I am roughly trying to do the
> following:
> define variable named counter
> counter=0
> for (i in Relevant Set)
>    if (i > 100) counter = counter+1
> This way, I want to report how many of the variables exceed 100.
> In Ampl, I was able to define a variable as usual ( var counter,
> integer;) and update its value via let command (let counter:=counter
> +1).
> I will appreciate if you could help me on this.

param counter := sum{i in Relevant Set: i > 100} 1;

Suleyman Demirel - Office: (734) 647-3167

PhD Candidate in Operations Management
Stephen M. Ross School of Business
University of Michigan, Ann Arbor

reply via email to

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