"for {r in LB}" sets r to some member of the set LB and executes the statements in the loop; then it sets r to another member of the set LB and executes the statements in the loop; and so forth for as many times as there are members in LB. Each time through the loop, "let lambda := r" sets assigns the current value of r to lambda (which is maybe defined earlier by an AMPL statement like "param lambda integer > 0;").
I would agree however that the purpose of this code is hard to understand. Why make the assignment
let LB := lambda .. lambda + 10 by 1;
before the loop and then write
let lambda := r;
inside the loop? To figure this out you would need to study the entire example, or else ask the person who wrote it.
Bob Fourer
am...@googlegroups.com
=======