public class IslandMove extends java.lang.Object implements MoveIterator, Move
controllers.D2AlgorithmController to find a path for
pebbles to travel from the island to the current target vertex (if possible). Successive calls to
next() simply move the current target to the next target in the set of destinations past in the
constructor. Calling IslandMove#executeMoveOnGraph(PebbleGraphController) attempts to move a pebble from
island to the current target.| Constructor and Description |
|---|
IslandMove(Island i)
Instantiates a new composite move.
|
| Modifier and Type | Method and Description |
|---|---|
int |
executeMoveOnGraph(PebbleInstance c)
Makes the current move and returns the number of moves made or throws CouldNotCompleteMove if it could not make the move.
|
Vertex |
getDest()
Gets the current destination dest.
|
java.util.Set<Vertex> |
getTargetedVerts() |
boolean |
hasNext()
Returns whether this this object any untried destinations.
|
Move |
next()
Gets the next move.
|
void |
remove() |
void |
reset()
Reset.
|
java.lang.String |
toString() |
public IslandMove(Island i)
i - the idestinations - the dests // Spell words out! what is a "dest"? CAC 1/09public Vertex getDest()
public boolean hasNext()
hasNext in interface java.util.Iterator<Move>public Move next()
next in interface java.util.Iterator<Move>public void reset()
public void remove()
remove in interface java.util.Iterator<Move>Iterator.remove()public java.util.Set<Vertex> getTargetedVerts()
getTargetedVerts in interface Movepublic int executeMoveOnGraph(PebbleInstance c) throws CouldNotCompleteMove
executeMoveOnGraph in interface Movec - the controllerCouldNotCompleteMove - if the move could not be completed moveMove2.Move#executeMoveOnGraph(PebbleGraphController)public java.lang.String toString()
toString in class java.lang.Object