Start of a queue implementation


#1

I’ve added a queue-buffer node to gweimer/utils. By daisy-chaining these together, one can create a fixed-length queue of arbitrary depth with push/pop functionality.

Once could easily create a variadic wrapper that implements just PUSH. If anyone can figure out how to implement both PUSH & POP in a variadic wrapper, I’d love to hear how it can be done…I haven’t been able to work out how to get old values back up through the cascade.


#2

It is pretty ugly, but I’ve added a running-avg node to gweimer/utils that uses queue-buffer to calculate a running average. The selection of variadic level determines depth of queue, but it is an unused dummy pin. There are several unlabeled pins that should not be connected to anything and it would be nice to get rid of, but they are needed for internal use to pass data to the next level of the variadic cascade.

If anyone has a cleaner way to implement this, I’d love to hear it. The one design decision I made was to calculate the total based on AVG & arity-level instead of adding another set of pins to pass the total. This could have a negative affect on performance and accuracy. It would be nice to avoid calculating AVG until the last level of cascade, but I don’t think there is currently a way to determine when you are at the last level.