public class PreyLogic extends SposhLogicController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot,cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor>
SPOSH_LOG_CATEGORY| Constructor and Description |
|---|
PreyLogic() |
| Modifier and Type | Method and Description |
|---|---|
void |
botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange currentConfig,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self) |
void |
botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange currentConfig,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init) |
void |
botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event) |
protected cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor |
createWorkExecutor()
Note that this method was introduced in Pogamut 3.1 as we have swtiched from Python SPOSH engine to Java SPOSH engine
that allows you to have your own IWorkExecutor implementation (such as {@link StateWorkExecutor).
|
void |
finishControllerInitialization() |
cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize |
getInitializeCommand() |
protected String |
getPlan() |
void |
initializeController(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot)
Note that this method was originally "createBehaviour(UT2004Bot bot)".
|
static void |
main(String[] args)
Create an
ExternalBot with custom made logic and
try to connect to Unreal Server at localhost:3000 |
void |
prepareBot(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot) |
createTimer, getEngine, getPlanFromFile, getPlanFromResource, getPlanFromStream, getTimer, getWorkExecutor, logic, logicAfterPlan, logicBeforePlanbeforeFirstLogic, getLogicInitializeTime, getLogicShutdownTime, initializeLogic, logicInitialize, logicShutdownbotShutdown, getAct, getBot, getLog, getPassword, getWorldViewpublic void initializeController(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot)
AgentInfo),
you have to call UT2004Behaviour.initializeBehaviour(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot),
in which the modules are initialized. PreyBehaviour is calling the method in the constructor.initializeController in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>initializeController in class SposhLogicController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot,cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor>bot - public void prepareBot(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot bot)
prepareBot in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>prepareBot in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>protected String getPlan() throws IOException
getPlan in class SposhLogicController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot,cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor>IOExceptionprotected cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor createWorkExecutor()
Because we wanted to maintain old-fashion "behaviour" style of Prey sample, we're using {@link BehaviorWorkExecutor} here that is configured with 'behaviour' previously created by {@link PreyLogic#initializeController(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot) }, which means that SPOSH primitives (actions/senses) are taken from this object (behaviour).
createWorkExecutor in class SposhLogicController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot,cz.cuni.amis.pogamut.sposh.executor.BehaviorWorkExecutor>public cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Initialize getInitializeCommand()
getInitializeCommand in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>getInitializeCommand in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>public void botInitialized(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange currentConfig,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init)
botInitialized in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>botInitialized in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>public void botFirstSpawn(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo gameInfo,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange currentConfig,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage init,
cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self self)
botFirstSpawn in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>botFirstSpawn in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>public void finishControllerInitialization()
finishControllerInitialization in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>finishControllerInitialization in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>public void botKilled(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.BotKilled event)
botKilled in interface cz.cuni.amis.pogamut.ut2004.bot.IUT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>botKilled in class cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004BotController<cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot>public static void main(String[] args) throws cz.cuni.amis.utils.exception.PogamutException
ExternalBot with custom made logic and
try to connect to Unreal Server at localhost:3000args - the command line argumentscz.cuni.amis.utils.exception.PogamutExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.