Smart Factor Targeting

From Robowiki
Revision as of 18:16, 1 April 2011 by Ceasar (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This is a technique that I am trying to implement in AgentSmith. As I have not finished implementing it I don't know how good or bad it will be. As you can guess from the name its a variation on GuessFactorTargeting but thats as much as I am willing to say! I need all the help I can get against the top bots without giving away some of my secrets!

Once I release the bot into the rumble I will probably release details of the technique! Check back here for updates on how good or bad my implementation is! (Probably going to be really bad!)

--Wolfman

Update 01/03/2006:

Just getting back into writing AgentSmith again after a bit of an absense! I've changed my mind on how to do this technique about three times so after having written it three different ways I think I might (with luck) be starting to get somewhere that is at least reasonable, so long as I can sort out a problem with memory that I seem to be having. Does anyone have any ideas why my bot will be running of memory? Is there any way I can track it to see whats using what etc? (Im using Eclipse by the way but don't know much about it). I've tried removing as many calls to "new" as possible so I just allocate everything at the start of the battle and never do it again. Still it seems to be running out after about 60 rounds ....

Maybe you have some circular reference somewhere so that the garbage collector can't free stuff. I don't think it's a good idea to move those object creations to the start. Better new them as they are needed and let the garbage collecter reap. You probably have a huge structure that you keep adding stuff too. That's where you should start looking. -- PEZ Oh well I guess I will just have to plod along and see how I can improve things! --Wolfman

Original chat

I've moved all this old chat into here for the moment. --Wolfman

Great! I love it when people try to come up with unorthodox ideas :-) Keep us posted! -- Vic

I believe I came up with an interesting (I can't say anything better) idea for a gun. But I would need a ready to use (and preferably as fast as possible) implementation of Red-Black Tree, as in C++ STL set class. Is there any such thing in Java? --lRem

If you just need something like std::set (regardless of implementation), you can use a Java TreeSet or HashSet (which behave like std::set and std::hash_set respectively). If you use a TreeSet, the objects you put in there either need to implement the Comparable interface (or in Java 5, Comparable<Type> interface), or you can pass in a Comparator implementation. The first case is analogous to implementing std::less for the type, the second is like passing in a strict weak ordering to use instead of std::less. An Iterator created by a TreeSet will iterate in the natural order (or the ordering you give it) of the objects in the set. If this order doesn't matter, you can alternately use a HashSet (which means you don't need a comparator, but you probably need to override hashCode to do something useful, and maybe equals as well). Many built in objects already override hashCode() and implement Comparable if there is an appropriate comparison that can be made. Java also has a TreeMap and HashMap class (which are analogous to std::map and std::hash_map). -- Kawigi (P.S.- man, am I just a show off today with library knowledge!) (P.P.S.- TreeMap/HashMap are common ways to store enemy information in melee so they can be indexed by name)

Cool :) Now I only need a lot of motivation to implement it ;) --lRem