4 ms·
You probably aren't going to like this, but have you considered having the user select some roads and intersections in advance, and then only keep track of thos
by nsajko 6y ago
You probably aren't going to like this, but have you considered having the user select some roads and intersections in advance, and then only keep track of those roads? That should make the problem with storage manageable. Don't know if there's a better way.
Another thought: I see you're basically using histograms for visualization, you should try switching to displaying estimates of probability density functions. The estimation is done with "kernel density estimation" (KDE), and it's basically a much improved histogram. You will probably want to enable the user to select the KDE bandwidth (which is one positive real number), AFAIK different bandwidths may show patterns that exist on different time scales. In addition to the KDE, you may also want to display the estimate of the cumulative distribution function: the empirical distribution function (eCDF).
The eCDF is a really simple concept, KDE also isn't too bad. See here for KDE and eCDF intuition: https://mathisonian.github.io/kde/ https://mathisonian.github.io/kde/ (the former requires a desktop computer for viewing) https://en.wikipedia.org/wiki/Empirical_distribution_function https://en.wikipedia.org/wiki/Empirical_distribution_functio...
Implementing KDE isn't straightforward, several completely different approaches to it exist, but worst case you should be able to find a library for that.
Also, I should probably point you towards Vega and Vega Lite, it seems like they may be of use: https://vega.github.io/vega-lite/ https://vega.github.io/vega-lite/
Vega (and Vega Lite) are for interactive data visualization in the browser, I don't know if that suits your game, but they can give you the estimates that describe probability distributions from samples that I wrote about above.