|
|||||||||
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.java.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 JavaBehaviour |
behaviour
|
protected java.lang.String |
pathToJythonJar
Path to jython jar which is needed for importing of the modules. |
protected java.lang.String |
pathToPogamutCore
Path to directory where SPOSH engine module can be found. |
protected java.lang.String |
pathToSPOSH
Path to directory where SPOSH engine module can be found. |
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()
|
|
SPoshBot(JavaBehaviour behaviour,
java.lang.String sposhPlanFileName)
|
|
SPoshBot(JavaBehaviour behaviour,
java.lang.String sposhPlanFileName,
java.lang.String pathToSPOSH,
java.lang.String pathToJythonJar)
|
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 JavaBehaviour |
getBehaviour()
|
protected java.lang.String |
getPlanFile()
|
protected boolean |
checkPreconditions()
|
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. |
protected void |
prePrepareAgent()
This will call function prePrepareAgent() from specified logicFileName. |
protected void |
shutdownAgent()
This will call function shutdownAgent() from specified logicFileName. |
Methods inherited from class cz.cuni.pogamut.Client.ScriptedAgent |
---|
bindEngineByExtension, bindEngineByFileName, bindEngineByMimeType, bindEngineByName, bindScriptFile, bindScriptFile, createScriptEngineManager, engineBinded, evalFile, evalStream, getIntrospectableProxy, scriptFileBinded, setAgentAttributes, setAttribute, 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 pathToPogamutCore
protected java.lang.String sposhPlanFile
protected JavaBehaviour behaviour
Constructor Detail |
---|
public SPoshBot() throws ScriptedAgentException
ScriptedAgentException
public SPoshBot(JavaBehaviour behaviour, java.lang.String sposhPlanFileName, java.lang.String pathToSPOSH, java.lang.String pathToJythonJar) throws ScriptedAgentException
ScriptedAgentException
public SPoshBot(JavaBehaviour behaviour, java.lang.String sposhPlanFileName) throws ScriptedAgentException
ScriptedAgentException
Method Detail |
---|
protected boolean checkPreconditions()
checkPreconditions
in class ScriptedAgent
protected JavaBehaviour getBehaviour()
protected java.lang.String getPlanFile()
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
protected void prePrepareAgent() throws PogamutException
prepares agent logic to run - like initializing neural networks etc. not for establishing communication!
prePrepareAgent
in class ScriptedAgent
PogamutException
protected void shutdownAgent() throws PogamutException
Clean - up after the end of simulation of agent
shutdownAgent
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 |