[AMPL 2141] Looping

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 2141] Looping

Marc-139

Hello,

my MLCLSP works well. Now, I need to implement my algorithmus. My
question is, how i can create a repeat until loop with two conditions
which is working after this principle

Zub
repeat
{
   ..here it creates new Z values.... if Z<Zub let Znew := Z
...                                                  .....
..                                                   .....
..                                                  .......
...
} until l=max (number of iterations, for example 5) or Znew >= Zub
(values of Z,which are generated in the loop)

is an "or" allowed ? I tried many combinations of if then, for loops
etc., nothing brings out the desired solution.


best regards
Marces

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[AMPL 2146] Re: Looping

Robert Fourer-2


There is nothing wrong with using "or" in an "until" expression.  Probably
there is some other error in your loop, which is however not evident from
the example that you have given.

Bob Fourer
[hidden email]


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of
> Marc
> Sent: Tuesday, December 30, 2008 4:01 AM
> To: AMPL Modeling Language
> Subject: [AMPL 2141] Looping
>
> Hello,
>
> my MLCLSP works well. Now, I need to implement my algorithmus. My
> question is, how i can create a repeat until loop with two conditions
> which is working after this principle
>
> Zub
> repeat
> {
>    ..here it creates new Z values.... if Z<Zub let Znew := Z
> ...                                                  .....
> ..                                                   .....
> ..                                                  .......
> ...
> } until l=max (number of iterations, for example 5) or Znew >= Zub
> (values of Z,which are generated in the loop)
>
> is an "or" allowed ? I tried many combinations of if then, for loops
> etc., nothing brings out the desired solution.
>
> best regards
> Marces
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---