|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.worlds.Environment
A generic environment. All environments must implement getPercept, performanceMeasure, snapshot, termination, and legalAction methods
Field Summary | |
Agent[] |
agents
The agents within the environment. |
boolean |
display
Flag to indicate whether to display |
int |
maxSteps
The maximum number of steps. |
java.lang.Thread |
runner
The animation thread. |
int |
step
The current step number. |
Constructor Summary | |
Environment()
|
Method Summary | |
void |
displayEnv()
Perform one animation step if the display flag is set. |
void |
executeAgentActions()
Each agent executes its current action. |
abstract java.lang.Object |
getPercept(Agent a)
Get the current percept. |
abstract boolean |
legalAction(java.lang.String a)
Determine if action is legal. |
abstract int |
performanceMeasure(Agent a)
Score the performance of the agent. |
void |
run()
Run the environment until maximum steps or termination criteria are met. |
abstract void |
snapshot()
A snapshot of the environment. |
void |
start()
|
void |
stop()
|
void |
takeStep()
Each agent determines and performs one action. |
abstract boolean |
termination()
Determine if all agents have terminated. |
void |
updateEnv()
Update the environment after each step. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Agent[] agents
public int step
public int maxSteps
public boolean display
public java.lang.Thread runner
Constructor Detail |
public Environment()
Method Detail |
public abstract java.lang.Object getPercept(Agent a)
a
- Agent in the environmentpublic abstract int performanceMeasure(Agent a)
a
- Agent in the environmentpublic abstract void snapshot()
public abstract boolean termination()
public abstract boolean legalAction(java.lang.String a)
a
- Possible action.public void start()
public void stop()
public void run()
run
in interface java.lang.Runnable
public void takeStep()
public void displayEnv()
public void updateEnv()
public void executeAgentActions()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |