dam
Class Node

java.lang.Object
  extended by dam.Node

public class Node
extends java.lang.Object

class Main


Field Summary
static int N
           
static int[][] visited
           
static int visitedCount
           
 
Constructor Summary
Node(int[] position, Node prev)
          Constructor
Node(Node node, Node prev)
          Constructor 2
 
Method Summary
static void cleanVisited()
          cleanVisited()
 Node getPrev()
          Node getPrev()
 boolean isEnd()
          boolean isEnd()
 Node selectBest()
          Node selectBest() Selects one of the best moves
 java.lang.String toString()
          String toString()
 void visit()
          visit()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

N

public static int N

visited

public static int[][] visited

visitedCount

public static int visitedCount
Constructor Detail

Node

public Node(int[] position,
            Node prev)
     throws java.lang.Exception
Constructor

Parameters:
position - chessboard
prev - previous node
Throws:
java.lang.Exception

Node

public Node(Node node,
            Node prev)
Constructor 2

Parameters:
node - actual node
prev - previous node
Method Detail

getPrev

public Node getPrev()
Node getPrev()

Returns:
previous node

visit

public void visit()
visit()


cleanVisited

public static void cleanVisited()
cleanVisited()


selectBest

public Node selectBest()
                throws java.lang.Exception
Node selectBest() Selects one of the best moves

Returns:
one of the best moves
Throws:
java.lang.Exception

isEnd

public boolean isEnd()
boolean isEnd()

Returns:
true if the problem has been solved

toString

public java.lang.String toString()
String toString()

Overrides:
toString in class java.lang.Object