|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wworld.GameServer
The gameserver object controls the overall simulation of the wumpus world. It conducts the simulation, performs the action, updates the environment, etc.
Field Summary | |
static int |
MAXSTEPS
Maximum number of steps allowed for each trial |
Constructor Summary | |
GameServer(Environment wumpusEnv,
int trials,
int currTrial,
java.util.Vector vecScore,
int waitTime,
projectFrame pFrame)
|
Method Summary | |
void |
doAction(Agent agent,
Percept percept,
int action)
Performs the action specified by the agent, and sets the necessary variable in the Percept. |
int |
getAction(java.net.Socket iclient,
java.io.ObjectInputStream in)
Does the necessary communication with the client and gets the action specified by the clients. |
void |
playGame1(java.util.Vector client,
java.util.Vector cin,
java.util.Vector cout,
projectFrame myFrame,
int currentTrial,
int numTrials)
Conducts the simulation from beginning to the end of current trial. |
static void |
printPrompt(java.lang.String prompt)
prints the prompt |
void |
printStats()
Prints all the statistics for each agent at the end of each trial, and at the end of all the trials. |
static java.lang.String |
readLine()
Reads a line from the standard input |
static java.lang.String |
readLine(java.lang.String prompt)
|
void |
reset(Environment wumpusEnv,
int currTrial)
Used to reset attributes at the end of a game. |
void |
sendIntToStream(java.net.Socket iclient,
java.io.ObjectInputStream in,
java.io.ObjectOutputStream out,
int i)
Sends an integer over the socket connection to the client. |
void |
sendToStream(java.net.Socket iclient,
java.io.ObjectOutputStream out,
java.lang.Object obj)
Sends the specified obj over the socket to the specified client. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int MAXSTEPS
Constructor Detail |
public GameServer(Environment wumpusEnv, int trials, int currTrial, java.util.Vector vecScore, int waitTime, projectFrame pFrame)
Method Detail |
public void reset(Environment wumpusEnv, int currTrial)
public void playGame1(java.util.Vector client, java.util.Vector cin, java.util.Vector cout, projectFrame myFrame, int currentTrial, int numTrials)
public void printStats()
public void doAction(Agent agent, Percept percept, int action)
public int getAction(java.net.Socket iclient, java.io.ObjectInputStream in)
public void sendToStream(java.net.Socket iclient, java.io.ObjectOutputStream out, java.lang.Object obj)
public void sendIntToStream(java.net.Socket iclient, java.io.ObjectInputStream in, java.io.ObjectOutputStream out, int i)
public static void printPrompt(java.lang.String prompt)
public static java.lang.String readLine()
public static java.lang.String readLine(java.lang.String prompt)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |