User talk:Tmservo

From Robowiki
Jump to navigation Jump to search
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,

You cannot post new threads to this discussion page because it has been protected from new threads, or you do not currently have permission to edit.

Contents

Thread titleRepliesLast modified
pattern surfer001:53, 5 December 2013
proof that literumble win percentage is broken102:23, 30 November 2013
does bin smoothing make guns better or worse802:09, 26 November 2013
netbeans vs eclipse113:24, 23 November 2013
AW's kd-tree1523:38, 14 October 2013
Skilgannon's kd-tree3019:43, 11 October 2013
First page
First page
Next page
Next page
Last page
Last page

pattern surfer

a pattern surfer is a surfer that uses pattern matching and play it forward in it's movement

Tmservo (talk)01:53, 5 December 2013

proof that literumble win percentage is broken

Tmservo (talk)01:26, 30 November 2013

There have always been strange artifacts when the rumble hasn't stabilized yet. Look again when it is stable.

Chase02:23, 30 November 2013
 

does bin smoothing make guns better or worse

Edited by author.
Last edit: 13:25, 21 November 2013

can someone tell me if bin smoothing makes guns radar movement better or worse

Tmservo (talk)05:52, 21 November 2013

It doesn't do much for guns, but it helps a lot for wave surfing.

Skilgannon (talk)07:17, 21 November 2013
 

In movement, Bin Smoothing helps bots dodge bullets with a margin of safety.

In radar, why would you use bins?

In guns, Bin Smoothing helps spot crowds in melee/team if combined with swarm targeting. In 1v1 I don't see any use.

MN (talk)01:52, 23 November 2013

see even the pros learn when they post about stuff

Tmservo (talk)04:18, 23 November 2013
 

@MN and Skilgannon: While those things are true, I think those descriptions miss the underlying point of why bin smoothing is helpful. In both targeting and dodging, what one is trying to do is to estimate the PDF (probability density function) curve of the opponent's movement/targeting. Whenever one is estimating a PDF curve (not just in Robocode) from a finite number of observations, and the system has some inherent noise or unpredictability, it will give a more accurate estimation of the true PDF curve if one applies the correct amount of smoothing. Now, how much is the "correct amount" is a complicated question that depends on how much noise/uncertainty your measurements have, how much noise/uncertainty the process being measured has, and how many measurements you have (reminds me of Kalman filters, similar principals come into play). In Robocode most people just pick a certain amount of bin smoothing that seems to work for them, but I feel it is worth pointing out that this is just one application of PDF curve estimation, and that there are methods of estimating the correct amount of smoothing which to my knowledge have not yet been applied to Robocode. (I'd guess you two already are well aware of this, but I just feel like rambling)

Rednaxela (talk)20:52, 23 November 2013

Instead of applying methods of estimating the correct amounts of bin smoothing, people tend to switch to kernel density and tune the kernel function. There was a lot of discussion about the best kernel function and the best function width. The optimal changes for each opponent and some kind of averaging is needed, which is usually estimated through genetic tuning.

In guns, smoothing usually has no effect because you don't need to estimate the PDF, you only need to find the peak. But when you superpose many PDFs together (swarm targeting), things change.

MN (talk)01:51, 25 November 2013

Estimating the PDF can still a useful component of finding the peak when not superimposing things, particular when the density of observations is sufficiently low. The main reasons you don't see much effect in targeting is that the usual bin sizes inherently act similar to a certain amount of smoothing anyway, and for targeting you have a larger number of observations than movement which reduces the amount of smoothing that makes sense as well. Consider what happens when your bins are significantly smaller than what is typical without any additional smoothing. (A targeting system that accounts for botwidth also reduces the amount of smoothing that makes sense, but that's a bit of a different matter)

Rednaxela (talk)14:41, 25 November 2013

For me two things make smoothing more useful in movement than in targeting:

  1. Movement needs to estimate probability at arbitrary points, instead of a single peak, so the location the probability is required at isn't related to where data is available.
  2. Movement has much less data than targeting, so smoothing is needed to fill in gaps in knowledge.

Theoretically smoothing might help in targeting, but all my testing has shown that a simple square kernel works just as well or better, while running many times faster.

I've also considered something like Kalman filters, but they are Unimodal which doesn't work for targeting or movement at all. Perhaps particle filters, although the histogram filters we have right now in VCS also work pretty well.

Skilgannon (talk)22:07, 25 November 2013

re: why in movement, agreed 100%.

With WaveSim, I've tested different kernel densities (effectively smoothing formulas) in my main gun over a huge data set. There were differences, but IIRC on the order of thousandths of a percent in hit percentage (eg 12.004% vs 12.002%). Not sure of the margin of error, either... 5k battles * ~25k ticks = millions of records, and both algorithms were running on the same data set.

Voidious (talk)01:56, 26 November 2013
 
 
 
 
 

netbeans vs eclipse

which is better netbeans or eclipse

Tmservo (talk)01:19, 22 November 2013

I use Eclipse. I don't use NetBeans in years, so I can't really compare the new versions against each other.

But in general terms, most of Eclipse features are based on plug-ins, which means you won't find all the features you need on the basic installation, but there should be a plug-in somewhere doing what you need. NetBeans is a fixed pack, if it has everything you need then it's fine, if not, then you will need additional tools outside NetBeans.

MN (talk)13:24, 23 November 2013
 

AW's kd-tree

how fast is Andrew Wells kd-tree

Tmservo (talk)12:17, 8 October 2013

How Fast Is Andrew Wells KD-TREE

Tmservo (talk)22:33, 10 October 2013

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).

Chase05:10, 11 October 2013
 
Edited by author.
Last edit: 19:43, 11 October 2013

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?

Skilgannon (talk)17:27, 11 October 2013
Edited by another user.
Last edit: 21:30, 12 October 2013

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.

AW (talk)19:35, 11 October 2013
Edited by author.
Last edit: 20:34, 11 October 2013

there is no kd-tree at http://robowiki.net/wiki/User:AW/kD-Tree but there is kd-tree inside gilgalad

Tmservo (talk)19:45, 11 October 2013

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.

Voidious (talk)20:05, 11 October 2013
 
 
 
 
 

Skilgannon's kd-tree

is Julian Kent's kd tree faster than Rednaxela's or is it the other way around

Tmservo (talk)07:45, 4 October 2013

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.

Skilgannon (talk)12:28, 4 October 2013

is third generation Rednaxela faster than Julian Kent

Tmservo (talk)12:38, 4 October 2013

No, as I said above, they are mostly the same except for cache conditions.

Skilgannon (talk)14:07, 4 October 2013

what about second generation Rednaxela and first generation Rednaxela

Tmservo (talk)22:22, 4 October 2013

3rd gen is the fastest of Rednaxela's trees. There's also a k-NN algorithm benchmark if you want to run some tests.

Voidious (talk)01:32, 5 October 2013
 
 
 
 
 
First page
First page
Next page
Next page
Last page
Last page