[Cs5500] Sample Solution project 2

Karl Lieberherr lieber at ccs.neu.edu
Sun Oct 2 08:11:24 EDT 2011


Hi Karan:

teamNavi came up with a good solution that, after a little refactoring,
belongs into our code base. Other teams had close to correct
solutions. Please carry out this refactoring
and present it in class as a good sample solution.
Also add it to our code base.

Test your at AtLeastAsGoodAsYou protocol in a MMG-playground
using AtLeastAsGoodAsYou instead of ForAllExists.
Use all perfect teacher avatars. Do you get a perfect tie
in a full round-robin tournament? Each avatar should make
exactly the same number of points  because they are all perfect
and therefore each should be as good as the other.

This systems to be a good integration test that covers your new protocol
as well as the entire system.
Any better testing ideas for your protocol?

-- Karl


Survivor and AtLeastAsGoodAsYou protocol

AtLeastAsGoodAsYou
if(i.quality(bobSolution) >= (i.quality(aliceSolution)))
Survivor
if(i.quality(bobSolution) > (i.quality(aliceSolution)))
should be abstracted out from getResult
Rest of getResult should be put into super class.

abstract method: compareSolution(bobSolution,aliceSolution)
overriden in
AtLeastAsGoodAsYou
with
if(i.quality(bobSolution) >= (i.quality(aliceSolution)))

and in
Survivor
with
if(i.quality(bobSolution) > (i.quality(aliceSolution)))

I don't like the classname DryClass for the abstract class.
Suggested better names: SurvivorStyleProtocol, RelativeProtocol.

===============
when you copy code, you should also update the comments.



More information about the Cs5500 mailing list