The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Iteration macro inside Loop collection"
Hello
Maybe someone knows how to solve my problem: I have a collection of n ExampleSets and a collection of n Models. I want to apply n-th model to corresponding n-th ExampleSet, so I have to loop through two collections in parallel.
After trying a lot of things, I found out that the most logical way would be storing one collection with "Remember" operator, and then loop through the other one, "Recalling" the first one and selecting the n-th item on each loop.
The problem is how to select the n-th item inside the collection loop.
Most loops have the "iteration macro" parameter, which is exactly what I am looking for - however the "Loop collection" operator lacks this parameter.
I also cannot find a way to loop through a collection of items using different operator than "Loop collection". "Loop until" seems reasonable, but how to specify "input collection is empty" condition?
Is there any way to do that?
Monika
Maybe someone knows how to solve my problem: I have a collection of n ExampleSets and a collection of n Models. I want to apply n-th model to corresponding n-th ExampleSet, so I have to loop through two collections in parallel.
After trying a lot of things, I found out that the most logical way would be storing one collection with "Remember" operator, and then loop through the other one, "Recalling" the first one and selecting the n-th item on each loop.
The problem is how to select the n-th item inside the collection loop.
Most loops have the "iteration macro" parameter, which is exactly what I am looking for - however the "Loop collection" operator lacks this parameter.
I also cannot find a way to loop through a collection of items using different operator than "Loop collection". "Loop until" seems reasonable, but how to specify "input collection is empty" condition?
Is there any way to do that?
Monika
Tagged:
0
Answers
I can set a macro before the loop and then re-generate it inside each loop using "Generate macro" operator and putting %{macro_name}+1 as the macro value.
Anyway I find it strange if there was no more straightforward way..