private byte [ ] getObservation ( boolean done ) { byte [ ] obs = envState . obs ; if ( obs == null && ! done ) { try { cond . await ( COND_WAIT_SECONDS , TimeUnit . SECONDS ) ; } catch ( InterruptedException ie ) { } obs = envState . obs ; } if ( obs == null ) { obs = new byte [ 0 ] ; } return obs ; }
Get the current observation . If none and not done wait for a short time .