cz.cuni.pogamut.Client
Class AgentLauncher

java.lang.Object
  extended by cz.cuni.pogamut.Client.AgentLauncher

public class AgentLauncher
extends java.lang.Object

This class will allow you to do the basic operations with agent the easy way.

Contains a few simple methods useful for starting the agent like altering the log of the agent, binding parsers / starting.

Note that agent may be started only once thus this class will allow you to call launch() method only once (more calls returns nulls).


Field Summary
private  Agent agent
          Agent of the launcher.
private  boolean launched
          Whether the agent was already launched.
private  boolean localParser
          Whether to use localParser (true) or remoteParser (false);
private  java.net.URI ut
          Where the parser / Gamebots resides.
 
Constructor Summary
AgentLauncher(Agent agent, java.net.URI ut, boolean localParser)
           
 
Method Summary
private  void alterLogToScreen(java.util.logging.Logger log)
           
 Agent getAgent()
           
 java.lang.Thread launch()
          This will launch the agent according to URL and parser specified in the constructor.
 java.lang.Thread launch(java.lang.String name)
          This will launch the agent according to URL and parser specified in the constructor.
 void setLogPlatformToScreen()
          Alters the agent platform log to log to screen.
 void setLogToScreen()
          Alters the agent log to log to screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

private Agent agent
Agent of the launcher.


ut

private java.net.URI ut
Where the parser / Gamebots resides.


localParser

private boolean localParser
Whether to use localParser (true) or remoteParser (false);


launched

private boolean launched
Whether the agent was already launched.

Constructor Detail

AgentLauncher

public AgentLauncher(Agent agent,
                     java.net.URI ut,
                     boolean localParser)
Method Detail

getAgent

public Agent getAgent()

alterLogToScreen

private void alterLogToScreen(java.util.logging.Logger log)

setLogToScreen

public void setLogToScreen()
Alters the agent log to log to screen.


setLogPlatformToScreen

public void setLogPlatformToScreen()
Alters the agent platform log to log to screen.


launch

public java.lang.Thread launch()
This will launch the agent according to URL and parser specified in the constructor.

Parameters:
name - name of the bot
Returns:
Thread of the agent or null on failure

launch

public java.lang.Thread launch(java.lang.String name)
This will launch the agent according to URL and parser specified in the constructor.

Parameters:
name - name of the bot
Returns:
Thread of the agent or null on failure