[Pogamut-list] Proper bot termination

jacob.schrum pogamut-forum at diana.ms.mff.cuni.cz
Wed Jun 16 05:32:51 CEST 2010


Proper bot termination

Author: jacob.schrum

What is the best way to remove multiple bots from a level started using the MultipleUT2004BotRunner? I'm doing evolution, and for every evaluation I'm starting up 3 bots, all of which need to be removed from the level before I launch the next three. However, my current method is resulting in some bots remaining stuck standing still in the level.

Bots are launched using MultipleUT2004BotRunner, and all of them share a common super class that contains this method.

    @Override
    public void logic() throws PogamutException {
        if (limitedEvaluation) {
            if (startTime < 0) {
                startTime = this.game.getTime();
            }
            double elapsed = this.game.getTime();
            if ((elapsed - startTime) > evalTime) { // Terminate evaluation
                this.bot.kill();
            }
        }
    }

The logic method of all the subclasses call super.logic(). The startTime is always initialized to negative so that it can be properly set once the bot realizes it is in the world. Afterwards, the bot should remove it self after evalTime has elapsed.

This might be a problem with UT not removing bots that suddenly get disconnected. That's why I'm asking if there's a better way to disconnect the bots than using this.bot.kill().

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





More information about the Pogamut-list mailing list