next up previous
Next: Strategies Up: The Cookie Cutter Problem Previous: The Cookie Cutter Problem

Methodology

Unlike Rectangles  players, players in the Cookies problem never directly compete with one another; the actions of one player never directly affect those of its opponents. Additionally, each player only makes a single ``move" per game when it returns the final positions and orientations of the cookies it is given.

With this in mind, we suspected that it would be possible to employ the Strategy design pattern in our implementation. We could ``define a family of algorithms, encapsulate each one, and make them interchangeable" ([1], p.315), then retain only the best performing solution. This approach is particularly strong for cookie sets that contain many different types  of cookies (e.g. random, puzzle, long-thin, concave, etc.). Strategies that fare well for one type of cookie may perform abysmally for another. Fortunately, since only the best performing solution is retained, our hybrid approach can be robust for virtually any type of cookie.



2003-10-14