User talk:Tmservo
package Josewong;
import robocode.*;
//import java.awt.Color;
// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html
/**
* Invertigo - a robot by (your name here)
*/
public class Invertigo extends Robot
{
/**
* run: Invertigo's default behavior
*/
public void run() {
// Initialization of the robot should be put here
// After trying out your robot, try uncommenting the import at the top,
// and the next line:
// setColors(Color.red,Color.blue,Color.green); // body,gun,radar
// Robot main loop
while(true) {
// Replace the next 4 lines with any behavior you would like
back(100);
turnGunLeft(360);
ahead(100);
turnGunLeft(360);
}
}
/**
* onScannedRobot: What to do when you see another robot
*/
public void onScannedRobot(ScannedRobotEvent e) {
// Replace the next line with any behavior you would like
fire(0.95);
}
/**
* onHitByBullet: What to do when you're hit by a bullet
*/
public void onHitByBullet(HitByBulletEvent e) {
// Replace the next line with any behavior you would like
ahead(10);
}
/**
* onHitWall: What to do when you hit a wall
*/
public void onHitWall(HitWallEvent e) {
// Replace the next line with any behavior you would like
ahead(20);
}
}
package Josewong;
import robocode.*;
// API help : http://robocode.sourceforge.net/docs/robocode/robocode/JuniorRobot.html
/**
* InvertigoJunior - a robot by (your name here)
*/
public class InvertigoJunior extends JuniorRobot
{
/**
* run: InvertigoJunior's default behavior
*/
public void run() {
// Initialization of the robot should be put here
// Some color codes: blue, yellow, black, white, red, pink, brown, grey, orange...
// Sets these colors (robot parts): body, gun, radar, bullet, scan_arc
setColors(orange, blue, white, yellow, black);
// Robot main loop
while(true) {
// Replace the next 4 lines with any behavior you would like
back(100);
turnGunLeft(360);
ahead(100);
turnGunLeft(360);
}
}
/**
* onScannedRobot: What to do when you see another robot
*/
public void onScannedRobot() {
// Replace the next line with any behavior you would like
fire(0.95);
}
/**
* onHitByBullet: What to do when you're hit by a bullet
*/
public void onHitByBullet() {
// Replace the next line with any behavior you would like
ahead(10);
}
/**
* onHitWall: What to do when you hit a wall
*/
public void onHitWall() {
// Replace the next line with any behavior you would like
ahead(20);
}
}
I am actually Josewong from wikia My name is Augustus Joseph Wong and my location is 7129 Beverly Street, 66204,
- [View source↑]
- [History↑]
Contents
Thread title | Replies | Last modified |
---|---|---|
AW's kd-tree | 15 | 23:38, 14 October 2013 |
Skilgannon's kd-tree | 30 | 19:43, 11 October 2013 |
First page |
Previous page |
Next page |
Last page |
I suggest you stop worrying about how fast a particular kd-tree is and just use one of them. The top few kd-trees are all very similar in performance and I am sure each have their pro's and cons. I personally still use Rednaxela's Gen 2 tree because of how self contained it is (vs his Gen 3 which has more structure).
If you were using it for Robocode I don't think you'd be worrying about which one. What are you using the tree for?
The tree that I have, is approximately as fast as rednaxela's 2nd gen. (slightly faster in my tests). Are you trying to write a kd-tree or just looking for one to use? As far as I know, jk's tree, rednaxela's tree, and my tree are all quite similar. Bucket kd-tree. No recursive search methods. Use a MBR (minimum bounding rectangle). Use a heap to store the points. I think rednaxela was the first to introduce most of those ideas to robocode, but in my tests, mine was slightly faster and presumably the same can be said of JK's tests.
there is no kd-tree at http://robowiki.net/wiki/User:AW/kD-Tree but there is kd-tree inside gilgalad
Soooo, I've been staying out of this because I have nothing constructive to offer... But FYI, the fact you ignore pretty much every question someone asks makes you seem suspicious. And asking/demanding things without listening makes you seem rude.
If you'd engage in a conversation and tell us your situation, we could probably offer you a lot more help. If you're doing something shady, like cheating on homework, and that's why you're being so secretive, we probably don't want to help.
They're pretty much tied. Mine might be a little faster on systems where the data in the Kd-Tree is frequently pushed out of cache.
No, as I said above, they are mostly the same except for cache conditions.
3rd gen is the fastest of Rednaxela's trees. There's also a k-NN algorithm benchmark if you want to run some tests.
First page |
Previous page |
Next page |
Last page |