Set<SuccessorState> result = new TreeSet<SuccessorState>();
if (action != null) {
// probability of successful action
if (this.probabilitySuccess > Encog.DEFAULT_DOUBLE_EQUAL) {
State newState = determineActionState((GridState) state, action);
if( newState!=null )
result.add(new SuccessorState(newState, this.probabilitySuccess));
}
// probability of left
if (this.probabilityLeft > Encog.DEFAULT_DOUBLE_EQUAL) {
State newState = determineActionState((GridState) state,
GridWorld.leftOfAction(action));
if( newState!=null )
result.add(new SuccessorState(newState, this.probabilityLeft));
}
// probability of right
if (this.probabilityRight > Encog.DEFAULT_DOUBLE_EQUAL) {
State newState = determineActionState((GridState) state,
GridWorld.rightOfAction(action));
if( newState!=null )
result.add(new SuccessorState(newState, this.probabilityRight));
}
// probability of reverse
if (this.probabilityReverse > Encog.DEFAULT_DOUBLE_EQUAL) {
State newState = determineActionState((GridState) state,
GridWorld.reverseOfAction(action));
if( newState!=null )
result.add(new SuccessorState(newState, this.probabilityReverse));
}
}