public class DemoGridAgent extends AbstractAgent
documentbuilderfactory, logger, username
Constructor and Description |
---|
DemoGridAgent() |
DemoGridAgent(String host,
String username,
String pass) |
DemoGridAgent(String host,
String username,
String pass,
int port) |
Modifier and Type | Method and Description |
---|---|
String |
determineDirection(int north,
int west,
int south,
int east)
Computation of the better direction (shortest way) to the depot
|
static void |
main(String[] args)
Main method of this class
|
void |
processLogIn() |
String |
processPerception(Element a) |
void |
processRequestAction(Element perception,
Element target,
long currenttime,
long deadline) |
void |
processSimulationEnd(Element perception,
long currenttime) |
void |
processSimulationStart(Element perception,
long currenttime)
Initialisation of main variables and vectors
|
String |
push() |
String |
randomAction()
Determination of random action
|
String |
surround() |
agentThread, doAuthentication, getDate, getHost, getPassword, getPort, getUsername, processMessage, receiveAuthenticationResult, receiveDocument, receivePacket, sendAuthentication, sendDocument, setHost, setPassword, setPort, setUsername, start
public static void main(String[] args)
args
- username, Password and optional Hostpublic void processRequestAction(Element perception, Element target, long currenttime, long deadline)
processRequestAction
in class AbstractAgent
public String randomAction()
public String surround()
public String push()
public String determineDirection(int north, int west, int south, int east)
north
- Distance to the depot (from the adjacent north cell)west
- Distance to the depot (from the adjacent west cell)south
- Distance to the depot (from the adjacent south cell)east
- Distance to the depot (from the adjacent east cell)public void processLogIn()
processLogIn
in class AbstractAgent
public void processSimulationEnd(Element perception, long currenttime)
processSimulationEnd
in class AbstractAgent
public void processSimulationStart(Element perception, long currenttime)
processSimulationStart
in class AbstractAgent
Copyright © 2013. All Rights Reserved.