|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.Client.Agent
cz.cuni.pogamut.Client.ScriptedAgent
cz.cuni.sposhBot.python.SPoshBot
public class SPoshBot
This is class introduce a POSH as a reactive planner for the agent. Before starting the agent, you have to: 1) specify the plan file -> bindPlanFile() 2) specify the file with senses and actions -> bindScriptFile() For more info see examplePoshBot.py
Field Summary | |
---|---|
protected java.lang.String |
pathToJythonJar
Path to jython jar which is needed for importing of the modules. |
protected java.lang.String |
pathToPogamutCore
Path to Pogamut Core jar file. |
protected java.lang.String |
pathToSPOSH
Path to directory where SPOSH engine module can be found. |
protected java.lang.String |
pyFileName
Here will be stored the path to '.py' file with the sensors and effectors. |
protected java.lang.String |
sposhPlanFile
Here the path to '.lap' file will be stored (POSH plan). |
Fields inherited from class cz.cuni.pogamut.Client.ScriptedAgent |
---|
engine, invocableEngine, scriptFileName |
Fields inherited from class cz.cuni.pogamut.Client.Agent |
---|
bindedParserType, body, flagLogicTemporalyStopped, gameBotConnection, gameMap, GARBAGE_COLLECTOR_FREQUENCY, instancesAlive, iterationEndListeners, log, logicFrequency, logicFrequencyChanged, memory, oldLogicFrequency, parserLogger, pauseHolders, platformLog, random, rawGBLog |
Constructor Summary | |
---|---|
SPoshBot(java.lang.String pyFileName,
java.lang.String sposhPlanFileName)
|
|
SPoshBot(java.lang.String pyFileName,
java.lang.String sposhPlanFileName,
java.lang.String pathToPogamutCore)
|
|
SPoshBot(java.lang.String pyFileName,
java.lang.String sposhPlanFileName,
java.lang.String pathToSPOSH,
java.lang.String pathToJythonJar,
java.lang.String pathToPogamutCore)
|
Method Summary | |
---|---|
protected void |
doLogic()
This will call function doLogic() from specified scriptFileName. |
protected void |
engineIsGoingToBeBinded()
Adding path to sposh module to system property Config.PYHTON_PATH |
protected void |
init()
Called only from constructors! |
static void |
main(java.lang.String[] Args)
|
protected void |
postPrepareAgent()
This will call function postPrepareAgent() from specified logicFileName. |
Methods inherited from class cz.cuni.pogamut.Client.ScriptedAgent |
---|
bindEngineByExtension, bindEngineByFileName, bindEngineByMimeType, bindEngineByName, bindScriptFile, bindScriptFile, createScriptEngineManager, engineBinded, evalFile, evalStream, getIntrospectableProxy, checkPreconditions, prePrepareAgent, scriptFileBinded, setAgentAttributes, setAttribute, shutdownAgent, startAgent |
Methods inherited from class cz.cuni.pogamut.Client.Agent |
---|
addIterationEndListener, bindLocalParser, bindRemoteParser, clearListeners, disconnect, finalize, getBindedParserType, getBody, getCommunicationState, getFlagLogicTemporalyStopped, getLogger, getLogicThread, getMap, getMediator, getMemory, getMilisecToSleep, getName, getPlatformLog, getRawDataLog, initBody, initGameMap, initLogging, initMemory, isRunning, logicReady, pauseLogic, receiveMessage, removeIterationEndListener, resumeLogic, run, sendMessageToGB, setFlagLogicTemporalyStopped, setLogicStartLatch, startAgent, stopAgentSoft |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String pathToJythonJar
protected java.lang.String pathToSPOSH
protected java.lang.String pyFileName
protected java.lang.String sposhPlanFile
protected java.lang.String pathToPogamutCore
Constructor Detail |
---|
public SPoshBot(java.lang.String pyFileName, java.lang.String sposhPlanFileName, java.lang.String pathToSPOSH, java.lang.String pathToJythonJar, java.lang.String pathToPogamutCore) throws ScriptedAgentException
ScriptedAgentException
public SPoshBot(java.lang.String pyFileName, java.lang.String sposhPlanFileName) throws ScriptedAgentException
ScriptedAgentException
public SPoshBot(java.lang.String pyFileName, java.lang.String sposhPlanFileName, java.lang.String pathToPogamutCore) throws ScriptedAgentException
ScriptedAgentException
Method Detail |
---|
protected void engineIsGoingToBeBinded()
engineIsGoingToBeBinded
in class ScriptedAgent
protected void init() throws ScriptedAgentException
ScriptedAgentException
- is thrown when evaluation of the logic file fails
javax.script.ScriptException
- is thrown when evaluation of misc. commands (setting python path) failsprotected void doLogic()
ScriptedAgent
It should do the logic iteration (assuming you're already connected and prePreparaAgent and postPrepareAgent were already called).
doLogic
in class ScriptedAgent
protected void postPrepareAgent() throws PogamutException
ScriptedAgent
prepare logic according to information gathered from startCommunication like choosing plan/parameters according to game type.
postPrepareAgent
in class ScriptedAgent
PogamutException
public static void main(java.lang.String[] Args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |