public HashSet<Action> actions(Object state)
{
EightPuzzleBoard board = (EightPuzzleBoard)state;
HashSet<Action> actions = new LinkedHashSet<Action>();
if (board.canMoveGap(EightPuzzleBoard.UP))
{
actions.Add(EightPuzzleBoard.UP);
}
if (board.canMoveGap(EightPuzzleBoard.DOWN))
{
actions.Add(EightPuzzleBoard.DOWN);
}
if (board.canMoveGap(EightPuzzleBoard.LEFT))
{
actions.Add(EightPuzzleBoard.LEFT);
}
if (board.canMoveGap(EightPuzzleBoard.RIGHT))
{
actions.Add(EightPuzzleBoard.RIGHT);
}
return actions;
}
}