if (!(resultState instanceof GridState)
|| !(previousState instanceof GridState)) {
throw new WorldError("Must be instance of GridState");
}
GridState gridResultState = (GridState) resultState;
GridState gridPreviousState = (GridState) previousState;
Action resultingAction = determineResultingAction(gridPreviousState,
gridResultState);
GridState desiredState = determineActionState(gridPreviousState,
desiredAction);
// are we trying to move nowhere
if (gridResultState == gridPreviousState) {
if (GridWorld.isStateBlocked(desiredState))