[Home]Daniel

Robo Home | Changes | Preferences | AllPages

Difference (from prior major revision) (no other diffs)

Changed: 156c156,157
*** Voidious is correct. Note that setTurnRight(90); setAhead(100); (without the execute) is also functionally equivalent if that's all you have in your bot. -- Simonton
*** Voidious is correct. Note that setTurnRight(90); setAhead(100); (without the execute) is also functionally equivalent if that's all you have in your bot. -- Simonton
****Ah, ok. So the second one sends instructions to robocode and finishes, and the first one keeps the run() method alive until it's finished moving. execute() blocks until the next tick, right? Thanks guys! --Daniel

&Beginner to Robocode and recent destroyer of his archnemesis sample.Walls with 99.25% average wins. You're next, sample.SpinBot.


Mr. Daniel, sir, welcome to the wiki. Tell us a little about yourself! -- Simonton

Welcome to the wiki! Have a good time here. -- Stelokim

Welcome! Feel free to post any questions you have, I think we're usually a fairly helpful bunch. =) -- Voidious

Destroying the sample bots are the best way to start out. --Chase-san

Yes, welcome Daniel! Hehe.. destroying the sample robots can be harder than you think.. especially in a melee battle against all sample robots at the same time! ;-) --Fnl

I guess I'm writing a comment to myself right now but I couldn't think of a better place to put an open question (is there a page for this? I couldn't find a sort of [Village pump] page but if I just missed it let me know). Anyways, adding up results in robocode seems to leave me out by 1. As in, (Total score - sumOf(everything else except 1st, 2nd, 3rd) == -1) is always true. Can anyone explain this to me? --Daniel

Here's a datafile (2 battles of 10 round with sample bots):
Aug 13, 2007 12:09:09 PM
Results for 10 rounds
Rank,Robot Name,Total Score,Survival,Surv Bonus,Bullet Dmg,Bullet Bonus,Ram Dmg * 2,Ram Bonus, 1sts , 2nds , 3rds 
1st,sample.Walls,8721,4850,840,2668,342,20,0,7,0,0
2nd,sample.SpinBot,7675,4400,240,2785,191,59,0,2,4,1
3rd,sample.Tracker,5947,4050,0,1687,172,32,5,0,0,5
4th,sample.TrackFire,5501,2950,0,2298,253,0,0,0,3,0
5th,sample.MyFirstJuniorRobot,4642,3350,120,1056,80,36,0,1,0,1
6th,sample.Crazy,4377,3450,0,794,16,116,0,0,1,2
7th,sample.Fire,4313,2900,0,1315,94,4,0,0,2,0
8th,sample.MyFirstRobot,3612,2850,0,699,28,35,0,0,0,0
9th,sample.Corners,3299,2300,0,972,24,2,0,0,0,1
10th,sample.RamFire,2983,1250,0,1168,34,448,83,0,0,0
11th,sample.Target,2411,2400,0,0,0,11,0,0,0,0
12th,sample.SittingDuck,2100,2100,0,0,0,0,0,0,0,0
13th,sample.Interactive,2050,2050,0,0,0,0,0,0,0,0
$
Aug 13, 2007 12:20:06 PM
Results for 10 rounds
Rank,Robot Name,Total Score,Survival,Surv Bonus,Bullet Dmg,Bullet Bonus,Ram Dmg * 2,Ram Bonus, 1sts , 2nds , 3rds 
1st,sample.Walls,9637,5550,960,2732,340,40,16,8,0,0
2nd,sample.SpinBot,8905,4900,240,3399,312,54,0,2,4,1
3rd,sample.Tracker,7137,4150,0,2548,315,124,0,0,1,3
4th,sample.Fire,4993,3800,0,1129,59,4,0,0,1,1
5th,sample.Corners,4827,3500,0,1240,87,0,0,0,1,1
6th,sample.Crazy,3930,3200,0,646,1,83,0,0,1,2
7th,sample.MyFirstJuniorRobot,3734,2800,0,857,39,38,0,0,1,0
8th,sample.MyFirstRobot,3648,3050,0,575,10,12,0,0,1,2
9th,sample.RamFire,3358,1650,0,1196,12,428,71,0,0,0
10th,sample.TrackFire,2896,1600,0,1234,62,0,0,0,0,0
11th,sample.SittingDuck,1850,1850,0,0,0,0,0,0,0,0
12th,sample.Target,1710,1700,0,0,0,10,0,0,0,0
13th,sample.Interactive,1250,1250,0,0,0,0,0,0,0,0
$

And here's my analysis of the total score minus the sum of the rest (excluding number of 1st, 2nd, and 3rd places):

1st->sample.Walls (8721): -1
2nd->sample.SpinBot (7675): 0
3rd->sample.Tracker (5947): -1
4th->sample.TrackFire (5501): 0
5th->sample.MyFirstJuniorRobot (4642): 0
6th->sample.Crazy (4377): -1
7th->sample.Fire (4313): 0
8th->sample.MyFirstRobot (3612): 0
9th->sample.Corners (3299): -1
10th->sample.RamFire (2983): 0
11th->sample.Target (2411): 0
12th->sample.SittingDuck (2100): 0
13th->sample.Interactive (2050): 0
1st->sample.Walls (9637): 1
2nd->sample.SpinBot (8905): 0
3rd->sample.Tracker (7137): 0
4th->sample.Fire (4993): -1
5th->sample.Corners (4827): 0
6th->sample.Crazy (3930): 0
7th->sample.MyFirstJuniorRobot (3734): 0
8th->sample.MyFirstRobot (3648): -1
9th->sample.RamFire (3358): -1
10th->sample.TrackFire (2896): 0
11th->sample.SittingDuck (1850): 0
12th->sample.Target (1710): 0
13th->sample.Interactive (1250): 0
Here's what I'm using to test the results (PHP):
$x = file('asdf.csv');
foreach ($x as $line) {
	$line = trim($line);
	$line = explode(',', $line);
	if (count($line) != 12 || $line[0] == 'Rank') continue;
	echo $line[0].'->'.$line[1].' ('.$line[2].'): ';
	$sum = -$line[2];
	for ($i=3; $i<=8; $i++) $sum += $line[$i];
	echo $sum."\n";
}
Results are -totalscore + sumof(everything else). For some lazy reason :-) Still shows a weird offset. --Daniel

 // In robocode.battle.BattleResultsTableModel?:

 public Object getValueAt?(int row, int col) {
     // ...

     ContestantStatistics? statistics = r.getStatistics();

     // ...

     case 2:
         return "" + (int) (statistics.getTotalScore?() + 0.5);
     case 3:
         return "" + (int) (statistics.getTotalSurvivalScore?() + 0.5);
     case 4:
         return "" + (int) (statistics.getTotalLastSurvivorBonus?() + 0.5);
     // etc ...
 }

 // In robocode.peer.ContestantStatistics?:
 public interface ContestantStatistics? {
     public double getTotalScore?();
     public double getTotalSurvivalScore?();
     public double getTotalLastSurvivorBonus?();
     // etc ...
 }

So all of the doubles are being summed and rounded to the nearest integer, which would certainly explain off-by-one errors in the output (i.e. 0.3 gets rounded to 0 but 0.3 + 0.3 = 0.6 rounds to 1). -- AaronR

I am sorry that I saw this discusion too late, because I would be able to answer it very quickly. You are right AaronR, it is the roundings that causes the "trouble". I don't think it makes sense to write out floating point values. The table with the results would get VERY wide, and the general idea of the result table is ;just" to present the results in a "human readable way", not the exact scores. ;-) --Fnl


Another open question! What's the difference between these two?

   setTurnRight(90);
   setAhead(100);
   execute();
   while (getDistanceRemaining() != 0 && getTurnRemaining() != 0) {
     execute();
   }
and:
   setTurnRight(90);
   setAhead(100);
   execute();
Thanks! --Daniel

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited August 30, 2007 11:43 EST by Daniel (diff)
Search: