|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.pakl.rl.maze.MazeWorld
public class MazeWorld
This is a model of a 2D gridworld and supports
all the functions specified in the World interface.
Requires #setLength(int) and
#setLillipadFrequency(double) to be called before
build() is called.
| Constructor Summary | |
|---|---|
MazeWorld(java.lang.String newName)
|
|
MazeWorld(java.lang.String newName,
long randomSeed)
|
|
| Method Summary | |
|---|---|
void |
addTeleporter(State location,
State destination)
|
void |
build()
Allows a world to be built once all necessary aspects of it have been specified. |
int |
distance(State state1,
State state2)
|
boolean |
getIsBuilt()
Allows you to determine if the world has been built yet or not. |
java.lang.String |
getName()
|
State |
getNewState(State oldState,
Action action)
This critical method returns the new state given an action from an old state, and in this case, simply adds state to position to simulate movement. |
int |
getNumberOfStates()
|
double |
getPObstacle()
Getter for property pObstacle. |
State |
getRandomState()
|
int |
getSizeX()
|
int |
getSizeY()
|
State |
getStartingState()
|
java.util.List |
getStateList()
Returns a list of all the states (i.e. |
java.util.HashSet |
getTerminalStates()
|
boolean |
isObstacle(State2D state)
|
boolean |
isTerminalState(State state)
Reports whether this particular state is a terminal state. |
void |
makeIntoObstacle(State2D state)
|
void |
makeIntoTerminalState(State2D state)
|
void |
removeAnyObstacle(State2D state)
|
void |
setLengths(int x,
int y)
Allows you to specify the dimension of the FrogWorld and should be called before the call to build() (Note: in the future, an exception will be thrown if this function was not called first) |
void |
setPObstacle(double pObstacle)
Setter for property pObstacle. |
java.util.Iterator |
stateIterator()
Returns an object which lets you iterate over all states (positions) in the world. |
java.lang.String |
toText()
Pretty-printing -- Returns a text representation of the world, attempting to justify text for display. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MazeWorld(java.lang.String newName,
long randomSeed)
public MazeWorld(java.lang.String newName)
| Method Detail |
|---|
public int getNumberOfStates()
getNumberOfStates in interface Worldpublic int getSizeX()
public int getSizeY()
public java.lang.String toText()
toText in interface Worldpublic java.lang.String getName()
public boolean getIsBuilt()
World
getIsBuilt in interface World
public void addTeleporter(State location,
State destination)
public State getNewState(State oldState,
Action action)
getNewState in interface World
public int distance(State state1,
State state2)
public void setLengths(int x,
int y)
public boolean isTerminalState(State state)
World
isTerminalState in interface Worldpublic void makeIntoTerminalState(State2D state)
public void makeIntoObstacle(State2D state)
public void removeAnyObstacle(State2D state)
public boolean isObstacle(State2D state)
public java.util.HashSet getTerminalStates()
public void build()
World
build in interface Worldpublic java.util.Iterator stateIterator()
World
stateIterator in interface Worldpublic java.util.List getStateList()
World
getStateList in interface Worldpublic State getStartingState()
getStartingState in interface Worldpublic double getPObstacle()
public void setPObstacle(double pObstacle)
pObstacle - New value of property pObstacle.public State getRandomState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||