How Scoring Works

Jump to navigation Jump to search

How Scoring Works

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; 
		}
	};
}
Skotty01:21, 25 December 2012

You do not have permission to edit this page, for the following reasons:

  • The action you have requested is limited to users in the group: Users.
  • You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.

You can view and copy the source of this page.

Return to Thread:Talk:RoboJogger/How Scoring Works/reply.