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: Heinrich Schuchardt
Subject: Re: Adding if/then/else statement to GMPL
Date: Mon, 24 Aug 2020 16:59:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

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



reply via email to

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