Data Recorder component - why am I getting multiple copies of the data?

I’m hoping that someone here will be able to shed light on why I’m getting multiple copies of the same data when I use the data recorder component. Apologies in advance, as I think I’ll be missing something obvious…I’m no programmer.

My definition creates aggregations of an icosahedron module, using components from the Wasp plugin - which aggregates your modules face-to-face, according to your chosen rules. Ideally I want to automate a run through all possible rules, set against a second fixed rule - and to collect information for analysis. The blue group is a timer switch which replaces the reset button and the number slider in red to carry out this automation.

The definition attached focuses on just one of the pieces of information I want to collect: the number of connections between the modules in the aggregation. This should return 200 pieces of data for every rule. However, instead it returns 600 on the first press of the reset button and 400 on each subsequent press. (I’ve tried using a boolean toggle as well as the button and my timer modulus switch - all give the same result).

With data recorders which are just collecting one piece of information for each rule, I’ve been using the dispatch component after the data recorder panel, to weed out the second set of results. (And my alternative timer activated switch, highlighted in blue, starts at -1 to get rid of the third set of values for the first iteration). However, for this particular data collection, the number of items collected is much larger - and, more importantly, isn’t fixed (while it will often be 200, it may be lower). This means I can’t used dispatch to ‘avoid’ the underlying problem any more!

Any input on what it is I’m missing would be gratefully received!

data recorder question.gh (43.3 KB)

I haven’t read more, just in case to clarify that this component record the input each time it is solved. A component is solved when some previous connected component is solved, so you must have some component being recomputed and each time the recorder will do its job. It doesn’t work out when the input data changes or anything like that.

Thanks, Dani! Yes, I guessed that was the problem - but I don’t understand where that recomputation could be happening in this definition. I guess it must be within the components, and therefore something I can’t solve easily?

Hi Georgia,

the problem has to do with how the data is handled internally in Wasp. Wasp components use a persistent data structure, in order to avoid recomputing already placed parts every time new parts are added. So, what is happening in your case is that, when you press the reset button, the Data Recorder receives 200 elements when the button is set to True, and another 200 (the exact same ones) when the button is released and goes back to False.
If you need to save the different graphs of the aggregation, it would make sense to use the Save Graph to File component, and use the timed counter to name the files.

Thanks for taking the time to explain, Andrea! I’d assumed I was missing something obvious with my grasshopper wiring - and hadn’t considered that the way data is handled within a component might impact. That makes a lot of sense. I’d not spotted your new Save Graph component - and that could well be a better way to harvest the data I need. Excellent!