Wednesday, September 19, 2007

Imogen

FROM http://oizys.livejournal.com/224033.html

This will probably only hold feigned interest from the Computer Scientists who might read this (including my future self) but I've completed/debugged my new BidirectionalTimeline class, which allows for an impressive number of sequences within a single dimension to be sorted and evaluated in minimal time. The objective is... you have a time position, and you want to know what sequences you've completely passed, which you've not reached yet and which you are on (and where you are along them). Now you want to know this whether you're going forward or backward through time. Now add on that if you skip any arbitrary amount of time that you know exactly how many you've passed over, in which direction and where things lie now.

All in the least amount of time possible.

Now there's probably a better solution than my simplistic one, but I believe there's an inherent value that simplicity adds that is probably worth whatever small speedup there is left to ponder.

The first basic test... 50 sequences and showing you how they are sorted

The real test... 5000 sequences - the lists aren't populated because the Flex list display alone drops the framerate to around 1/50th

The solution? Two Heaps (one sorted by highest end time, one by lowest start time) and a Linked List or Resizeable Array. If you have another idea, I'd love to hear about it.

Oh also, I just watched The Prestige. Crazy awesome film but kinda creepy to think about.

No comments: