Buggy code:
class OnlineSimulatorAdd { public static void main ( String [ ] args ) { AndOrTree aoTree ; HeuristicSearchOrNode rootNode ; int expC = 0 ; int foundOptimalAction = 0 ; double cumR = 0 ; <START_BUG> String probFilename = "..//..//..//..//data//problems//rocksample//RockSample_7_8.SPUDD" ; <END_BUG> PomdpAdd factoredProb = ( ( PomdpAdd ) ( FileParser . loadPomdp ( probFilename , PARSE_SPUDD ) ) ) ; ValueFunction uBound = FileParser . loadUpperBound ( probFilename , PARSE_SPUDD ) ; ValueFunction lBound = FileParser . loadLowerBound ( probFilename , PARSE_SPUDD ) ; AEMS2 aems2h = new AEMS2 ( factoredProb ) ; List < Integer > states = new ArrayList < Integer > ( ) ; int [ ] [ ] factoredS ; for ( int r = 0 ; r < ( factoredProb . nrStates ( ) ) ; ++ r ) { factoredS = new int [ ] [ ] { factoredProb . getstaIds ( ) , Utils . sdecode ( r , factoredProb . getnrStaV ( ) , factoredProb . getstaArity ( ) ) } ; if ( ( OP . eval ( ( ( BeliefStateAdd ) ( factoredProb . getInitialBeliefState ( ) ) ) . bAdd , factoredS ) ) > 0 ) { states . add ( new Integer ( r ) ) ; } } int GRID_SIZE = 7 ; int [ ] [ ] ROCK_POSITIONS = new int [ ] [ ] { new int [ ] { 2 , 0 } , new int [ ] { 0 , 1 } , new int [ ] { 3 , 1 } , new int [ ] { 6 , 3 } , new int [ ] { 2 , 4 } , new int [ ] { 3 , 4 } , new int [ ] { 5 , 5 } , new int [ ] { 1 , 6 } } ; int [ ] SARTING_POS = new int [ ] { 0 , 3 } ; int NUM_ROCKS = ROCK_POSITIONS . length ; final double EPSILON_ACT_TH = 0.001 ; final int EPISODECOUNT = 10 ; final int MAXEPISODELENGTH = 100 ; final int TOTALRUNS = ( ( int ) ( Math . pow ( 2 , NUM_ROCKS ) ) ) ; final long EXPANSIONTIME = 1000L ; final long TOTALPLANNINGTIME = 1000L ; final boolean USE_FACTORED_BELIEFS = true ; SimulatorStatistics stats = new SimulatorStatistics ( TOTALRUNS , EPISODECOUNT ) ; OnlineSimulatorAdd . display ( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" ) ; OnlineSimulatorAdd . display ( "libpomdp<seq2seq4repair_space>log<seq2seq4repair_space>-<seq2seq4repair_space>config<seq2seq4repair_space>parameters" ) ; OnlineSimulatorAdd . display ( "--------------------------------" ) ; OnlineSimulatorAdd . display ( ( "TOTALRUNS<seq2seq4repair_space>=<seq2seq4repair_space>" + TOTALRUNS ) ) ; OnlineSimulatorAdd . display ( ( "EPISODECOUNT<seq2seq4repair_space>=<seq2seq4repair_space>" + EPISODECOUNT ) ) ; OnlineSimulatorAdd . display ( ( "MAXEPISODELENGTH<seq2seq4repair_space>=<seq2seq4repair_space>" + MAXEPISODELENGTH ) ) ; OnlineSimulatorAdd . display ( ( "EXPANSIONTIME<seq2seq4repair_space>=<seq2seq4repair_space>" + EXPANSIONTIME ) ) ; OnlineSimulatorAdd . display ( ( "EPSILON_ACT_TH<seq2seq4repair_space>=<seq2seq4repair_space>" + EPSILON_ACT_TH ) ) ; OnlineSimulatorAdd . display ( ( "USE_FACTORED_BELIEFS<seq2seq4repair_space>=<seq2seq4repair_space>" + USE_FACTORED_BELIEFS ) ) ; OnlineSimulatorAdd . display ( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" ) ; for ( int runNumber = 0 ; runNumber < TOTALRUNS ; ++ runNumber ) { OnlineSimulatorAdd . display ( ( ( ( ( "======================<seq2seq4repair_space>UPDATE<seq2seq4repair_space>RUN<seq2seq4repair_space>" + runNumber ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + TOTALRUNS ) + "==============================" ) ) ; for ( int episodeNumber = 0 ; episodeNumber < EPISODECOUNT ; ++ episodeNumber ) { OnlineSimulatorAdd . display ( ( ( ( ( "**********************<seq2seq4repair_space>EPISODE<seq2seq4repair_space>" + episodeNumber ) + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + EPISODECOUNT ) + "*********************" ) ) ; BeliefState b_init ; if ( USE_FACTORED_BELIEFS ) { DD [ ] dd_init = new DD [ 1 ] ; dd_init [ 0 ] = ( ( BeliefStateAdd ) ( factoredProb . getInitialBeliefState ( ) ) ) . bAdd ; b_init = new BeliefStateFactoredAdd ( OP . marginals ( dd_init , factoredProb . getstaIds ( ) , factoredProb . getstaIdsPr ( ) ) , factoredProb . getstaIds ( ) ) ; } else { b_init = factoredProb . getInitialBeliefState ( ) ; } aoTree = new AndOrTree ( factoredProb , new HeuristicSearchOrNode ( ) , lBound , uBound , aems2h ) ; aoTree . init ( b_init ) ; rootNode = aoTree . getRoot ( ) ; factoredS = new int [ ] [ ] { factoredProb . getstaIds ( ) , Utils . sdecode ( states . get ( runNumber ) , factoredProb . getnrStaV ( ) , factoredProb . getstaArity ( ) ) } ; cumR = 0 ; for ( int iter = 0 ; iter < MAXEPISODELENGTH ; ++ iter ) { OnlineSimulatorAdd . display ( ( "INSTANCE<seq2seq4repair_space>" + iter ) ) ; OnlineSimulatorAdd . displaySep ( "*" ) ; OnlineSimulatorAdd . display ( ( "Current<seq2seq4repair_space>world<seq2seq4repair_space>state<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( factoredProb . printS ( factoredS ) ) ) ) ; RockSampleGraph . drawState ( GRID_SIZE , ROCK_POSITIONS , factoredS ) ; if ( ( rootNode . getBeliefState ( ) ) instanceof BeliefStateFactoredAdd ) { OnlineSimulatorAdd . display ( "Current<seq2seq4repair_space>belief<seq2seq4repair_space>agree<seq2seq4repair_space>prob:<seq2seq4repair_space>" ) ; OnlineSimulatorAdd . display ( OP . evalN ( ( ( BeliefStateFactoredAdd ) ( rootNode . getBeliefState ( ) ) ) . marginals , factoredS ) ) ; } else { OnlineSimulatorAdd . display ( ( "Current<seq2seq4repair_space>belief<seq2seq4repair_space>agree<seq2seq4repair_space>prob:<seq2seq4repair_space>" + ( OP . eval ( ( ( BeliefStateAdd ) ( rootNode . getBeliefState ( ) ) ) . bAdd , factoredS ) ) ) ) ; } OnlineSimulatorAdd . display ( ( "Current<seq2seq4repair_space>|T|<seq2seq4repair_space>is:<seq2seq4repair_space>" + ( rootNode . getSubTreeSize ( ) ) ) ) ; expC = 0 ; foundOptimalAction = 0 ; long tic = System . currentTimeMillis ( ) ; while ( ( ( System . currentTimeMillis ( ) ) - tic ) < EXPANSIONTIME ) { aoTree . expand ( rootNode . bStar ) ; aoTree . updateAncestors ( rootNode . bStar ) ; expC = expC + 1 ; } int a = aoTree . currentBestAction ( ) ; if ( aoTree . actionIsEpsOptimal ( a , EPSILON_ACT_TH ) ) { foundOptimalAction = 1 ; } DD [ ] restrictedT = OP . restrictN ( factoredProb . T [ a ] , factoredS ) ;

Fix:
String probFilename = "data//problems//rocksample//RockSample_7_8.SPUDD" ;