- Prefers to be called
- Uses pronoun
- Perth Australia
- 6 years 2 months ago
- Last seen
- 3 weeks 16 hours ago
Thanks for taking the time to respond, Magneson. It was your earlier suggestion to use the more appropriate
Build List node that got me arriving a a solution. I'd forgotten that
Build List was one of the main three looping nodes (and when I typed
cycle through list and
Process List are the first two, but
build is down at no 12 and I missed it repeatedly).
Having said that the strangeness of outputs I was getting from a combination of Cycle Through list and Process List was pretty weird using a console window to look inside the loop in the hope of debugging my concept. Just got very confusing not knowing what was happening with events inside the loop which are not shown with "Show Events" Maybe we need a "Show Events inside Loops" preference or button which blinks them in a different colour?
My issues were to do with operating data that updates, so loops that operate on last state of the list, that's a bit more complex than building a list from scratch, especially if you are referencing more of the data than at the current index, hence the need to use the count number and add one to it to get some of my values, including wrapping the values that exceed list length.
When I get a chance I'll finish the composition and post it, was just an exercise I hoped I could do easily in Vuo.
Thanks for the tips on searching the Library using initials too.
I get the push vs pull dynamics, and the advantages that offers for computational optimisation. It does present some tricky issue though especially if you have some data updating every frame and other data updating, say, once every second. We need to make sure extra events don't sneak into the Build List loop and upset the order of items returning to the
Build List node which will corrupt the build and make for very confusing outputs.
I'm still not confident with getting that right from the start with lots of debugging and demo coding.
Live and learn :-)
Thanks Jaymie your first solution is elegant.
The purpose of this exercise wasn't so much to find the optimal way to do this item shuffling task, but for me to generalise solutions for referencing any item in a list at any given time in a loop, or in secondary list, while looping through a list of point data.
I actually have two lists to solve for. The reason for dividing my data into two lists was to do with the composition I'm making explained in the third post, the data is position, speed and acceleration values for a group of cars going around a circulate track. Cars are to autonomously adjust their acceleration based on a set of rules. Position and velocity need to be calculated per frame, but acculturation doesn't and adds some realism too I thought to do twice a second (avoids me working out how to put a time stamp and test that before I change acceleration too). I guess I'm not really saving much CPU energy, but seemed smart to seperate the calculation for acceleration.
Here's my build list solution, it's pretty simple in the end, but had to learn about extra events sneaking into Build and Process loops and how to keep them under control with extra Hold Value/List nodes.
Didn't realise Build List outputs a number as well as an event for each item counted in input list. So this version removes my Count node for simplification. Still struggling to work with multiple lists which influence each other (two way).
Or if right clicking was context aware, if cursor is over a
List type port Vuo chooses the Share List node and wires it (inline with other nodes if necessary and an output port).