Author | Message |
---|---|
rabbott
Posts: 1649
|
Posted 14:13 Jun 03, 2012 |
I have a worthy opponent for you. Bot.10.jar is an extension of GreedyStarter. It includes alpha-beta combat as discussed in class. it also includes a generalization of the direct line search that GreedyStarter uses. GreedyStarter moves its bots toward any goal (food or enemy hill) that it can get to in more-or-less a straight line. Bot.10 generalized the notion of straight line search to include any search that doesn't deviate from a straight line by a given amount. The allowed deviation is a constant (Strategy.MAX_DEVIATION) in the code. Bot.10 also limits itself to targets that are within a given path-length distance--also a constant Strategy.MAX_PATH_LENGTH. (The values for the current Bot.10.jar as compiled are 20 and 30 respectively.) Bot.10 has no exploration capability its ants move only because they are drawn to targets, which are primarily the food or enemy hills within reach given its search limits. In addition it is drawn to up to 5 enemy ants. Without that it would never see the enemy hill in the 2-player maze. The problem is that the hill is hidden too deeply in a curved path. If Bot.10 weren't able to "smell" the enemy ants the enemy hill would remain safe. When I played Bot.10 against GuavaSearch and GreedyBot.py (by running CS_460_ant_Programs/PlayAGame.cmd) it beat them both. The game was interesting in that GuavaSearch has an exploration capability. As a result it jumped out ahead and by turn 217 had 72 ants to 31 for Bot.10. In addition, GuavaSearch is pretty good at attacking enemy hills. By turn 236, GuavaSearch had taken GreedyBot.py's hill. At that point GuavaSearch had 59 ants, and Bot.10 had 31. GuavaSearch had 3 points (because it had taken a hill), and Bot.10 had its original 1 point. GreedyBot.py was eliminated. From then on Bot.10's combat skills overcame GuavaSearch's exploration skills. Bot.10 wore down GuavaSearch and eventually took its hill. At the end of the game GuavaSearch had 13 ants and 2 points (because it lost a point when Bot.10 took its hill) and Bot.10 had 43 ants and 3 points, winning the game. You may use Bot.10 to try out your ants. Get the source code from Dropbox\CS_460_Ant_Programs\workspace\Bot.10\src. You can comment out the combat capability at the start of Strategy.buildOrders. You can also adjust the two search parameters at the top of the Strategy file. With those adjustments available you should find a setting that allows your bot to beat Bot.10. -- Russ Abbott Last edited by rabbott at
14:34 Jun 03, 2012.
|
srportnoff
Posts: 12
|
Posted 15:07 Jun 03, 2012 |
Would like to test my Java1.6 bot (uploaded to Dropbox as SRPv8 and SRPv9) vs. Bot.10, but still having same configuration problems with Java 7 that I abandonned in order to actually build a working bot. I've just re-installed jre 1.7 and jdk 1.7 and updated System PATH environment variable. I've downloaded guava-12.0.jar to the same folder as Bot.10.jar. PlayAGame still crashes when trying to load Bot.10. Perhaps if you provided specific instructions for both where to find and install the Guava 12 library and source.. |
rabbott
Posts: 1649
|
Posted 17:43 Jun 03, 2012 |
If you copy my Dropbox configuration (which should happen automatically if we are sharing) and put your bot into the Dropbox\CS_460_Ant_Programs\bots folder, everything should work -- as long as there is no incompatibility with java 1.6 vs 1.7 The Guava jar file is in Dropbox\CS_460_Ant_Programs\bots\lib. Bot.10 is configured to get it. You shouldn't have to do anything special. What happens when you run Dropbox\CS_460_Ant_Programs\PlayAGame?
|
rabbott
Posts: 1649
|
Posted 17:48 Jun 03, 2012 |
I just ran Dropbox\CS_460_Ant_Programs\Bot10.vs.SRPv9. SRPv9 won--decisively. Congratulations! This is a good illustration of how important it is to have both combat and exploration. SRPv9 has both. Bot.10 has only combat. It does well in combat against SRPv9, but since SRPv9 hold its own in combat--in contrast to GuavaSearch, which crumbles against Bot.10--SRPv9's exploration ability wins out in the end. You should be able to run it also. Last edited by rabbott at
17:53 Jun 03, 2012.
|
srportnoff
Posts: 12
|
Posted 19:49 Jun 03, 2012 |
OK, I'll give the configuration effort a bit more of the old college try, since this is college... I just ran Dropbox\CS_460_Ant_Programs\Bot10.vs.SRPv9. SRPv9 won--decisively. Congratulations! Just to put things in perspective: SRPv9 manages to last for about 350-400 turns, give or take, when playing against xathis or greenTea. The combat strategy - min/max - just is too primitive for how the latter two fight. I haven't seen the match yet, but my thoughts are that what may have given the SRPv9 bot an edge over Bot.10 was not so much exploration as sending reinforcements to a battle. The strategy is that the 4 closest ants will start heading to each battle as reinforcements when detected. Ants in a battle retreat if outnumbered, and so tend to survive until reinforcements arrive, at which case they all head on in to attack (my min/max probably still needs improvement in the evaluation function). The priority of commands is also important. When I had Food as the #1 priority, the bot of course did poorly in combat - your opponents don't really allow you the courtesy of taking a snack mid-battle). The priorities were changed to (1) Combat (survival), (2) Food, (3) Heading Towards Enemy Hills once they are detected (like xathis, continually sending 4 ants), (4) Sending Reinforcements to combat, and finally (5) Exploration.for all remaining ants. I also want to put in a last plug for optimistic search for Food. The worst that happens in an optimistic Food search is that you head in the wrong direction and explore more of the map, filling in the details - not a bad thing. Pessimistic search will hesitate going for food, during which time an enemy ant may scoop it up. Of course, during that time interval, a pessimistic explorer may find a complete path to the food - but it's probably the explorer ant that sees that food again that will head to the food (if it's still there) rather than the original food ant that would have started towards it several turns earlier. If our combat strategies are not sophisticated enough, the only way to prolong (but unfortunately not forestall) survival when playing superior players is to gather food quickly and reproduce. |
rabbott
Posts: 1649
|
Posted 20:35 Jun 03, 2012 |
Does Bot10.vs.GuavaSearch.cmd run on your computer? All you should have to do is open a Windows Explorer to \Dropbox\CS_460_Ant_Programs and then double click Bot10.vs.GuavaSearch.cmd. Let me know what happens when you do that. There shouldn't be any configuration issues. |
srportnoff
Posts: 12
|
Posted 22:53 Jun 03, 2012 |
|