[Home]RecursivePatternMatching

Robo Home | Changes | Preferences | AllPages

Showing revision 5
Okay this is my idea for a recursive PatternMatcher

--Pakistan

Not really a new idea. MultipleChoice-SingleTickPatternMatching is basicaly what you describe. The only difference is you suggest is branching every x turns instead of every singe turn. I implemented MC-ST-PM last year and found that despite my reasonably optimized design it's far too slow and started skipping every turn before the first round even finished. Branching Every x ticks may improve the situation but I still believe it would be too slow to run unless x is so high that it's barely different than plain MC-PM. -- Rednaxela

I'm sure that it still skip a turn if your bullet need to go for 82 ticks :) --Nat

Actually I am referring to using a recursive method instead of a iterative method. It is still running all the same, except that recursion is usually faster than iteration. Pakistan wrote it badly, but he was saying you find the first match of your pattern, save the location in a new array, and then rerun the method with the new values searching for the next pattern in the series. however symbolic pattern matching and normal pattern matching are more efficient, because they match the whole sequence, instead of each individual digit of your log.

--annonymous

I think you have the other around, if the algorithm is logically the same, the iterative version is faster than the recursive one. Because if after unrolling the recursion, the underlying algorithm is the same you cannot gain speed by adding the overhead required to handle the calls. --Zyx


Robo Home | Changes | Preferences | AllPages
Edit revision 5 of this page | View other revisions | View current revision
Edited March 23, 2009 17:54 EST by Zyx (diff)
Search: