[Pogamut-list] Bots standing around doing nothing

jacob.schrum pogamut-forum at diana.ms.mff.cuni.cz
Wed Nov 24 17:56:54 CET 2010


Re: Bots standing around doing nothing

Author: jacob.schrum

Well, I've done a lot of coding, and have the following to report. My original code completely reset the server and reconnected new bots for each evaluation. Then I made a version of the code that kept the same server running all the time, and only killed and reconnected the bots each time. This version would reset the server if it was not empty at the beginning of an eval, due to problems disconnecting. Then I made a third version of the code that uses the same server and bots all of the time, but replaces the "genome" of the running bot during execution.

All versions of this code eventually have the same problem, which is that all of the bots end up just standing mostly still. Sometimes they'll move, but generally not. In all versions of the code, there is only one version of ucc.exe ever running at a time. The fact that the error occurs under all conditions leads me to believe I'm having memory issues as suggested, but I've had some trouble running the profiler because it causes the code to crash before anything interesting happens.

Since this error seems to have arisen mainly as a result of increasing the population size, its possible that I'm simple caching too much information about the population each generation, and this is slowing things down. However, there is one other possibility that I want to ask the Pogamut team about:

Even when I use the same bots each time, I use a special class to collect information about bot performance to help compute the fitness function. This class defines several listeners. For example: 

----------------------------------------------------------------------------------------
        getAgent().agentmemory.world.addEventListener(PlayerKilled.class, killListener = new IWorldEventListener() {

            public void notify(PlayerKilled killed) {
                //System.out.println("Player killed");
                // someone was killed
                if (killed.getKiller().equals(getAgent().getMemory().getAgentID())) {
                    // our agent killed him
                    frags++;
                    damageDone.put(killed.getId().getStringId(), 0);
                    hitShots++;
                }
            }
        });
----------------------------------------------------------------------------------------

A possible problem is that I may be flooding the system with listeners, so I would like to know a bit more about how they work. For example, in the case where I kill the bots each time and restart them, I would assume that all associated listeners are destroyed. However, if I reuse the same bots each time, but keep reinstantiating my stats collecting class, then I might be duplicating the existing listeners. Does this sound like it could be an issue? What's the best way to check for existing listeners? There are several available methods, but they don't seem to have complete JavaDocs.

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=404&post_reply=1#form>





More information about the Pogamut-list mailing list