help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Ignoring useless data instead of returning error


From: Andrew Makhorin
Subject: Re: [Help-glpk] Ignoring useless data instead of returning error
Date: Fri, 15 May 2009 01:17:23 +0300

> I have a parameter and then I declare a set of all existing values of
> this parameter:

> param cl{i in ITEM} symbolic;
> set CLASS:= setof{i in ITEM}cl[i];

> Later I declare a parameter

> param t {i in CLASS};

> and formulate a constraint on the CLASS set. My problem is that in repeating
> runs of the model I need to try different changes in the 'cl' parameter and
> sometimes I introduce a new value, sometimes an existing one is not used
> anymore. This causes changes in the set CLASS and these have to be followed
> in inputing values of the t parameter. Adding new values is not a problem,
> but it is quite painful to ensure each time that I do not input a value of t
> for a class, which does not exist anymore. I would like to know some trick
> how to make the model just ignore such irrelevant figure instead of
> returning the "out of domain" error.
> Is there a way

You may declare t as follows:

param t {i in CLASS}, default -1;

in which case a missing value for t[i] is defaulted to -1.





reply via email to

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