User talk:AW/virtualWaves

From Robowiki
< User talk:AW
Revision as of 04:04, 6 September 2012 by AW (talk | contribs) (another question about virtual waves)
Jump to navigation Jump to search

So, I was trying to debug my virtuality attribute and I am stuck on something. I test gunTurnRemaining < threshold before firing, and I don't see how I can know that on the previous turn. However, I think I need to fire my firing wave the turn before it really is fired because the data gathered for that turn is the data I use for aiming. Is there any way to get the virtuality attribute perfect? Here is the code I currently have:

		double virtuality;
		virtuality = (ticksSinceFire + 1) * ourRobot.getGunCoolingRate() / 3.0;
		double gunHeat = Math.max(0.0,
				ourRobot.getGunHeat() - ourRobot.getGunCoolingRate());
		if (gunHeat < (ticksSinceFire + 1) * ourRobot.getGunCoolingRate()) {
			if (ourRobot.getEnergy() > 0.11 || _isTC) {
				System.out.print("Using GunHeat   " + ourRobot.getGunHeat() + "   " + (ticksSinceFire + 1) + "   ");
				virtuality = gunHeat / 3.0;
				lastBulletPower = nextBulletPower;
			}
		}
		double bulletPower = lastBulletPower;

I don't fire if I have less than 0.11 energy left, I think I want ticks since fire and gun heat to be for the next turn since that is when the bullet would be fired. This is also important for my latest perfectionistic change of using the bullet power (or estimated bullet power) for the closest real wave for my virtual waves.