Problem with Iterating different parameters by using only 1 iterator

I am designing an automated simulation definition with 2 parameters (building type and site coverage) (please ignore B).

I am trying to do is to run all the combinations with 1 iterator (or by 1 run initiation). The reason is that it is linked to an optimization plugin, and hence I cannot break into multiple steps.

I have 2 parameters, the first one is building type (square or rectangle), the second one is the site coverage. The tricky thing is that different type of building has different range of site coverage to be simulated, while the range is 30% to 70% for square building, the range is 20% to 60% for rectangular building. Therefore, I am trying to find a way to cover all the combinations (square, from 30% to 70%) and (rectangular, 20% to 60%).

image

Thanks. Test (automation).gh (7.1 KB)

Hi @Ivanita,

Judging from your description, I’m not sure if you need iteration at all.
One thing is sure though! In the linear logic of GH, you can’t connect components that are dependent on previously generated data back to components that produced the data in the first place.
Think of this much like the grandfather paradox in time travel, where you wouldn’t be able to travel back and for instance kill your grandfather, since this would mean that you wouldn’t be born in the future, and wouldn’t have travelled back in the first place - a paradox!

One possible solution could be to see your data sets A0, A1, and B as branches in a data tree. Your type list provides indices, in the order that you want to select individual branches/data sets from the tree:

Another possibility could be to use a GH plugin that allows iterative looping (e.g. Hoopsnake, Anemone, etc.).

It’s kinda hard to discern what you exactly want to do though.

1 Like

@diff-arch Thanks very much for your reply, now I understand how come my previous approach didn’t work.

Sorry for not making my problem clear. I am trying to do the simulations for optimization and hence I need to use 1 iterator to run all the combinations. However, not all the parameters of Type 0 and 1 have the same range, and this is the thing that troubles me, i.e. how to run all the combinations by 1 iterator. Thanks again.

Could you describe with an example what you’re trying to accomplish?

I don’t understand what you are doing, but have a look at the Colibri_Advanced.gh file in the sample files folder in the tttoolbox1-9 download. What they do with domains might be adaptable to your need.

Regards
Jeremy

1 Like

Or given that the iterator is supposed to feed the aggregator, whose purpose is to output a CSV file, why not do a run for each Type and combine the CSV files manually?

Thanks @jeremy5. I am trying to solve an optimization problem (the iterator is connected to the optimization plugin) and hence I cannot break it into 2 steps.

My objective is to run all the combinations with 1 iterator (or by 1 run initiation). The reason is that it is linked to an optimization plugin, and hence I cannot break into multiple steps.

I have 2 parameters (please ignore B), the first one is building type (square or rectangle, 0 and 1), the second one is the site coverage. The tricky thing is that different type of building has different range of site coverage to be simulated, while the range is 30% to 70% for square building, the range is 20% to 60% for rectangular building. Therefore, I am trying to find a way to cover all the combinations (square, from 30% to 70%) and (rectangular, 20% to 60%).

Thanks