help-glpk
[Top][All Lists]
Advanced

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

Re: Adding if/then/else statement to GMPL


From: Andrew Makhorin
Subject: Re: Adding if/then/else statement to GMPL
Date: Sat, 29 Aug 2020 18:01:06 +0300

On Sat, 2020-08-29 at 15:29 +0200, Domingo Alvarez Duarte wrote:
> Hello !
> 
> With this commit I'm close for a proof of concept of GMPL with multi 
> problem, multi solve, repeat and let statements.
> 
> The let needs work for the dependence hell when update a parameter.
> 
> The multi solve statements is implemented as calling a user provided 
> callaback (see in examples/glpsol.c for a crude example).
> 
> https://github.com/mingodad/GLPK/commit/65655c05fc8e315b3e43b98a1f2324
> 66614a0b46
> 
> It compiles and run examples/cut2.mod on an infinite loop due to 
> problems with propagation of updates with 'let' statement.
> 
> Ideally it should be compatible with existing models (not yet fully 
> implemented/checked).
> 
> Any comment/suggestion/help is welcome !

What about this:

   ...
   var z;
   ...
   if (z >= 0)
      s.t. foo: sum{j in J} x[j] >= 0;
   else
      s.t. bar: sum{j in J} x[j] <= 1;
   ...
   solve;
   ...

;)

> 
> Cheers !
> 
> 



reply via email to

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