|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.ie.cowbots.arch.massim.AbstractAgent
edu.udo.cs.ie.cowbots.arch.massim.MassimAgent
public class MassimAgent
Implementation of the abstract class AbstractAgent, wich represents an agent in the massim environment. It is used to percieve data from massim and set the next action performed by the agent. The methods provided by the AbstractAgent are used to connect and login to the server and to communicate via xml documents.
Field Summary | |
---|---|
(package private) java.io.BufferedReader |
in
|
private MassimAdapter |
massimAdapter
Massim adapter, which can be called if new perceptions arrive. |
private java.lang.String |
nextAction
The next action performed by the agent |
int |
posX
Help vars, to store the relative agents position |
int |
posY
|
Fields inherited from class edu.udo.cs.ie.cowbots.arch.massim.AbstractAgent |
---|
actDoc, actEl, actID, actLock, documentbuilderfactory, logger, username |
Constructor Summary | |
---|---|
MassimAgent()
Empty constructor, without information about the massim server |
|
MassimAgent(MassimAdapter massimAdapter,
java.lang.String host,
java.lang.String username,
java.lang.String pass,
int port)
Creates a new instance of a MassimAgent |
Method Summary | |
---|---|
void |
processLogIn()
Processes information about the log in process. |
void |
processRequestAction(org.w3c.dom.Element perception,
org.w3c.dom.Element target,
long currenttime,
long deadline)
Processes xml formated new perceptions and sends the next action to the massim environment. |
void |
processSimulationEnd(org.w3c.dom.Element perception,
long currenttime)
Processes information about the end of a simulation. |
void |
processSimulationStart(org.w3c.dom.Element perception,
long currenttime)
Processes information about the start of a simulation. |
void |
setNextAction(java.lang.String action)
Sets the next action performed by the agent |
Methods inherited from class edu.udo.cs.ie.cowbots.arch.massim.AbstractAgent |
---|
agentThread, doAuthentication, getDate, getHost, getPassword, getPort, getUsername, processMessage, receiveAuthenticationResult, receiveDocument, receivePacket, sendAuthentication, sendDocument, sendResponseAction, setHost, setPassword, setPort, setUsername, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String nextAction
private MassimAdapter massimAdapter
public int posX
public int posY
java.io.BufferedReader in
Constructor Detail |
---|
public MassimAgent()
public MassimAgent(MassimAdapter massimAdapter, java.lang.String host, java.lang.String username, java.lang.String pass, int port)
massimAdapter
- The adapter which can be called if new perceptions arrivehost
- The host massim is running onusername
- The agents usernamepass
- The agents passwordport
- The port massim is listening toMethod Detail |
---|
public void setNextAction(java.lang.String action)
action
- Action performed by the agent
Possible actions are: skip, north, south, east, west,
northwest, northeast, southwest, southeastpublic void processRequestAction(org.w3c.dom.Element perception, org.w3c.dom.Element target, long currenttime, long deadline)
processRequestAction
in class AbstractAgent
public void processSimulationEnd(org.w3c.dom.Element perception, long currenttime)
processSimulationEnd
in class AbstractAgent
public void processSimulationStart(org.w3c.dom.Element perception, long currenttime)
processSimulationStart
in class AbstractAgent
public void processLogIn()
processLogIn
in class AbstractAgent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |