over 6 years ago by Amro
Hello, though this video (and the previous one) were full of information, it was really hard to follow how Anemone loops were used, perhaps the example was a little complex to start with for just explaining how Anemone loops work and how to setup it up. I still don't know the general form of what goes in to D0 of the Loop Start and what comes out of D0, and then what goes back into D0 of Loop end? In other words, what is the anatomy or basic workflow of the Loop process using Anemone components? To process a recursive/repetative task, what goes before the Loop Start, what goes in the middle between Loop start and Loop end, and what comes out of Loop start?
Arie Willem de Jongh over 6 years ago
That is more or less correct, yes. That connection between the start and end component is to transfer the info from the end back to the start component.
The N stands for how many loops, correct. After that it will exit and output the final result at the output D0.
The C is indeed a counter, and it displays in what loop you're currently in.
The E input from the loop end, is to prematurely exit the loop. This is a boolean value that has to be inputted. To use my example, let's say I want to exit the loop when 7 is reached. Below is an image that will demonstrate how this would look like.
Best,
Arie
Arie Willem de Jongh over 6 years ago
Hi Amro,
I tried to explain it in the image attached below. The very first time you run the loop, Anemone uses the input D0 from the loop start. After that D0 will be whatever value you input in the Loop End D0. This will be the value in the next iteration for the output of the D0 for the loop start.
Check the image below it's just adding 1 to a number every iteration. In Python code it would look something like this:
D0 = 2 #initial value of D0
N = 5 #how many loops you want
for i in range(0,N): #this is the actual loop, so this part is between the loop start and loop end components
D0 = D0 + 1
Let me know if it is more clear, I'm happy to explain it more if needed.
Cheers!
Arie
Amro over 6 years ago
Thanks alot Arie. It is somewhat clearer with the example and image.
I think the dashed black line between the '<' and '>' does the same job as the Red dotted lines. Correct?
It will keep looping 'N' number of times and will automatically exit when done.
So I'm assuming it's keeping an internal counter. Isn't that the C output in the Loop Start component?
Also what use is the E input in the Loop End component? Are the 'C' and 'E' parameters used at all or are they just to keep internal info within the loop components?
Cheers!
Amro