I’m using an eye tracker to try and calculate an average for pupil dilation which is a proxy for the workload.
Pupil dilation in this case comes in as a float and I’ve created an array for each of those dilation values per tick.
In essence, I’m hoping to get a workload average over time so I can set that as a baseline on the fly but I can’t seem to get the array of floats to average correctly as they always increase and never level out. Probably something wrong with how I’m thinking about the math here but, I could use the help.
Here are the blueprints I’m using so far for the project.
Can you show the whole thing, it’s hard to tell from these snipped pictures.
I’m suspecting your problem is using tick to append to the array, because that’s going to happen every frame regardless of whether you have new variables to add.
Ah! excellent point, I do not want to do that. I’ve now added a boolean where if dilation is > 0 then it adds to the array.
I couldn’t seem to get the add the same way you had it and did add unique instead. Maybe that is due to my version being on UE4.23 but it seems to have the same pins and hopefully works the same way.
I’m not sure the issue here but it might be the lack of division working how we want or maybe the length isn’t getting calculated correctly?? Regardless, this is what I get with the current setup:
I actually just released a plugin that implements this feature! It’s called Fortuna Extended Function Library and contains functions for adding arrays, converting arrays, and getting the average from arrays (Plus a lot more)