How Scoring Works
From Talk:RoboJogger
Jump to navigation
Jump to search
Revision as of 25 December 2012 at 00:21.
This is the thread's initial revision.
This is the thread's initial revision.
Okay folks. Help me out here. I didn't see any page on the wiki that details how all the challenge scoring types work. I'm basically just guessing on everything but normal scoring and bullet damage scoring. What I'm currently doing is best shown by just posting the class that currently handles scoring, and you all can let me know what needs to be changed. Thanks!
//TODO: Verify how each scoring function is supposed to work public class ScoreFunctions { public static ScoreFunction PERCENT_SCORE = new ScoreFunction() { @Override public double getScore(RobotScore challenger, RobotScore opponent, int numRounds) { return challenger.score / (challenger.score + opponent.score); } }; public static ScoreFunction SURVIVAL_FIRSTS = new ScoreFunction() { @Override public double getScore(RobotScore challenger, RobotScore opponent, int numRounds) { return challenger.survivalRounds / (double)numRounds; } }; public static ScoreFunction SURVIVAL_SCORE = new ScoreFunction() { @Override public double getScore(RobotScore challenger, RobotScore opponent, int numRounds) { return challenger.survivalScore / (challenger.survivalScore + opponent.survivalScore); } }; public static ScoreFunction BULLET_DAMAGE = new ScoreFunction() { @Override public double getScore(RobotScore challenger, RobotScore opponent, int numRounds) { return challenger.bulletDamage / (double)numRounds; } }; public static ScoreFunction MOVEMENT_CHALLENGE = new ScoreFunction() { @Override public double getScore(RobotScore challenger, RobotScore opponent, int numRounds) { return challenger.energyConserved / (double)numRounds; } }; }