[Pogamut-list] Launching Multiple Bots of Different Types
simon.jakobsen
pogamut-forum at diana.ms.mff.cuni.cz
Mon Jun 7 23:09:11 CEST 2010
Re: Launching Multiple Bots of Different Types
Author: simon.jakobsen
First off, I'm not part of the staff, just thought I'd drop my thoughts :)
Secondly, I can't guarantee you that this will work for you.
I implemented this static class in my parent class for all bots I've made. I've had no problem starting multiple bots of the same type from each type's respective static main method. I don't see why you shouldn't be able to adapt this to an "experiment" class which calls the respective type's main method. Might be worth a try :)
I couldn't get the code field to work (maybe it's Chrome?) so I've extracted the method body and removed all generics fields, so you'll get warnings if you compile with -xlint:unchecked.
botClass is any class that derives from UT2004BotModuleController(UT2004Bot)
UT2004BotFactory factory = new UT2004BotFactory(new UT2004BotModule(botClass));
UT2004BotRunner botRunner;
if(host == null) {
botRunner = new UT2004BotRunner(factory, name);
}
else {
botRunner = new UT2004BotRunner(factory, name, host, port);
}
return botRunner.startAgent();
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=221&post_reply=1#form>
More information about the Pogamut-list
mailing list