public int eval0(INode state){
  JumpingSolitaireState node=(JumpingSolitaireState)state;
  DoubleLinkedList<IMove> mv=node.validMoves();
  int hn=(mv.size()) * 2;
  int nf=0;
  for (int i=0; i < node.filled.length; i++) {
    if (node.filled[i])     nf++;
  }
  int ni=numIsolated(node);
  if (ni == 1) {
    hn+=(int)Math.sqrt(nf);
  }
 else {
    hn+=nf - ni * ni;
  }
  int gn=0;
  DepthTransition t=(DepthTransition)state.storedData();
  if (t != null) {
    gn=t.depth;
  }
  return gn + hn;
}

public int eval0 ( INode state ) { JumpingSolitaireState node = ( JumpingSolitaireState ) state ; DoubleLinkedList < IMove > mv = node . validMoves ( ) ; int hn = ( mv . size ( ) ) * 2 ; int nf = 0 ; for ( int i = 0 ; i < node . filled . length ; i ++ ) { if ( node . filled [ i ] ) nf ++ ; } int ni = numIsolated ( node ) ; if ( ni == 1 ) { hn += ( int ) Math . sqrt ( nf ) ; } else { hn += nf - ni * ni ; } int gn = 0 ; DepthTransition t = ( DepthTransition ) state . storedData ( ) ; if ( t != null ) { gn = t . depth ; } return gn + hn ; }
h ^ ( n ) takes into account number of isolated pegs . < p > compute f ^ ( n ) = g ^ ( n ) + h ^ ( n ) where g ( n ) is the length of the path form the start node n to the state . < p >
