Re: Adding if/then/else statement to GMPL
Heinrich Schuchardt <[email protected]> Mon, 24 Aug 2020 16:59:45 +0200
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <[email protected]> |
On 24.08.20 16:33, Domingo Alvarez Duarte wrote: > Hello Meketon ! > > Could you share your view of how it would be expressed (an ideal model > sample) ? > > If you want to talk about it, maybe I'll be interested in implement it ! > > Can you share a collection of models data to be used as base for the > test/implementation ? Dear Domingo, I do not yet understand what was you weren't able to express with the current syntax. Instead of if length(p) == 3 then display "true 3"; else display "false 3"; if length(p) == 5 then display "true 5"; else display "false 5"; you can write: param p,symbolic := "dad"; display if length(p) == 3 then "true 3" else "false 3"; display if length(p) == 5 then "true 5" else "false 5"; solve; end; Best regards Heinrich