|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.worlds.wumpus.WumpusLogic
A wumpus logic unit that performs logical inference about the wumpus world.
Nested Class Summary | |
class |
WumpusLogic.PathProblemState
|
Field Summary | |
Location |
agentloc
The agents location. |
java.lang.Object[][] |
grid
Information the agent has stored about the world. |
HornKnowledgeBase |
kb
The knowledge base. |
Location |
size
The size of the world. |
ai.worlds.wumpus.WumpusLogic.WumpusGrid |
wumpgrid
The graphical representation of the world. |
Constructor Summary | |
WumpusLogic(int xsize,
int ysize)
|
Method Summary | |
abstract Location |
closestMove(java.util.Vector moves)
Find the closest move from a list. |
void |
display()
Dispay the known information inferred about the grid. |
int |
distance(Location loc1,
Location loc2)
Determine block distance between two locations. |
void |
getStatus()
Analyze the status of each grid cell using the knowledge base. |
abstract void |
makeKB(HornKnowledgeBase kb)
Make a knowledge base. |
void |
move(int x,
int y)
Record a move of the agent. |
abstract Location |
nextMove()
Determine the next location the agent will visit. |
java.util.Vector |
okayMoves()
Determine cells known to be okay. |
abstract java.util.Vector |
pathTo(Location loc,
Location heading)
Determine the sequence of actions which will take the agent to the given location. |
void |
percept(java.lang.String s,
java.lang.String b)
Add the percept information to the knowledge base. |
java.util.Vector |
riskyMoves()
Determine cells that have unknown risk. |
boolean |
succeeded(java.util.Vector answers)
Did the logic query succeed?. |
boolean |
visited(int x,
int y)
Has the cell been visited before?. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public HornKnowledgeBase kb
public java.lang.Object[][] grid
public Location agentloc
public Location size
public ai.worlds.wumpus.WumpusLogic.WumpusGrid wumpgrid
Constructor Detail |
public WumpusLogic(int xsize, int ysize)
Method Detail |
public abstract void makeKB(HornKnowledgeBase kb)
kb
- is the knowledge base that will be constructed.public abstract Location closestMove(java.util.Vector moves)
moves
- is a list of locations to which the agent can move.
public abstract Location nextMove()
public abstract java.util.Vector pathTo(Location loc, Location heading)
loc
- is the location we wish to travel to.heading
- is the agent's current heading.
public void getStatus()
public boolean succeeded(java.util.Vector answers)
answers
- is a list of answers from the knowledge base query.
public void move(int x, int y)
x
- and y are the coordinates moved to.public boolean visited(int x, int y)
x
- and y are the coordiates of the cell.
public void percept(java.lang.String s, java.lang.String b)
s
- is the string indicating whether the agent perceives a stench.b
- is the string indicating whether the agent perceives a breeze.public void display()
public java.util.Vector okayMoves()
public java.util.Vector riskyMoves()
public int distance(Location loc1, Location loc2)
loc1
- and loc2 are two locations.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |